From a59e6adec817f1966742b8f5e628bdb25d875de0 Mon Sep 17 00:00:00 2001 From: James Garner Date: Mon, 30 Sep 2024 09:44:57 +1300 Subject: [PATCH] fix: regenerate code after switching to full schemas --- juju/client/_client.py | 350 +- juju/client/_client1.py | 11870 +++++++++++++- juju/client/_client11.py | 2297 +++ juju/client/_client19.py | 4501 ++++++ juju/client/_client2.py | 6319 +++++++- juju/client/_client3.py | 4400 +++++- juju/client/_client4.py | 2978 +++- juju/client/_client5.py | 564 + juju/client/_client7.py | 1175 ++ juju/client/_definitions.py | 28486 ++++++++++++++++++++++++---------- 10 files changed, 52522 insertions(+), 10418 deletions(-) diff --git a/juju/client/_client.py b/juju/client/_client.py index 4db39849..f63212b4 100644 --- a/juju/client/_client.py +++ b/juju/client/_client.py @@ -4,21 +4,21 @@ from juju.client._definitions import * -from juju.client import _client7, _client3, _client4, _client2, _client17, _client6, _client11, _client1, _client10, _client9, _client5, _client19 +from juju.client import _client7, _client1, _client3, _client4, _client2, _client17, _client6, _client11, _client10, _client5, _client9, _client19 CLIENTS = { "7": _client7, + "1": _client1, "3": _client3, "4": _client4, "2": _client2, "17": _client17, "6": _client6, "11": _client11, - "1": _client1, "10": _client10, - "9": _client9, "5": _client5, + "9": _client9, "19": _client19 } @@ -85,10 +85,26 @@ class ActionFacade(TypeFactory): pass +class ActionPrunerFacade(TypeFactory): + pass + + class AdminFacade(TypeFactory): pass +class AgentFacade(TypeFactory): + pass + + +class AgentLifeFlagFacade(TypeFactory): + pass + + +class AgentToolsFacade(TypeFactory): + pass + + class AllModelWatcherFacade(TypeFactory): pass @@ -109,6 +125,10 @@ class ApplicationOffersFacade(TypeFactory): pass +class ApplicationScalerFacade(TypeFactory): + pass + + class BackupsFacade(TypeFactory): pass @@ -121,10 +141,70 @@ class BundleFacade(TypeFactory): pass +class CAASAdmissionFacade(TypeFactory): + pass + + +class CAASAgentFacade(TypeFactory): + pass + + +class CAASApplicationFacade(TypeFactory): + pass + + +class CAASApplicationProvisionerFacade(TypeFactory): + pass + + +class CAASFirewallerFacade(TypeFactory): + pass + + +class CAASFirewallerSidecarFacade(TypeFactory): + pass + + +class CAASModelConfigManagerFacade(TypeFactory): + pass + + +class CAASModelOperatorFacade(TypeFactory): + pass + + +class CAASOperatorFacade(TypeFactory): + pass + + +class CAASOperatorProvisionerFacade(TypeFactory): + pass + + +class CAASOperatorUpgraderFacade(TypeFactory): + pass + + +class CAASUnitProvisionerFacade(TypeFactory): + pass + + +class CharmDownloaderFacade(TypeFactory): + pass + + +class CharmRevisionUpdaterFacade(TypeFactory): + pass + + class CharmsFacade(TypeFactory): pass +class CleanerFacade(TypeFactory): + pass + + class ClientFacade(TypeFactory): pass @@ -141,34 +221,162 @@ class CredentialManagerFacade(TypeFactory): pass +class CredentialValidatorFacade(TypeFactory): + pass + + +class CrossControllerFacade(TypeFactory): + pass + + +class CrossModelRelationsFacade(TypeFactory): + pass + + +class CrossModelSecretsFacade(TypeFactory): + pass + + +class DeployerFacade(TypeFactory): + pass + + +class DiskManagerFacade(TypeFactory): + pass + + +class EntityWatcherFacade(TypeFactory): + pass + + +class EnvironUpgraderFacade(TypeFactory): + pass + + +class ExternalControllerUpdaterFacade(TypeFactory): + pass + + class FacadeVersions(TypeFactory): pass +class FanConfigurerFacade(TypeFactory): + pass + + +class FilesystemAttachmentsWatcherFacade(TypeFactory): + pass + + class FirewallRulesFacade(TypeFactory): pass +class FirewallerFacade(TypeFactory): + pass + + class HighAvailabilityFacade(TypeFactory): pass +class HostKeyReporterFacade(TypeFactory): + pass + + +class ImageMetadataFacade(TypeFactory): + pass + + class ImageMetadataManagerFacade(TypeFactory): pass +class InstanceMutaterFacade(TypeFactory): + pass + + +class InstancePollerFacade(TypeFactory): + pass + + class KeyManagerFacade(TypeFactory): pass +class KeyUpdaterFacade(TypeFactory): + pass + + +class LeadershipServiceFacade(TypeFactory): + pass + + +class LifeFlagFacade(TypeFactory): + pass + + +class LogForwardingFacade(TypeFactory): + pass + + +class LoggerFacade(TypeFactory): + pass + + +class MachineActionsFacade(TypeFactory): + pass + + class MachineManagerFacade(TypeFactory): pass +class MachineUndertakerFacade(TypeFactory): + pass + + +class MachinerFacade(TypeFactory): + pass + + +class MeterStatusFacade(TypeFactory): + pass + + +class MetricsAdderFacade(TypeFactory): + pass + + class MetricsDebugFacade(TypeFactory): pass +class MetricsManagerFacade(TypeFactory): + pass + + +class MigrationFlagFacade(TypeFactory): + pass + + +class MigrationMasterFacade(TypeFactory): + pass + + +class MigrationMinionFacade(TypeFactory): + pass + + +class MigrationStatusWatcherFacade(TypeFactory): + pass + + +class MigrationTargetFacade(TypeFactory): + pass + + class ModelConfigFacade(TypeFactory): pass @@ -181,22 +389,78 @@ class ModelManagerFacade(TypeFactory): pass +class ModelSummaryWatcherFacade(TypeFactory): + pass + + class ModelUpgraderFacade(TypeFactory): pass +class NotifyWatcherFacade(TypeFactory): + pass + + +class OfferStatusWatcherFacade(TypeFactory): + pass + + class PayloadsFacade(TypeFactory): pass +class PayloadsHookContextFacade(TypeFactory): + pass + + class PingerFacade(TypeFactory): pass +class ProvisionerFacade(TypeFactory): + pass + + +class ProxyUpdaterFacade(TypeFactory): + pass + + +class RaftLeaseFacade(TypeFactory): + pass + + +class RebootFacade(TypeFactory): + pass + + +class RelationStatusWatcherFacade(TypeFactory): + pass + + +class RelationUnitsWatcherFacade(TypeFactory): + pass + + +class RemoteRelationWatcherFacade(TypeFactory): + pass + + +class RemoteRelationsFacade(TypeFactory): + pass + + class ResourcesFacade(TypeFactory): pass +class ResourcesHookContextFacade(TypeFactory): + pass + + +class RetryStrategyFacade(TypeFactory): + pass + + class SSHClientFacade(TypeFactory): pass @@ -205,23 +469,103 @@ class SecretBackendsFacade(TypeFactory): pass +class SecretBackendsManagerFacade(TypeFactory): + pass + + +class SecretBackendsRotateWatcherFacade(TypeFactory): + pass + + +class SecretsDrainFacade(TypeFactory): + pass + + class SecretsFacade(TypeFactory): pass +class SecretsManagerFacade(TypeFactory): + pass + + +class SecretsRevisionWatcherFacade(TypeFactory): + pass + + +class SecretsTriggerWatcherFacade(TypeFactory): + pass + + +class SingularFacade(TypeFactory): + pass + + class SpacesFacade(TypeFactory): pass +class StatusHistoryFacade(TypeFactory): + pass + + class StorageFacade(TypeFactory): pass +class StorageProvisionerFacade(TypeFactory): + pass + + +class StringsWatcherFacade(TypeFactory): + pass + + class SubnetsFacade(TypeFactory): pass +class UndertakerFacade(TypeFactory): + pass + + +class UnitAssignerFacade(TypeFactory): + pass + + +class UniterFacade(TypeFactory): + pass + + +class UpgradeSeriesFacade(TypeFactory): + pass + + +class UpgradeStepsFacade(TypeFactory): + pass + + +class UpgraderFacade(TypeFactory): + pass + + class UserManagerFacade(TypeFactory): pass +class UserSecretsDrainFacade(TypeFactory): + pass + + +class UserSecretsManagerFacade(TypeFactory): + pass + + +class VolumeAttachmentPlansWatcherFacade(TypeFactory): + pass + + +class VolumeAttachmentsWatcherFacade(TypeFactory): + pass + + diff --git a/juju/client/_client1.py b/juju/client/_client1.py index 0bd3060f..38497128 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -5,10 +5,16 @@ from juju.client._definitions import * -class CredentialManagerFacade(Type): - name = 'CredentialManager' +class ActionPrunerFacade(Type): + name = 'ActionPruner' version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, + 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'}}, @@ -16,50 +22,143 @@ class CredentialManagerFacade(Type): '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'}}, + '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'} - @ReturnMapping(ErrorResult) - async def InvalidateModelCredential(self, reason=None): + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): ''' - InvalidateModelCredential marks the cloud credential for this model as invalid. + ModelConfig returns the current model's configuration. - reason : str - Returns -> ErrorResult + + Returns -> ModelConfigResult ''' - 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', + msg = dict(type='ActionPruner', + request='ModelConfig', version=1, params=_params) - _params['reason'] = reason + reply = await self.rpc(msg) return reply -class FirewallRulesFacade(Type): - name = 'FirewallRules' + @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 + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ActionPruner', + request='WatchForModelConfigChanges', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class AgentLifeFlagFacade(Type): + name = 'AgentLifeFlag' version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -67,113 +166,133 @@ class FirewallRulesFacade(Type): 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], 'type': 'object'}, - 'ErrorResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - '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'}}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(ListFirewallRulesResults) - async def ListFirewallRules(self): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - ListFirewallRules returns all the firewall rules. + Life returns the life status of every supplied entity, where available. - - Returns -> ListFirewallRulesResults + 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='FirewallRules', - request='ListFirewallRules', + msg = dict(type='AgentLifeFlag', + request='Life', version=1, params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + # map input types to rpc msg + _params = dict() + msg = dict(type='AgentLifeFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetFirewallRules(self, args=None): +class AgentToolsFacade(Type): + name = 'AgentTools' + version = 1 + schema = {'properties': {'UpdateToolsAvailable': {'description': 'UpdateToolsAvailable ' + 'invokes a lookup and ' + 'further update in ' + 'environ\n' + 'for new patches of ' + 'the current tool ' + 'versions.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def UpdateToolsAvailable(self): ''' - SetFirewallRules creates or updates the specified firewall rules. + UpdateToolsAvailable invokes a lookup and further update in environ + for new patches of the current tool versions. - args : typing.Sequence[~FirewallRule] - Returns -> ErrorResults + + Returns -> None ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() - msg = dict(type='FirewallRules', - request='SetFirewallRules', + msg = dict(type='AgentTools', + request='UpdateToolsAvailable', version=1, params=_params) - _params['args'] = args + reply = await self.rpc(msg) return reply -class ImageMetadataManagerFacade(Type): - name = 'ImageMetadataManager' +class ApplicationScalerFacade(Type): + name = 'ApplicationScaler' 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'}, + 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, @@ -190,155 +309,97 @@ class ImageMetadataManagerFacade(Type): 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'ImageMetadataFilter': {'additionalProperties': False, - 'properties': {'arches': {'items': {'type': 'string'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'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'}}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], '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'}}, + 'properties': {'Rescale': {'description': 'Rescale causes any supplied ' + 'services to be scaled up to their\n' + 'minimum size.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch returns a watcher that sends ' + 'the names of services whose\n' + 'unit count may be below their ' + 'configured minimum.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, 'type': 'object'} @ReturnMapping(ErrorResults) - async def Delete(self, image_ids=None): + async def Rescale(self, entities=None): ''' - Delete deletes cloud image metadata for given image ids. - It supports bulk calls. + Rescale causes any supplied services to be scaled up to their + minimum size. - image_ids : typing.Sequence[str] + entities : typing.Sequence[~Entity] 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))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ImageMetadataManager', - request='Delete', + msg = dict(type='ApplicationScaler', + request='Rescale', version=1, params=_params) - _params['image-ids'] = image_ids + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ListCloudImageMetadataResult) - async def List(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None): + @ReturnMapping(StringsWatchResult) + async def Watch(self): ''' - List returns all found cloud image metadata that satisfy - given filter. - Returned list contains metadata ordered by priority. + Watch returns a watcher that sends the names of services whose + unit count may be below their configured minimum. - 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 - - - - @ReturnMapping(ErrorResults) - async def Save(self, metadata=None): - ''' - Save stores given cloud image metadata. - It supports bulk calls. - metadata : typing.Sequence[~CloudImageMetadataList] - Returns -> ErrorResults + Returns -> StringsWatchResult ''' - 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', + msg = dict(type='ApplicationScaler', + request='Watch', version=1, params=_params) - _params['metadata'] = metadata + reply = await self.rpc(msg) return reply -class KeyManagerFacade(Type): - name = 'KeyManager' +class CAASAdmissionFacade(Type): + name = 'CAASAdmission' version = 1 - schema = {'definitions': {'Entities': {'additionalProperties': False, + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], @@ -354,178 +415,590 @@ class KeyManagerFacade(Type): 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], - 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'ErrorResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - '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'}}, + 'properties': {'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(ErrorResults) - async def AddKeys(self, ssh_keys=None, user=None): + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): ''' - AddKeys adds new authorised ssh keys for the specified user. + ControllerAPIInfoForModels returns the controller api connection details for the specified models. - ssh_keys : typing.Sequence[str] - user : str - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults ''' - if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): - raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) - - if user is not None and not isinstance(user, (bytes, str)): - raise Exception("Expected user to be a str, received: {}".format(type(user))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='KeyManager', - request='AddKeys', + msg = dict(type='CAASAdmission', + request='ControllerAPIInfoForModels', version=1, params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def DeleteKeys(self, ssh_keys=None, user=None): + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): ''' - DeleteKeys deletes the authorised ssh keys for the specified user. + ControllerConfig returns the controller's configuration. - 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))) + Returns -> ControllerConfigResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='KeyManager', - request='DeleteKeys', + msg = dict(type='CAASAdmission', + request='ControllerConfig', version=1, params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def ImportKeys(self, ssh_keys=None, user=None): +class CAASApplicationFacade(Type): + name = 'CAASApplication' + version = 1 + schema = {'definitions': {'CAASUnitIntroduction': {'additionalProperties': False, + 'properties': {'agent-conf': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', + 'agent-conf'], + 'type': 'object'}, + 'CAASUnitIntroductionArgs': {'additionalProperties': False, + 'properties': {'pod-name': {'type': 'string'}, + 'pod-uuid': {'type': 'string'}}, + 'required': ['pod-name', + 'pod-uuid'], + 'type': 'object'}, + 'CAASUnitIntroductionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CAASUnitIntroduction'}}, + 'type': 'object'}, + 'CAASUnitTerminationResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'WillRestart': {'type': 'boolean'}}, + 'required': ['WillRestart', + 'Error'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}}, + 'properties': {'UnitIntroduction': {'description': 'UnitIntroduction sets the ' + 'status of each given ' + 'entity.', + 'properties': {'Params': {'$ref': '#/definitions/CAASUnitIntroductionArgs'}, + 'Result': {'$ref': '#/definitions/CAASUnitIntroductionResult'}}, + 'type': 'object'}, + 'UnitTerminating': {'description': 'UnitTerminating should be ' + 'called by the ' + 'CAASUnitTerminationWorker ' + 'when\n' + 'the agent receives a ' + 'signal to exit. ' + 'UnitTerminating will ' + 'return how\n' + 'the agent should shutdown.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/CAASUnitTerminationResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CAASUnitIntroductionResult) + async def UnitIntroduction(self, pod_name=None, pod_uuid=None): ''' - ImportKeys imports new authorised ssh keys from the specified key ids for the specified user. + UnitIntroduction sets the status of each given entity. - ssh_keys : typing.Sequence[str] - user : str - Returns -> ErrorResults + pod_name : str + pod_uuid : str + Returns -> CAASUnitIntroductionResult ''' - 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 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 user is not None and not isinstance(user, (bytes, str)): - raise Exception("Expected user to be a str, received: {}".format(type(user))) + 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='KeyManager', - request='ImportKeys', + msg = dict(type='CAASApplication', + request='UnitIntroduction', version=1, params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user + _params['pod-name'] = pod_name + _params['pod-uuid'] = pod_uuid reply = await self.rpc(msg) return reply - @ReturnMapping(StringsResults) - async def ListKeys(self, entities=None, mode=None): + @ReturnMapping(CAASUnitTerminationResult) + async def UnitTerminating(self, tag=None): ''' - ListKeys returns the authorised ssh keys for the specified users. + UnitTerminating should be called by the CAASUnitTerminationWorker when + the agent receives a signal to exit. UnitTerminating will return how + the agent should shutdown. - entities : Entities - mode : bool - Returns -> StringsResults + tag : str + Returns -> CAASUnitTerminationResult ''' - if entities is not None and not isinstance(entities, (dict, Entities)): - raise Exception("Expected entities to be a Entities, received: {}".format(type(entities))) - - if mode is not None and not isinstance(mode, bool): - raise Exception("Expected mode to be a bool, received: {}".format(type(mode))) + if 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='KeyManager', - request='ListKeys', + msg = dict(type='CAASApplication', + request='UnitTerminating', version=1, params=_params) - _params['entities'] = entities - _params['mode'] = mode + _params['tag'] = tag reply = await self.rpc(msg) return reply -class ModelUpgraderFacade(Type): - name = 'ModelUpgrader' +class CAASApplicationProvisionerFacade(Type): + name = 'CAASApplicationProvisioner' version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, + 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'}}, @@ -533,10 +1006,124 @@ class ModelUpgraderFacade(Type): 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, - 'ModelParam': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}}, - 'required': ['model-tag'], + 'ErrorResult': {'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'}, @@ -549,186 +1136,388 @@ class ModelUpgraderFacade(Type): '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'], + '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'}, - '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'}}, + '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'}, - 'UpgradeModel': {'description': 'UpgradeModel upgrades a ' - 'model.', - 'properties': {'Params': {'$ref': '#/definitions/UpgradeModelParams'}, - 'Result': {'$ref': '#/definitions/UpgradeModelResult'}}, - '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'} - @ReturnMapping(None) - async def AbortModelUpgrade(self, model_tag=None): + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): ''' - AbortModelUpgrade aborts and archives the model upgrade - synchronisation record, if any. + ApplicationCharmInfo returns information about an application's charm. - model_tag : str - Returns -> None + tag : str + Returns -> Charm ''' - 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 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='ModelUpgrader', - request='AbortModelUpgrade', + msg = dict(type='CAASApplicationProvisioner', + request='ApplicationCharmInfo', version=1, params=_params) - _params['model-tag'] = model_tag + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(UpgradeModelResult) - async def UpgradeModel(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None): + @ReturnMapping(CAASApplicationOCIResourceResults) + async def ApplicationOCIResources(self, entities=None): ''' - UpgradeModel upgrades a model. + ApplicationOCIResources returns the OCI image resources for an application. - agent_stream : str - dry_run : bool - ignore_agent_versions : bool - model_tag : str - target_version : Number - Returns -> UpgradeModelResult + entities : typing.Sequence[~Entity] + Returns -> CAASApplicationOCIResourceResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - 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))) + # 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 - 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))) + @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='ModelUpgrader', - request='UpgradeModel', + msg = dict(type='CAASApplicationProvisioner', + request='CharmInfo', 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 + _params['url'] = url reply = await self.rpc(msg) return reply -class PayloadsFacade(Type): - name = 'Payloads' - version = 1 - schema = {'definitions': {'Payload': {'additionalProperties': False, - 'properties': {'class': {'type': 'string'}, - 'id': {'type': 'string'}, - 'labels': {'items': {'type': 'string'}, - 'type': 'array'}, - 'machine': {'type': 'string'}, - 'status': {'type': 'string'}, - 'type': {'type': 'string'}, - 'unit': {'type': 'string'}}, - 'required': ['class', - 'type', - 'id', - 'status', - 'labels', - 'unit', - 'machine'], - 'type': 'object'}, - 'PayloadListArgs': {'additionalProperties': False, - 'properties': {'patterns': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['patterns'], - 'type': 'object'}, - 'PayloadListResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/Payload'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'List': {'description': 'List builds the list of payloads ' - 'being tracked for\n' - 'the given unit and IDs. If no IDs are ' - 'provided then all tracked\n' - 'payloads for the unit are returned.', - 'properties': {'Params': {'$ref': '#/definitions/PayloadListArgs'}, - 'Result': {'$ref': '#/definitions/PayloadListResults'}}, - 'type': 'object'}}, - 'type': 'object'} - + @ReturnMapping(ErrorResults) + async def ClearApplicationsResources(self, entities=None): + ''' + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. - @ReturnMapping(PayloadListResults) - async def List(self, patterns=None): + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - 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. + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - patterns : typing.Sequence[str] - Returns -> PayloadListResults + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ClearApplicationsResources', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnits(self, units=None): ''' - if patterns is not None and not isinstance(patterns, (bytes, str, list)): - raise Exception("Expected patterns to be a Sequence, received: {}".format(type(patterns))) + 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='Payloads', - request='List', + msg = dict(type='CAASApplicationProvisioner', + request='DestroyUnits', version=1, params=_params) - _params['patterns'] = patterns + _params['units'] = units reply = await self.rpc(msg) return reply -class PingerFacade(Type): - name = 'Pinger' - version = 1 - schema = {'properties': {'Ping': {'type': 'object'}, 'Stop': {'type': 'object'}}, - 'type': 'object'} - + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. - @ReturnMapping(None) - async def Ping(self): + 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))) - Returns -> None + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CAASApplicationProvisionerConfigResult) + async def ProvisionerConfig(self): + ''' + ProvisionerConfig returns the provisioner's configuration. + + + Returns -> CAASApplicationProvisionerConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='Pinger', - request='Ping', + msg = dict(type='CAASApplicationProvisioner', + request='ProvisionerConfig', version=1, params=_params) @@ -737,53 +1526,9339 @@ async def Ping(self): - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(CAASApplicationProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): ''' + ProvisioningInfo returns the info needed to provision a caas application. - Returns -> None + 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='Pinger', - request='Stop', + msg = dict(type='CAASApplicationProvisioner', + request='ProvisioningInfo', version=1, params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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 -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'}}, + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Remove', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetOperatorStatus(self, entities=None): + ''' + SetOperatorStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='SetOperatorStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(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 + + + + @ReturnMapping(CAASUnitsResults) + async def Units(self, entities=None): + ''' + Units returns all the units for each application specified. + + entities : typing.Sequence[~Entity] + Returns -> CAASUnitsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Units', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateApplicationUnitResults) + async def UpdateApplicationsUnits(self, args=None): + ''' + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. + + args : typing.Sequence[~UpdateApplicationUnits] + Returns -> UpdateApplicationUnitResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='UpdateApplicationsUnits', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(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 + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch changes to the + lifecycle states of units for the specified applications in + this model. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='WatchUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class CAASFirewallerFacade(Type): + name = 'CAASFirewaller' + version = 1 + schema = {'definitions': {'ApplicationGetConfigResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Charm': {'additionalProperties': False, + 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, + 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, + 'type': 'object'}, + 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'manifest': {'$ref': '#/definitions/CharmManifest'}, + 'meta': {'$ref': '#/definitions/CharmMeta'}, + 'metrics': {'$ref': '#/definitions/CharmMetrics'}, + 'revision': {'type': 'integer'}, + 'url': {'type': 'string'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'ApplicationCharmInfo': {'description': 'ApplicationCharmInfo ' + 'returns information ' + 'about an ' + "application's charm.", + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ApplicationsConfig': {'description': 'ApplicationsConfig ' + 'returns the config for ' + 'the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'IsExposed': {'description': 'IsExposed returns whether the ' + 'specified applications are ' + 'exposed.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): + ''' + ApplicationsConfig returns the config for the specified applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='ApplicationsConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def IsExposed(self, entities=None): + ''' + IsExposed returns whether the specified applications are exposed. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='IsExposed', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class 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'} + + + @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 + + + + @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 + + + + @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 + + + + @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 + + + + @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 + + + + @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 + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + 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 + + + +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'} + + + @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 + + + + @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 + + + +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'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='APIAddresses', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelOperatorInfo) + async def ModelOperatorProvisioningInfo(self): + ''' + ModelOperatorProvisioningInfo returns the information needed for provisioning + a new model operator into a caas cluster. + + + Returns -> ModelOperatorInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='ModelOperatorProvisioningInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is used to operate. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='ModelUUID', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchModelOperatorProvisioningInfo(self): + ''' + WatchModelOperatorProvisioningInfo provides a watcher for changes that affect the + information returned by ModelOperatorProvisioningInfo. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='WatchModelOperatorProvisioningInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASOperatorFacade(Type): + name = 'CAASOperator' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationCharm': {'additionalProperties': False, + 'properties': {'charm-modified-version': {'type': 'integer'}, + 'deployment-mode': {'type': 'string'}, + 'force-upgrade': {'type': 'boolean'}, + 'sha256': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'sha256', + 'charm-modified-version'], + 'type': 'object'}, + 'ApplicationCharmResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationCharm'}}, + 'type': 'object'}, + 'ApplicationCharmResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Patch': {'type': 'integer'}, + 'Release': {'type': 'string'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesVersion': {'additionalProperties': False, + 'properties': {'agent-tools': {'items': {'$ref': '#/definitions/EntityVersion'}, + 'type': 'array'}}, + 'required': ['agent-tools'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'tools': {'$ref': '#/definitions/Version'}}, + 'required': ['tag', 'tools'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'SetPodSpecParams': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Version': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version'], + 'type': 'object'}, + 'WatchContainerStartArg': {'additionalProperties': False, + 'properties': {'container': {'type': 'string'}, + 'entity': {'$ref': '#/definitions/Entity'}}, + 'required': ['entity'], + 'type': 'object'}, + 'WatchContainerStartArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/WatchContainerStartArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Charm': {'description': 'Charm returns the charm info for all ' + 'given applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmResults'}}, + 'type': 'object'}, + 'CurrentModel': {'description': 'CurrentModel returns the name ' + 'and UUID for the current juju ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this facade is used to ' + 'operate.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPodSpec': {'description': 'SetPodSpec sets the container ' + 'specs for a set of ' + 'applications.\n' + 'TODO(juju3) - remove', + 'properties': {'Params': {'$ref': '#/definitions/SetPodSpecParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetTools': {'description': 'SetTools updates the recorded ' + 'tools version for the agents.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchContainerStart': {'description': 'WatchContainerStart ' + 'starts a StringWatcher ' + 'to watch for container ' + 'start events\n' + 'on the CAAS api for a ' + 'specific application ' + 'and container.', + 'properties': {'Params': {'$ref': '#/definitions/WatchContainerStartArgs'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch changes ' + 'to the\n' + 'lifecycle states of units for ' + 'the specified applications in\n' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='APIAddresses', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmResults) + async def Charm(self, entities=None): + ''' + Charm returns the charm info for all given applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationCharmResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Charm', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + CurrentModel returns the name and UUID for the current juju model. + + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='CurrentModel', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is used to operate. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='ModelUUID', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Remove', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPodSpec(self, specs=None): + ''' + SetPodSpec sets the container specs for a set of applications. + TODO(juju3) - remove + + specs : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if specs is not None and not isinstance(specs, (bytes, str, list)): + raise Exception("Expected specs to be a Sequence, received: {}".format(type(specs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='SetPodSpec', + version=1, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='SetStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetTools(self, agent_tools=None): + ''' + SetTools updates the recorded tools version for the agents. + + agent_tools : typing.Sequence[~EntityVersion] + Returns -> ErrorResults + ''' + if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): + raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='SetTools', + version=1, + params=_params) + _params['agent-tools'] = agent_tools + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainerStart(self, args=None): + ''' + WatchContainerStart starts a StringWatcher to watch for container start events + on the CAAS api for a specific application and container. + + args : typing.Sequence[~WatchContainerStartArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='WatchContainerStart', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch changes to the + lifecycle states of units for the specified applications in + this model. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='WatchUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class CAASOperatorProvisionerFacade(Type): + name = 'CAASOperatorProvisioner' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Charm': {'additionalProperties': False, + 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, + 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, + 'type': 'object'}, + 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'manifest': {'$ref': '#/definitions/CharmManifest'}, + 'meta': {'$ref': '#/definitions/CharmMeta'}, + 'metrics': {'$ref': '#/definitions/CharmMetrics'}, + 'revision': {'type': 'integer'}, + 'url': {'type': 'string'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'DockerImageInfo': {'additionalProperties': False, + 'properties': {'auth': {'type': 'string'}, + 'email': {'type': 'string'}, + 'identitytoken': {'type': 'string'}, + 'image-name': {'type': 'string'}, + 'password': {'type': 'string'}, + 'registrytoken': {'type': 'string'}, + 'repository': {'type': 'string'}, + 'serveraddress': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['image-name'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IssueOperatorCertificateResult': {'additionalProperties': False, + 'properties': {'ca-cert': {'type': 'string'}, + 'cert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'private-key': {'type': 'string'}}, + 'required': ['ca-cert', + 'cert', + 'private-key'], + 'type': 'object'}, + 'IssueOperatorCertificateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IssueOperatorCertificateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesFilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesFilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'OperatorProvisioningInfo': {'additionalProperties': False, + 'properties': {'api-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + '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'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='APIAddresses', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IssueOperatorCertificateResults) + async def IssueOperatorCertificate(self, entities=None): + ''' + IssueOperatorCertificate issues an x509 certificate for use by the specified application operator. + + entities : typing.Sequence[~Entity] + Returns -> IssueOperatorCertificateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='IssueOperatorCertificate', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is used to operate. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='ModelUUID', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OperatorProvisioningInfoResults) + async def OperatorProvisioningInfo(self, entities=None): + ''' + OperatorProvisioningInfo returns the info needed to provision an operator. + + entities : typing.Sequence[~Entity] + Returns -> OperatorProvisioningInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='OperatorProvisioningInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASOperatorUpgraderFacade(Type): + name = 'CAASOperatorUpgrader' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'KubernetesUpgradeArg': {'additionalProperties': False, + 'properties': {'agent-tag': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['agent-tag', 'version'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}}, + 'properties': {'UpgradeOperator': {'description': 'UpgradeOperator upgrades ' + 'the operator for the ' + 'specified agents.', + 'properties': {'Params': {'$ref': '#/definitions/KubernetesUpgradeArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def UpgradeOperator(self, agent_tag=None, version=None): + ''' + UpgradeOperator upgrades the operator for the specified agents. + + agent_tag : str + version : Number + Returns -> ErrorResult + ''' + if agent_tag is not None and not isinstance(agent_tag, (bytes, str)): + raise Exception("Expected agent_tag to be a str, received: {}".format(type(agent_tag))) + + if version is not None and not isinstance(version, (dict, Number)): + raise Exception("Expected version to be a Number, received: {}".format(type(version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorUpgrader', + request='UpgradeOperator', + version=1, + params=_params) + _params['agent-tag'] = agent_tag + _params['version'] = version + reply = await self.rpc(msg) + return reply + + + +class CharmDownloaderFacade(Type): + name = 'CharmDownloader' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'DownloadApplicationCharms': {'description': 'DownloadApplicationCharms ' + 'iterates the ' + 'list of provided ' + 'applications ' + 'and\n' + 'downloads any ' + 'referenced ' + 'charms that have ' + 'not yet been ' + 'persisted to ' + 'the\n' + 'blob store.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchApplicationsWithPendingCharms': {'description': 'WatchApplicationsWithPendingCharms ' + 'registers ' + 'and ' + 'returns ' + 'a ' + 'watcher ' + 'instance\n' + 'that ' + 'reports ' + 'the ID ' + 'of ' + 'applications ' + 'that ' + 'reference ' + 'a charm ' + 'which ' + 'has not ' + 'yet\n' + 'been ' + 'downloaded.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def DownloadApplicationCharms(self, entities=None): + ''' + DownloadApplicationCharms iterates the list of provided applications and + downloads any referenced charms that have not yet been persisted to the + blob store. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CharmDownloader', + request='DownloadApplicationCharms', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplicationsWithPendingCharms(self): + ''' + WatchApplicationsWithPendingCharms registers and returns a watcher instance + that reports the ID of applications that reference a charm which has not yet + been downloaded. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CharmDownloader', + request='WatchApplicationsWithPendingCharms', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CredentialManagerFacade(Type): + name = 'CredentialManager' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'InvalidateCredentialArg': {'additionalProperties': False, + 'properties': {'reason': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'InvalidateModelCredential': {'description': 'InvalidateModelCredential ' + 'marks the cloud ' + 'credential for ' + 'this model as ' + 'invalid.', + 'properties': {'Params': {'$ref': '#/definitions/InvalidateCredentialArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def InvalidateModelCredential(self, reason=None): + ''' + InvalidateModelCredential marks the cloud credential for this model as invalid. + + reason : str + Returns -> ErrorResult + ''' + if reason is not None and not isinstance(reason, (bytes, str)): + raise Exception("Expected reason to be a str, received: {}".format(type(reason))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialManager', + request='InvalidateModelCredential', + version=1, + params=_params) + _params['reason'] = reason + reply = await self.rpc(msg) + return reply + + + +class CrossControllerFacade(Type): + name = 'CrossController' + version = 1 + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ControllerInfo': {'description': 'ControllerInfo returns the ' + 'API info for the ' + 'controller.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'WatchControllerInfo': {'description': 'WatchControllerInfo ' + 'creates a watcher that ' + 'notifies when the API ' + 'info\n' + 'for the controller ' + 'changes.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerInfo(self): + ''' + ControllerInfo returns the API info for the controller. + + + Returns -> ControllerAPIInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossController', + request='ControllerInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchControllerInfo(self): + ''' + WatchControllerInfo creates a watcher that notifies when the API info + for the controller changes. + + + Returns -> NotifyWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossController', + request='WatchControllerInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class 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'}, + 'source-controller-uuid': {'type': 'string'}, + 'unit-id': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + 'required': ['source-controller-uuid', + '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'} + + + @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 + + + + @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 + + + +class DeployerFacade(Type): + name = 'Deployer' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'DeployerConnectionValues': {'additionalProperties': False, + 'properties': {'api-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['api-addresses'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ConnectionInfo': {'description': 'ConnectionInfo returns all ' + 'the address information ' + 'that the\n' + 'deployer task needs in one ' + 'call.', + 'properties': {'Result': {'$ref': '#/definitions/DeployerConnectionValues'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this facade is deploying ' + 'into.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of the ' + 'specified entities.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch all ' + 'units belonging to\n' + 'to any entity (machine or ' + 'service) passed in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='APIAddresses', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DeployerConnectionValues) + async def ConnectionInfo(self): + ''' + ConnectionInfo returns all the address information that the + deployer task needs in one call. + + + Returns -> DeployerConnectionValues + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='ConnectionInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is deploying into. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='ModelUUID', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='Remove', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus sets the status of the specified entities. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='SetStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch all units belonging to + to any entity (machine or service) passed in args. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='WatchUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class EnvironUpgraderFacade(Type): + name = 'EnvironUpgrader' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetModelEnvironVersion': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'version': {'type': 'integer'}}, + 'required': ['model-tag', + 'version'], + 'type': 'object'}, + 'SetModelEnvironVersions': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/SetModelEnvironVersion'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}}, + 'properties': {'ModelEnvironVersion': {'description': 'ModelEnvironVersion ' + 'returns the current ' + 'version of the environ ' + 'corresponding\n' + 'to each specified ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'ModelTargetEnvironVersion': {'description': 'ModelTargetEnvironVersion ' + 'returns the ' + 'target version ' + 'of the environ\n' + 'corresponding to ' + 'each specified ' + 'model. The ' + 'target version ' + 'is the\n' + 'environ ' + "provider's " + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'SetModelEnvironVersion': {'description': 'SetModelEnvironVersion ' + 'sets the current ' + 'version of the ' + 'environ ' + 'corresponding\n' + 'to each specified ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelEnvironVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelStatus': {'description': 'SetModelStatus sets the ' + 'status of each given model.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchModelEnvironVersion': {'description': 'WatchModelEnvironVersion ' + 'watches for ' + 'changes to the ' + 'environ version ' + 'of the\n' + 'specified ' + 'models.\n' + '\n' + 'NOTE(axw) this is ' + 'currently ' + 'implemented in ' + 'terms of ' + 'state.Model.Watch, ' + 'so\n' + 'the client may be ' + 'notified of ' + 'changes unrelated ' + 'to the environ ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(IntResults) + async def ModelEnvironVersion(self, entities=None): + ''' + ModelEnvironVersion returns the current version of the environ corresponding + to each specified model. + + entities : typing.Sequence[~Entity] + Returns -> IntResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='ModelEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def ModelTargetEnvironVersion(self, entities=None): + ''' + ModelTargetEnvironVersion returns the target version of the environ + corresponding to each specified model. The target version is the + environ provider's version. + + entities : typing.Sequence[~Entity] + Returns -> IntResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='ModelTargetEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelEnvironVersion(self, models=None): + ''' + SetModelEnvironVersion sets the current version of the environ corresponding + to each specified model. + + models : typing.Sequence[~SetModelEnvironVersion] + Returns -> ErrorResults + ''' + if models is not None and not isinstance(models, (bytes, str, list)): + raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='SetModelEnvironVersion', + version=1, + params=_params) + _params['models'] = models + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelStatus(self, entities=None): + ''' + SetModelStatus sets the status of each given model. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='SetModelStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchModelEnvironVersion(self, entities=None): + ''' + WatchModelEnvironVersion watches for changes to the environ version of the + specified models. + + NOTE(axw) this is currently implemented in terms of state.Model.Watch, so + the client may be notified of changes unrelated to the environ version. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='WatchModelEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ExternalControllerUpdaterFacade(Type): + name = 'ExternalControllerUpdater' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ExternalControllerInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}}, + 'required': ['controller-tag', + 'controller-alias', + 'addrs', + 'ca-cert'], + 'type': 'object'}, + 'ExternalControllerInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ExternalControllerInfo'}}, + 'required': ['result', + 'error'], + 'type': 'object'}, + 'ExternalControllerInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ExternalControllerInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetExternalControllerInfoParams': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}}, + 'required': ['info'], + 'type': 'object'}, + 'SetExternalControllersInfoParams': {'additionalProperties': False, + 'properties': {'controllers': {'items': {'$ref': '#/definitions/SetExternalControllerInfoParams'}, + 'type': 'array'}}, + 'required': ['controllers'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ExternalControllerInfo': {'description': 'ExternalControllerInfo ' + 'returns the info ' + 'for the specified ' + 'external ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ExternalControllerInfoResults'}}, + 'type': 'object'}, + 'SetExternalControllerInfo': {'description': 'SetExternalControllerInfo ' + 'saves the info ' + 'for the ' + 'specified ' + 'external ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/SetExternalControllersInfoParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchExternalControllers': {'description': 'WatchExternalControllers ' + 'watches for the ' + 'addition and ' + 'removal of ' + 'external\n' + 'controller ' + 'records to the ' + 'local ' + "controller's " + 'database.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ExternalControllerInfoResults) + async def ExternalControllerInfo(self, entities=None): + ''' + ExternalControllerInfo returns the info for the specified external controllers. + + entities : typing.Sequence[~Entity] + Returns -> ExternalControllerInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ExternalControllerUpdater', + request='ExternalControllerInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetExternalControllerInfo(self, controllers=None): + ''' + SetExternalControllerInfo saves the info for the specified external controllers. + + controllers : typing.Sequence[~SetExternalControllerInfoParams] + Returns -> ErrorResults + ''' + if controllers is not None and not isinstance(controllers, (bytes, str, list)): + raise Exception("Expected controllers to be a Sequence, received: {}".format(type(controllers))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ExternalControllerUpdater', + request='SetExternalControllerInfo', + version=1, + params=_params) + _params['controllers'] = controllers + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchExternalControllers(self): + ''' + WatchExternalControllers watches for the addition and removal of external + controller records to the local controller's database. + + + Returns -> StringsWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ExternalControllerUpdater', + request='WatchExternalControllers', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class FanConfigurerFacade(Type): + name = 'FanConfigurer' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'FanConfigEntry': {'additionalProperties': False, + 'properties': {'overlay': {'type': 'string'}, + 'underlay': {'type': 'string'}}, + 'required': ['underlay', 'overlay'], + 'type': 'object'}, + 'FanConfigResult': {'additionalProperties': False, + 'properties': {'fans': {'items': {'$ref': '#/definitions/FanConfigEntry'}, + 'type': 'array'}}, + 'required': ['fans'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'FanConfig': {'description': 'FanConfig returns current FAN ' + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/FanConfigResult'}}, + 'type': 'object'}, + 'WatchForFanConfigChanges': {'description': 'WatchForFanConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'FAN ' + 'configuration.\n' + 'so we use the ' + 'regular error ' + 'return.\n' + 'TODO(wpk) ' + '2017-09-21 We ' + 'should use Model ' + 'directly, and ' + 'watch only for ' + 'FanConfig ' + 'changes.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(FanConfigResult) + async def FanConfig(self): + ''' + FanConfig returns current FAN configuration. + + + Returns -> FanConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FanConfigurer', + request='FanConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForFanConfigChanges(self): + ''' + WatchForFanConfigChanges returns a NotifyWatcher that observes + changes to the FAN configuration. + so we use the regular error return. + TODO(wpk) 2017-09-21 We should use Model directly, and watch only for FanConfig changes. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FanConfigurer', + request='WatchForFanConfigChanges', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class FirewallRulesFacade(Type): + name = 'FirewallRules' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FirewallRule': {'additionalProperties': False, + 'properties': {'known-service': {'type': 'string'}, + 'whitelist-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-service'], + 'type': 'object'}, + 'FirewallRuleArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ListFirewallRulesResults': {'additionalProperties': False, + 'properties': {'Rules': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['Rules'], + 'type': 'object'}}, + 'properties': {'ListFirewallRules': {'description': 'ListFirewallRules ' + 'returns all the firewall ' + 'rules.', + 'properties': {'Result': {'$ref': '#/definitions/ListFirewallRulesResults'}}, + 'type': 'object'}, + 'SetFirewallRules': {'description': 'SetFirewallRules creates ' + 'or updates the specified ' + 'firewall rules.', + 'properties': {'Params': {'$ref': '#/definitions/FirewallRuleArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ListFirewallRulesResults) + async def ListFirewallRules(self): + ''' + ListFirewallRules returns all the firewall rules. + + + Returns -> ListFirewallRulesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FirewallRules', + request='ListFirewallRules', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetFirewallRules(self, args=None): + ''' + SetFirewallRules creates or updates the specified firewall rules. + + args : typing.Sequence[~FirewallRule] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='FirewallRules', + request='SetFirewallRules', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class HostKeyReporterFacade(Type): + name = 'HostKeyReporter' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHHostKeySet': {'additionalProperties': False, + 'properties': {'entity-keys': {'items': {'$ref': '#/definitions/SSHHostKeys'}, + 'type': 'array'}}, + 'required': ['entity-keys'], + 'type': 'object'}, + 'SSHHostKeys': {'additionalProperties': False, + 'properties': {'public-keys': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'public-keys'], + 'type': 'object'}}, + 'properties': {'ReportKeys': {'description': 'ReportKeys sets the SSH host ' + 'keys for one or more entities.', + 'properties': {'Params': {'$ref': '#/definitions/SSHHostKeySet'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ReportKeys(self, entity_keys=None): + ''' + ReportKeys sets the SSH host keys for one or more entities. + + entity_keys : typing.Sequence[~SSHHostKeys] + Returns -> ErrorResults + ''' + if entity_keys is not None and not isinstance(entity_keys, (bytes, str, list)): + raise Exception("Expected entity_keys to be a Sequence, received: {}".format(type(entity_keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='HostKeyReporter', + request='ReportKeys', + version=1, + params=_params) + _params['entity-keys'] = entity_keys + reply = await self.rpc(msg) + return reply + + + +class ImageMetadataManagerFacade(Type): + name = 'ImageMetadataManager' + version = 1 + schema = {'definitions': {'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + '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'} + + + @ReturnMapping(ErrorResults) + async def Delete(self, image_ids=None): + ''' + Delete deletes cloud image metadata for given image ids. + It supports bulk calls. + + image_ids : typing.Sequence[str] + Returns -> ErrorResults + ''' + if image_ids is not None and not isinstance(image_ids, (bytes, str, list)): + raise Exception("Expected image_ids to be a Sequence, received: {}".format(type(image_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadataManager', + request='Delete', + version=1, + params=_params) + _params['image-ids'] = image_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudImageMetadataResult) + async def List(self, arches=None, region=None, root_storage_type=None, 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 + + + + @ReturnMapping(ErrorResults) + async def Save(self, metadata=None): + ''' + Save stores given cloud image metadata. + It supports bulk calls. + + metadata : typing.Sequence[~CloudImageMetadataList] + Returns -> ErrorResults + ''' + if metadata is not None and not isinstance(metadata, (bytes, str, list)): + raise Exception("Expected metadata to be a Sequence, received: {}".format(type(metadata))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadataManager', + request='Save', + version=1, + params=_params) + _params['metadata'] = metadata + reply = await self.rpc(msg) + return reply + + + +class KeyManagerFacade(Type): + name = 'KeyManager' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListSSHKeys': {'additionalProperties': False, + 'properties': {'entities': {'$ref': '#/definitions/Entities'}, + 'mode': {'type': 'boolean'}}, + 'required': ['entities', 'mode'], + 'type': 'object'}, + 'ModifyUserSSHKeys': {'additionalProperties': False, + 'properties': {'ssh-keys': {'items': {'type': 'string'}, + 'type': 'array'}, + 'user': {'type': 'string'}}, + 'required': ['user', 'ssh-keys'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddKeys': {'description': 'AddKeys adds new authorised ssh ' + 'keys for the specified user.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DeleteKeys': {'description': 'DeleteKeys deletes the ' + 'authorised ssh keys for the ' + 'specified user.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ImportKeys': {'description': 'ImportKeys imports new ' + 'authorised ssh keys from the ' + 'specified key ids for the ' + 'specified user.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListKeys': {'description': 'ListKeys returns the authorised ' + 'ssh keys for the specified users.', + 'properties': {'Params': {'$ref': '#/definitions/ListSSHKeys'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddKeys(self, ssh_keys=None, user=None): + ''' + AddKeys adds new authorised ssh keys for the specified user. + + ssh_keys : typing.Sequence[str] + user : str + Returns -> ErrorResults + ''' + if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): + raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) + + if user is not None and not isinstance(user, (bytes, str)): + raise Exception("Expected user to be a str, received: {}".format(type(user))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyManager', + request='AddKeys', + version=1, + params=_params) + _params['ssh-keys'] = ssh_keys + _params['user'] = user + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DeleteKeys(self, ssh_keys=None, user=None): + ''' + DeleteKeys deletes the authorised ssh keys for the specified user. + + ssh_keys : typing.Sequence[str] + user : str + Returns -> ErrorResults + ''' + if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): + raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) + + if user is not None and not isinstance(user, (bytes, str)): + raise Exception("Expected user to be a str, received: {}".format(type(user))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyManager', + request='DeleteKeys', + version=1, + params=_params) + _params['ssh-keys'] = ssh_keys + _params['user'] = user + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ImportKeys(self, ssh_keys=None, user=None): + ''' + ImportKeys imports new authorised ssh keys from the specified key ids for the specified user. + + ssh_keys : typing.Sequence[str] + user : str + Returns -> ErrorResults + ''' + if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): + raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) + + if user is not None and not isinstance(user, (bytes, str)): + raise Exception("Expected user to be a str, received: {}".format(type(user))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyManager', + request='ImportKeys', + version=1, + params=_params) + _params['ssh-keys'] = ssh_keys + _params['user'] = user + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def ListKeys(self, entities=None, mode=None): + ''' + ListKeys returns the authorised ssh keys for the specified users. + + entities : Entities + mode : bool + Returns -> StringsResults + ''' + if entities is not None and not isinstance(entities, (dict, Entities)): + raise Exception("Expected entities to be a Entities, received: {}".format(type(entities))) + + if mode is not None and not isinstance(mode, bool): + raise Exception("Expected mode to be a bool, received: {}".format(type(mode))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyManager', + request='ListKeys', + version=1, + params=_params) + _params['entities'] = entities + _params['mode'] = mode + reply = await self.rpc(msg) + return reply + + + +class KeyUpdaterFacade(Type): + name = 'KeyUpdater' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AuthorisedKeys': {'description': 'AuthorisedKeys reports the ' + 'authorised ssh keys for the ' + 'specified machines.\n' + 'The current implementation ' + 'relies on global authorised ' + 'keys being stored in the ' + 'model config.\n' + 'This will change as new ' + 'user management and ' + 'authorisation functionality ' + 'is added.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'WatchAuthorisedKeys': {'description': 'WatchAuthorisedKeys ' + 'starts a watcher to ' + 'track changes to the ' + 'authorised ssh keys\n' + 'for the specified ' + 'machines.\n' + 'The current ' + 'implementation relies ' + 'on global authorised ' + 'keys being stored in ' + 'the model config.\n' + 'This will change as ' + 'new user management ' + 'and authorisation ' + 'functionality is ' + 'added.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResults) + async def AuthorisedKeys(self, entities=None): + ''' + AuthorisedKeys reports the authorised ssh keys for the specified machines. + The current implementation relies on global authorised keys being stored in the model config. + This will change as new user management and authorisation functionality is added. + + entities : typing.Sequence[~Entity] + Returns -> StringsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyUpdater', + request='AuthorisedKeys', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchAuthorisedKeys(self, entities=None): + ''' + WatchAuthorisedKeys starts a watcher to track changes to the authorised ssh keys + for the specified machines. + The current implementation relies on global authorised keys being stored in the model config. + This will change as new user management and authorisation functionality is added. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyUpdater', + request='WatchAuthorisedKeys', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class LifeFlagFacade(Type): + name = 'LifeFlag' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LifeFlag', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LifeFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class LogForwardingFacade(Type): + name = 'LogForwarding' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LogForwardingGetLastSentParams': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/LogForwardingID'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'LogForwardingGetLastSentResult': {'additionalProperties': False, + 'properties': {'err': {'$ref': '#/definitions/Error'}, + 'record-id': {'type': 'integer'}, + 'record-timestamp': {'type': 'integer'}}, + 'required': ['record-id', + 'record-timestamp', + 'err'], + 'type': 'object'}, + 'LogForwardingGetLastSentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LogForwardingGetLastSentResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LogForwardingID': {'additionalProperties': False, + 'properties': {'model': {'type': 'string'}, + 'sink': {'type': 'string'}}, + 'required': ['model', 'sink'], + 'type': 'object'}, + 'LogForwardingSetLastSentParam': {'additionalProperties': False, + 'properties': {'LogForwardingID': {'$ref': '#/definitions/LogForwardingID'}, + 'model': {'type': 'string'}, + 'record-id': {'type': 'integer'}, + 'record-timestamp': {'type': 'integer'}, + 'sink': {'type': 'string'}}, + 'required': ['model', + 'sink', + 'LogForwardingID', + 'record-id', + 'record-timestamp'], + 'type': 'object'}, + 'LogForwardingSetLastSentParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/LogForwardingSetLastSentParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'GetLastSent': {'description': 'GetLastSent is a bulk call ' + 'that gets the log forwarding ' + '"last sent"\n' + 'record ID for each requested ' + 'target.', + 'properties': {'Params': {'$ref': '#/definitions/LogForwardingGetLastSentParams'}, + 'Result': {'$ref': '#/definitions/LogForwardingGetLastSentResults'}}, + 'type': 'object'}, + 'SetLastSent': {'description': 'SetLastSent is a bulk call ' + 'that sets the log forwarding ' + '"last sent"\n' + 'record ID for each requested ' + 'target.', + 'properties': {'Params': {'$ref': '#/definitions/LogForwardingSetLastSentParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LogForwardingGetLastSentResults) + async def GetLastSent(self, ids=None): + ''' + GetLastSent is a bulk call that gets the log forwarding "last sent" + record ID for each requested target. + + ids : typing.Sequence[~LogForwardingID] + Returns -> LogForwardingGetLastSentResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LogForwarding', + request='GetLastSent', + version=1, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetLastSent(self, params=None): + ''' + SetLastSent is a bulk call that sets the log forwarding "last sent" + record ID for each requested target. + + params : typing.Sequence[~LogForwardingSetLastSentParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LogForwarding', + request='SetLastSent', + version=1, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + +class LoggerFacade(Type): + name = 'Logger' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'LoggingConfig': {'description': 'LoggingConfig reports the ' + 'logging configuration for ' + 'the agents specified.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'WatchLoggingConfig': {'description': 'WatchLoggingConfig ' + 'starts a watcher to ' + 'track changes to the ' + 'logging config\n' + 'for the agents ' + 'specified.. ' + 'Unfortunately the ' + 'current infrastructure ' + 'makes\n' + 'watching parts of the ' + 'config non-trivial, so ' + 'currently any change to ' + 'the\n' + 'config will cause the ' + 'watcher to notify the ' + 'client.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def LoggingConfig(self, entities=None): + ''' + LoggingConfig reports the logging configuration for the agents specified. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Logger', + request='LoggingConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLoggingConfig(self, entities=None): + ''' + WatchLoggingConfig starts a watcher to track changes to the logging config + for the agents specified.. Unfortunately the current infrastructure makes + watching parts of the config non-trivial, so currently any change to the + config will cause the watcher to notify the client. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Logger', + request='WatchLoggingConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MachineActionsFacade(Type): + name = 'MachineActions' + version = 1 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'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'} + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + Actions returns the Actions by Tags passed and ensures that the machine asking + for them is the machine that has the actions + + entities : typing.Sequence[~Entity] + Returns -> ActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='Actions', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + BeginActions marks the actions represented by the passed in Tags as running. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='BeginActions', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + FinishActions saves the result of a completed Action + + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults + ''' + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='FinishActions', + version=1, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def RunningActions(self, entities=None): + ''' + RunningActions lists the actions running for the entities passed in. + If we end up needing more than ListRunning at some point we could follow/abstract + what's done in the client actions package. + + entities : typing.Sequence[~Entity] + Returns -> ActionsByReceivers + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='RunningActions', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a machine. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='WatchActionNotifications', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MachineUndertakerFacade(Type): + name = 'MachineUndertaker' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProviderInterfaceInfo': {'additionalProperties': False, + 'properties': {'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['interface-name', + 'mac-address', + 'provider-id'], + 'type': 'object'}, + 'ProviderInterfaceInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'interfaces': {'items': {'$ref': '#/definitions/ProviderInterfaceInfo'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'interfaces'], + 'type': 'object'}, + 'ProviderInterfaceInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProviderInterfaceInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AllMachineRemovals': {'description': 'AllMachineRemovals ' + 'returns tags for all of ' + 'the machines that have\n' + 'been marked for removal ' + 'in the requested model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'CompleteMachineRemovals': {'description': 'CompleteMachineRemovals ' + 'removes the ' + 'specified machines ' + 'from the\n' + 'model database. It ' + 'should only be ' + 'called once any ' + 'provider-level\n' + 'cleanup has been ' + 'done for those ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'GetMachineProviderInterfaceInfo': {'description': 'GetMachineProviderInterfaceInfo ' + 'returns ' + 'the ' + 'provider ' + 'details ' + 'for\n' + 'all ' + 'network ' + 'interfaces ' + 'attached ' + 'to the ' + 'machines ' + 'requested.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProviderInterfaceInfoResults'}}, + 'type': 'object'}, + 'WatchMachineRemovals': {'description': 'WatchMachineRemovals ' + 'returns a watcher ' + 'that will signal each ' + 'time a\n' + 'machine is marked for ' + 'removal.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(EntitiesResults) + async def AllMachineRemovals(self, entities=None): + ''' + AllMachineRemovals returns tags for all of the machines that have + been marked for removal in the requested model. + + entities : typing.Sequence[~Entity] + Returns -> EntitiesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='AllMachineRemovals', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def CompleteMachineRemovals(self, entities=None): + ''' + CompleteMachineRemovals removes the specified machines from the + model database. It should only be called once any provider-level + cleanup has been done for those machines. + + entities : typing.Sequence[~Entity] + Returns -> None + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='CompleteMachineRemovals', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProviderInterfaceInfoResults) + async def GetMachineProviderInterfaceInfo(self, entities=None): + ''' + GetMachineProviderInterfaceInfo returns the provider details for + all network interfaces attached to the machines requested. + + entities : typing.Sequence[~Entity] + Returns -> ProviderInterfaceInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='GetMachineProviderInterfaceInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMachineRemovals(self, entities=None): + ''' + WatchMachineRemovals returns a watcher that will signal each time a + machine is marked for removal. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='WatchMachineRemovals', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MetricsManagerFacade(Type): + name = 'MetricsManager' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddJujuMachineMetrics': {'description': 'AddJujuMachineMetrics ' + 'adds a metric that ' + 'counts the number ' + 'of\n' + 'non-container ' + 'machines in the ' + 'current model.', + 'type': 'object'}, + 'CleanupOldMetrics': {'description': 'CleanupOldMetrics ' + 'removes old metrics from ' + 'the collection.\n' + 'The single arg params is ' + 'expected to contain and ' + 'model uuid.\n' + 'Even though the call ' + 'will delete all metrics ' + 'across models\n' + 'it serves to validate ' + 'that the connection has ' + 'access to at least one ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SendMetrics': {'description': 'SendMetrics will send any ' + 'unsent metrics onto the metric ' + 'collection service.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def AddJujuMachineMetrics(self): + ''' + AddJujuMachineMetrics adds a metric that counts the number of + non-container machines in the current model. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsManager', + request='AddJujuMachineMetrics', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CleanupOldMetrics(self, entities=None): + ''' + CleanupOldMetrics removes old metrics from the collection. + The single arg params is expected to contain and model uuid. + Even though the call will delete all metrics across models + it serves to validate that the connection has access to at least one model. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsManager', + request='CleanupOldMetrics', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SendMetrics(self, entities=None): + ''' + SendMetrics will send any unsent metrics onto the metric collection service. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsManager', + request='SendMetrics', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MigrationFlagFacade(Type): + name = 'MigrationFlag' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PhaseResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'phase': {'type': 'string'}}, + 'type': 'object'}, + 'PhaseResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PhaseResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Phase': {'description': 'Phase returns the current migration ' + 'phase or an error for every\n' + 'supplied entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/PhaseResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch returns an id for use with the ' + 'NotifyWatcher facade, or an\n' + 'error, for every supplied entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(PhaseResults) + async def Phase(self, entities=None): + ''' + Phase returns the current migration phase or an error for every + supplied entity. + + entities : typing.Sequence[~Entity] + Returns -> PhaseResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationFlag', + request='Phase', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch returns an id for use with the NotifyWatcher facade, or an + error, for every supplied entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MigrationMinionFacade(Type): + name = 'MigrationMinion' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MinionReport': {'additionalProperties': False, + 'properties': {'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'success': {'type': 'boolean'}}, + 'required': ['migration-id', + 'phase', + 'success'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'Report': {'description': 'Report allows a migration minion to ' + 'submit whether it succeeded or\n' + 'failed for a specific migration ' + 'phase.', + 'properties': {'Params': {'$ref': '#/definitions/MinionReport'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts watching for status ' + 'updates for a migration attempt\n' + 'for the model. It will report when a ' + 'migration starts and when its\n' + 'status changes (including when it ' + 'finishes). An initial event will\n' + 'be fired if there has ever been a ' + 'migration attempt for the model.\n' + '\n' + 'The MigrationStatusWatcher facade ' + 'must be used to receive events\n' + 'from the watcher.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Report(self, migration_id=None, phase=None, success=None): + ''' + Report allows a migration minion to submit whether it succeeded or + failed for a specific migration phase. + + migration_id : str + phase : str + success : bool + Returns -> None + ''' + if migration_id is not None and not isinstance(migration_id, (bytes, str)): + raise Exception("Expected migration_id to be a str, received: {}".format(type(migration_id))) + + if phase is not None and not isinstance(phase, (bytes, str)): + raise Exception("Expected phase to be a str, received: {}".format(type(phase))) + + if success is not None and not isinstance(success, bool): + raise Exception("Expected success to be a bool, received: {}".format(type(success))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMinion', + request='Report', + version=1, + params=_params) + _params['migration-id'] = migration_id + _params['phase'] = phase + _params['success'] = success + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def Watch(self): + ''' + Watch starts watching for status updates for a migration attempt + for the model. It will report when a migration starts and when its + status changes (including when it finishes). An initial event will + be fired if there has ever been a migration attempt for the model. + + The MigrationStatusWatcher facade must be used to receive events + from the watcher. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMinion', + request='Watch', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MigrationStatusWatcherFacade(Type): + name = 'MigrationStatusWatcher' + version = 1 + schema = {'definitions': {'MigrationStatus': {'additionalProperties': False, + 'properties': {'attempt': {'type': 'integer'}, + 'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'source-api-addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'source-ca-cert': {'type': 'string'}, + 'target-api-addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'target-ca-cert': {'type': 'string'}}, + 'required': ['migration-id', + 'attempt', + 'phase', + 'source-api-addrs', + 'source-ca-cert', + 'target-api-addrs', + 'target-ca-cert'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when the status for a ' + 'model migration for the\n' + 'associated model changes. The current ' + 'details for the active\n' + 'migration are returned.', + 'properties': {'Result': {'$ref': '#/definitions/MigrationStatus'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MigrationStatus) + async def Next(self): + ''' + Next returns when the status for a model migration for the + associated model changes. The current details for the active + migration are returned. + + + Returns -> MigrationStatus + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationStatusWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ModelSummaryWatcherFacade(Type): + name = 'ModelSummaryWatcher' + version = 1 + schema = {'definitions': {'ModelAbstract': {'additionalProperties': False, + 'properties': {'admins': {'items': {'type': 'string'}, + 'type': 'array'}, + 'annotations': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'cloud': {'type': 'string'}, + 'controller': {'type': 'string'}, + 'credential': {'type': 'string'}, + 'messages': {'items': {'$ref': '#/definitions/ModelSummaryMessage'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'removed': {'type': 'boolean'}, + 'size': {'$ref': '#/definitions/ModelSummarySize'}, + 'status': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid'], + 'type': 'object'}, + 'ModelSummaryMessage': {'additionalProperties': False, + 'properties': {'agent': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['agent', 'message'], + 'type': 'object'}, + 'ModelSummarySize': {'additionalProperties': False, + 'properties': {'applications': {'type': 'integer'}, + 'containers': {'type': 'integer'}, + 'machines': {'type': 'integer'}, + 'relations': {'type': 'integer'}, + 'units': {'type': 'integer'}}, + 'type': 'object'}, + 'SummaryWatcherNextResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelAbstract'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next will return the current state of ' + 'everything on the first call\n' + 'and subsequent calls will return just ' + 'those model summaries that have\n' + 'changed.', + 'properties': {'Result': {'$ref': '#/definitions/SummaryWatcherNextResults'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SummaryWatcherNextResults) + async def Next(self): + ''' + Next will return the current state of everything on the first call + and subsequent calls will return just those model summaries that have + changed. + + + Returns -> SummaryWatcherNextResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelSummaryWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelSummaryWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ModelUpgraderFacade(Type): + name = 'ModelUpgrader' + version = 1 + schema = {'definitions': {'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'} + + + @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 + + + + @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 + + + +class NotifyWatcherFacade(Type): + name = 'NotifyWatcher' + version = 1 + schema = {'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to the\n' + 'entity being watched since the most ' + 'recent call to Next\n' + 'or the Watch call that created the ' + 'NotifyWatcher.', + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Next(self): + ''' + Next returns when a change has occurred to the + entity being watched since the most recent call to Next + or the Watch call that created the NotifyWatcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='NotifyWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='NotifyWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class OfferStatusWatcherFacade(Type): + name = 'OfferStatusWatcher' + version = 1 + schema = {'definitions': {'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'OfferStatusChange': {'additionalProperties': False, + 'properties': {'offer-name': {'type': 'string'}, + 'status': {'$ref': '#/definitions/EntityStatus'}}, + 'required': ['offer-name', 'status'], + 'type': 'object'}, + 'OfferStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvOfferStatusWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/OfferStatusWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(OfferStatusWatchResult) + async def Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvOfferStatusWatcher. + + + Returns -> OfferStatusWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='OfferStatusWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='OfferStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class PayloadsFacade(Type): + name = 'Payloads' + version = 1 + schema = {'definitions': {'Payload': {'additionalProperties': False, + 'properties': {'class': {'type': 'string'}, + 'id': {'type': 'string'}, + 'labels': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine': {'type': 'string'}, + 'status': {'type': 'string'}, + 'type': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['class', + 'type', + 'id', + 'status', + 'labels', + 'unit', + 'machine'], + 'type': 'object'}, + 'PayloadListArgs': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'PayloadListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Payload'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'List': {'description': 'List builds the list of payloads ' + 'being tracked for\n' + 'the given unit and IDs. If no IDs are ' + 'provided then all tracked\n' + 'payloads for the unit are returned.', + 'properties': {'Params': {'$ref': '#/definitions/PayloadListArgs'}, + 'Result': {'$ref': '#/definitions/PayloadListResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(PayloadListResults) + async def List(self, patterns=None): + ''' + List builds the list of payloads being tracked for + the given unit and IDs. If no IDs are provided then all tracked + payloads for the unit are returned. + + patterns : typing.Sequence[str] + Returns -> PayloadListResults + ''' + if patterns is not None and not isinstance(patterns, (bytes, str, list)): + raise Exception("Expected patterns to be a Sequence, received: {}".format(type(patterns))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Payloads', + request='List', + version=1, + params=_params) + _params['patterns'] = patterns + reply = await self.rpc(msg) + return reply + + + +class PayloadsHookContextFacade(Type): + name = 'PayloadsHookContext' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'LookUpPayloadArg': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'id'], + 'type': 'object'}, + 'LookUpPayloadArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/LookUpPayloadArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Payload': {'additionalProperties': False, + 'properties': {'class': {'type': 'string'}, + 'id': {'type': 'string'}, + 'labels': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine': {'type': 'string'}, + 'status': {'type': 'string'}, + 'type': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['class', + 'type', + 'id', + 'status', + 'labels', + 'unit', + 'machine'], + 'type': 'object'}, + 'PayloadResult': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'error': {'$ref': '#/definitions/Error'}, + 'not-found': {'type': 'boolean'}, + 'payload': {'$ref': '#/definitions/Payload'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'payload', + 'not-found'], + 'type': 'object'}, + 'PayloadResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PayloadResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetPayloadStatusArg': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'status'], + 'type': 'object'}, + 'SetPayloadStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetPayloadStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'TrackPayloadArgs': {'additionalProperties': False, + 'properties': {'payloads': {'items': {'$ref': '#/definitions/Payload'}, + 'type': 'array'}}, + 'required': ['payloads'], + 'type': 'object'}}, + 'properties': {'List': {'description': 'List builds the list of payload being ' + 'tracked for\n' + 'the given unit and IDs. If no IDs are ' + 'provided then all tracked\n' + 'payloads for the unit are returned.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'LookUp': {'description': 'LookUp identifies the payload with ' + 'the provided name and raw ID.', + 'properties': {'Params': {'$ref': '#/definitions/LookUpPayloadArgs'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the raw status of ' + 'a payload.', + 'properties': {'Params': {'$ref': '#/definitions/SetPayloadStatusArgs'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'Track': {'description': 'Track stores a payload to be tracked ' + 'in state.', + 'properties': {'Params': {'$ref': '#/definitions/TrackPayloadArgs'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'Untrack': {'description': 'Untrack marks the identified ' + 'payload as no longer being ' + 'tracked.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(PayloadResults) + async def List(self, entities=None): + ''' + List builds the list of payload being tracked for + the given unit and IDs. If no IDs are provided then all tracked + payloads for the unit are returned. + + entities : typing.Sequence[~Entity] + Returns -> PayloadResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='List', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def LookUp(self, args=None): + ''' + LookUp identifies the payload with the provided name and raw ID. + + args : typing.Sequence[~LookUpPayloadArg] + Returns -> PayloadResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='LookUp', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def SetStatus(self, args=None): + ''' + SetStatus sets the raw status of a payload. + + args : typing.Sequence[~SetPayloadStatusArg] + Returns -> PayloadResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='SetStatus', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def Track(self, payloads=None): + ''' + Track stores a payload to be tracked in state. + + payloads : typing.Sequence[~Payload] + Returns -> PayloadResults + ''' + if payloads is not None and not isinstance(payloads, (bytes, str, list)): + raise Exception("Expected payloads to be a Sequence, received: {}".format(type(payloads))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='Track', + version=1, + params=_params) + _params['payloads'] = payloads + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def Untrack(self, entities=None): + ''' + Untrack marks the identified payload as no longer being tracked. + + entities : typing.Sequence[~Entity] + Returns -> PayloadResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='Untrack', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class PingerFacade(Type): + name = 'Pinger' + version = 1 + schema = {'properties': {'Ping': {'type': 'object'}, 'Stop': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Ping(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Pinger', + request='Ping', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Pinger', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class RelationStatusWatcherFacade(Type): + name = 'RelationStatusWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['key', + 'life', + 'suspended', + 'suspended-reason'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvRelationStatusWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RelationLifeSuspendedStatusWatchResult) + async def Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvRelationStatusWatcher. + + + Returns -> RelationLifeSuspendedStatusWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationStatusWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class RelationUnitsWatcherFacade(Type): + name = 'RelationUnitsWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvRelationUnitsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/RelationUnitsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RelationUnitsWatchResult) + async def Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvRelationUnitsWatcher. + + + Returns -> RelationUnitsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationUnitsWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationUnitsWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class 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'} + + + @ReturnMapping(RemoteRelationWatchResult) + async def Next(self): + ''' + + Returns -> RemoteRelationWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ResourcesHookContextFacade(Type): + name = 'ResourcesHookContext' + version = 1 + schema = {'definitions': {'CharmResource': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ListUnitResourcesArgs': {'additionalProperties': False, + 'properties': {'resource-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['resource-names'], + 'type': 'object'}, + 'Resource': {'additionalProperties': False, + 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, + 'application': {'type': 'string'}, + 'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'pending-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size', + 'CharmResource', + 'id', + 'pending-id', + 'application', + 'username', + 'timestamp'], + 'type': 'object'}, + 'UnitResourceResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resource': {'$ref': '#/definitions/Resource'}}, + 'required': ['ErrorResult', 'resource'], + 'type': 'object'}, + 'UnitResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resources': {'items': {'$ref': '#/definitions/UnitResourceResult'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'resources'], + 'type': 'object'}}, + 'properties': {'GetResourceInfo': {'description': 'GetResourceInfo returns ' + 'the resource info for each ' + 'of the given\n' + 'resource names (for the ' + 'implicit application). If ' + 'any one is missing then\n' + 'the corresponding result ' + 'is set with ' + 'errors.NotFound.', + 'properties': {'Params': {'$ref': '#/definitions/ListUnitResourcesArgs'}, + 'Result': {'$ref': '#/definitions/UnitResourcesResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UnitResourcesResult) + async def GetResourceInfo(self, resource_names=None): + ''' + GetResourceInfo returns the resource info for each of the given + resource names (for the implicit application). If any one is missing then + the corresponding result is set with errors.NotFound. + + resource_names : typing.Sequence[str] + Returns -> UnitResourcesResult + ''' + if resource_names is not None and not isinstance(resource_names, (bytes, str, list)): + raise Exception("Expected resource_names to be a Sequence, received: {}".format(type(resource_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ResourcesHookContext', + request='GetResourceInfo', + version=1, + params=_params) + _params['resource-names'] = resource_names + reply = await self.rpc(msg) + return reply + + + +class RetryStrategyFacade(Type): + name = 'RetryStrategy' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RetryStrategy': {'additionalProperties': False, + 'properties': {'jitter-retry-time': {'type': 'boolean'}, + 'max-retry-time': {'type': 'integer'}, + 'min-retry-time': {'type': 'integer'}, + 'retry-time-factor': {'type': 'integer'}, + 'should-retry': {'type': 'boolean'}}, + 'required': ['should-retry', + 'min-retry-time', + 'max-retry-time', + 'jitter-retry-time', + 'retry-time-factor'], + 'type': 'object'}, + 'RetryStrategyResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RetryStrategy'}}, + 'type': 'object'}, + 'RetryStrategyResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RetryStrategyResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'RetryStrategy': {'description': 'RetryStrategy returns ' + 'RetryStrategyResults that ' + 'can be used by any code that ' + 'uses\n' + 'to configure the retry timer ' + "that's currently in juju " + 'utils.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RetryStrategyResults'}}, + 'type': 'object'}, + 'WatchRetryStrategy': {'description': 'WatchRetryStrategy ' + 'watches for changes to ' + 'the model. Currently we ' + 'only allow\n' + 'changes to the boolean ' + 'that determines whether ' + 'retries should be ' + 'attempted or not.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RetryStrategyResults) + async def RetryStrategy(self, entities=None): + ''' + RetryStrategy returns RetryStrategyResults that can be used by any code that uses + to configure the retry timer that's currently in juju utils. + + entities : typing.Sequence[~Entity] + Returns -> RetryStrategyResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RetryStrategy', + request='RetryStrategy', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchRetryStrategy(self, entities=None): + ''' + WatchRetryStrategy watches for changes to the model. Currently we only allow + changes to the boolean that determines whether retries should be attempted or not. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RetryStrategy', + request='WatchRetryStrategy', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class 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'} + + + @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 + + + + @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 + + + + @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 + + + + @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 + + + +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'} + + + @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 + + + + @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 + + + +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'} + + + @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 + + + + @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 + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class SecretsDrainFacade(Type): + name = 'SecretsDrain' + version = 1 + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'ChangeSecretBackendArg': {'additionalProperties': False, + 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, + 'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + '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': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + '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'} + + + @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 + + + + @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 + + + + @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 + + + +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'} + + + @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 + + + +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'} + + + @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 + + + + @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 + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class 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'} + + + @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 + + + + @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 + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class StringsWatcherFacade(Type): + name = 'StringsWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvStringsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsWatchResult) + async def Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvStringsWatcher. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StringsWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StringsWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class UndertakerFacade(Type): + name = 'Undertaker' + version = 1 + schema = {'definitions': {'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'} + + + @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 + + + + @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 + + + + @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 + + + + @ReturnMapping(UndertakerModelInfoResult) + async def ModelInfo(self): + ''' + ModelInfo returns information on the model needed by the undertaker worker. + + + Returns -> UndertakerModelInfoResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ModelInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ProcessDyingModel(self): + ''' + ProcessDyingModel checks if a dying model has any machines or applications. + If there are none, the model's life is changed from dying to dead. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ProcessDyingModel', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def RemoveModel(self): + ''' + RemoveModel removes any records of this model from Juju. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='RemoveModel', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='SetStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 + + + + @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 + + + + @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 + + + + @ReturnMapping(NotifyWatchResults) + async def WatchModelResources(self): + ''' + WatchModelResources creates watchers for changes to the lifecycle of an + model's machines and applications and storage. + + + Returns -> NotifyWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='WatchModelResources', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class UnitAssignerFacade(Type): + name = 'UnitAssigner' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'AssignUnits': {'description': 'AssignUnits assigns the units ' + 'with the given ids to the ' + 'correct machine. The\n' + 'error results are returned in ' + 'the same order as the given ' + 'entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetAgentStatus': {'description': 'SetAgentStatus will set ' + 'status for agents of Units ' + 'passed in args, if one\n' + 'of the args is not an Unit ' + 'it will fail.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchUnitAssignments': {'description': 'WatchUnitAssignments ' + 'returns a strings ' + 'watcher that is ' + 'notified when new ' + 'unit\n' + 'assignments are added ' + 'to the db.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AssignUnits(self, entities=None): + ''' + AssignUnits assigns the units with the given ids to the correct machine. The + error results are returned in the same order as the given entities. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UnitAssigner', + request='AssignUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UnitAssigner', + request='SetAgentStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchUnitAssignments(self): + ''' + WatchUnitAssignments returns a strings watcher that is notified when new unit + assignments are added to the db. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UnitAssigner', + request='WatchUnitAssignments', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class 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, @@ -794,102 +10869,380 @@ class SecretBackendsFacade(Type): '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'], + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Version': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version'], + 'type': 'object'}, + 'VersionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'type': 'object'}, + 'VersionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VersionResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'DesiredVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VersionResults'}}, + 'type': 'object'}, + 'SetTools': {'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'WatchAPIVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(VersionResults) + async def DesiredVersion(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> VersionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Upgrader', + request='DesiredVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetTools(self, agent_tools=None): + ''' + agent_tools : typing.Sequence[~EntityVersion] + Returns -> ErrorResults + ''' + if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): + raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Upgrader', + request='SetTools', + version=1, + params=_params) + _params['agent-tools'] = agent_tools + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def Tools(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> ToolsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Upgrader', + request='Tools', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchAPIVersion(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Upgrader', + request='WatchAPIVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class UserSecretsDrainFacade(Type): + name = 'UserSecretsDrain' + version = 1 + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'ChangeSecretBackendArg': {'additionalProperties': False, + 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, + 'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', 'revision'], 'type': 'object'}, - 'RemoveSecretBackendArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/RemoveSecretBackendArg'}, + 'ChangeSecretBackendArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ChangeSecretBackendArg'}, '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'], + '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'}, - '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'}}, + 'GetSecretContentArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/GetSecretContentArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ListSecretResult': {'additionalProperties': False, + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + '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'}, - 'ListSecretBackends': {'description': 'ListSecretBackends ' - 'lists available secret ' - 'backends.', - 'properties': {'Params': {'$ref': '#/definitions/ListSecretBackendsArgs'}, - 'Result': {'$ref': '#/definitions/ListSecretBackendsResults'}}, + 'ListSecretResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ListSecretResult'}, + 'type': 'array'}}, + 'required': ['results'], 'type': 'object'}, - 'RemoveSecretBackends': {'description': 'RemoveSecretBackends ' - 'removes secret ' - 'backends.', - 'properties': {'Params': {'$ref': '#/definitions/RemoveSecretBackendArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, + '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'}, - 'UpdateSecretBackends': {'description': 'UpdateSecretBackends ' - 'updates secret ' - 'backends.', - 'properties': {'Params': {'$ref': '#/definitions/UpdateSecretBackendArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - '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'} @ReturnMapping(ErrorResults) - async def AddSecretBackends(self, args=None): + async def ChangeSecretBackend(self, args=None): ''' - AddSecretBackends adds new secret backends. + ChangeSecretBackend updates the backend for the specified secret after migration done. - args : typing.Sequence[~AddSecretBackendArg] + args : typing.Sequence[~ChangeSecretBackendArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -897,8 +11250,8 @@ async def AddSecretBackends(self, args=None): # map input types to rpc msg _params = dict() - msg = dict(type='SecretBackends', - request='AddSecretBackends', + msg = dict(type='UserSecretsDrain', + request='ChangeSecretBackend', version=1, params=_params) _params['args'] = args @@ -907,49 +11260,49 @@ async def AddSecretBackends(self, args=None): - @ReturnMapping(ListSecretBackendsResults) - async def ListSecretBackends(self, names=None, reveal=None): + @ReturnMapping(SecretBackendConfigResults) + async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): ''' - ListSecretBackends lists available secret backends. + GetSecretBackendConfigs gets the config needed to create a client to secret backends for the drain worker. - names : typing.Sequence[str] - reveal : bool - Returns -> ListSecretBackendsResults + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults ''' - 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 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 reveal is not None and not isinstance(reveal, bool): - raise Exception("Expected reveal to be a bool, received: {}".format(type(reveal))) + 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='SecretBackends', - request='ListSecretBackends', + msg = dict(type='UserSecretsDrain', + request='GetSecretBackendConfigs', version=1, params=_params) - _params['names'] = names - _params['reveal'] = reveal + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RemoveSecretBackends(self, args=None): + @ReturnMapping(SecretContentResults) + async def GetSecretContentInfo(self, args=None): ''' - RemoveSecretBackends removes secret backends. + GetSecretContentInfo returns the secret values for the specified secrets. - args : typing.Sequence[~RemoveSecretBackendArg] - Returns -> ErrorResults + 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='SecretBackends', - request='RemoveSecretBackends', + msg = dict(type='UserSecretsDrain', + request='GetSecretContentInfo', version=1, params=_params) _params['args'] = args @@ -958,12 +11311,145 @@ async def RemoveSecretBackends(self, args=None): + @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 + + + + @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 + + + + @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 + + + +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'} + + @ReturnMapping(ErrorResults) - async def UpdateSecretBackends(self, args=None): + async def DeleteRevisions(self, args=None): ''' - UpdateSecretBackends updates secret backends. + DeleteRevisions deletes the specified revisions of the specified secret. - args : typing.Sequence[~UpdateSecretBackendArg] + args : typing.Sequence[~DeleteSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -971,8 +11457,8 @@ async def UpdateSecretBackends(self, args=None): # map input types to rpc msg _params = dict() - msg = dict(type='SecretBackends', - request='UpdateSecretBackends', + msg = dict(type='UserSecretsManager', + request='DeleteRevisions', version=1, params=_params) _params['args'] = args @@ -981,8 +11467,31 @@ async def UpdateSecretBackends(self, args=None): -class SecretsFacade(Type): - name = 'Secrets' + @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 + + + +class VolumeAttachmentPlansWatcherFacade(Type): + name = 'VolumeAttachmentPlansWatcher' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, @@ -992,102 +11501,87 @@ class SecretsFacade(Type): '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'], + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], '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'}}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvMachineStorageIdsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(ListSecretResults) - async def ListSecrets(self, filter_=None, show_secrets=None): + @ReturnMapping(MachineStorageIdsWatchResult) + async def Next(self): ''' - ListSecrets lists available secrets. + 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. - filter_ : SecretsFilter - show_secrets : bool - Returns -> ListSecretResults + + Returns -> MachineStorageIdsWatchResult ''' - 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='VolumeAttachmentPlansWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Secrets', - request='ListSecrets', + msg = dict(type='VolumeAttachmentPlansWatcher', + request='Stop', version=1, params=_params) - _params['filter'] = filter_ - _params['show-secrets'] = show_secrets + reply = await self.rpc(msg) return reply + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + diff --git a/juju/client/_client11.py b/juju/client/_client11.py index a3c7ea0e..bdc5317b 100644 --- a/juju/client/_client11.py +++ b/juju/client/_client11.py @@ -1122,3 +1122,2300 @@ async def WatchModelSummaries(self): return reply + +class ProvisionerFacade(Type): + name = 'Provisioner' + version = 11 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Base': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'channel'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Patch': {'type': 'integer'}, + 'Release': {'type': 'string'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'ConstraintsResult': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConstraintsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ContainerConfig': {'additionalProperties': False, + 'properties': {'UpdateBehavior': {'$ref': '#/definitions/UpdateBehavior'}, + 'apt-mirror': {'type': 'string'}, + 'apt-proxy': {'$ref': '#/definitions/Settings'}, + 'authorized-keys': {'type': 'string'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'container-inherit-properties': {'type': 'string'}, + 'juju-proxy': {'$ref': '#/definitions/Settings'}, + 'legacy-proxy': {'$ref': '#/definitions/Settings'}, + 'provider-type': {'type': 'string'}, + 'snap-proxy': {'$ref': '#/definitions/Settings'}, + 'snap-store-assertions': {'type': 'string'}, + 'snap-store-proxy-id': {'type': 'string'}, + 'snap-store-proxy-url': {'type': 'string'}, + 'ssl-hostname-verification': {'type': 'boolean'}}, + 'required': ['provider-type', + 'authorized-keys', + 'ssl-hostname-verification', + 'legacy-proxy', + 'juju-proxy', + 'apt-proxy', + 'snap-proxy', + 'snap-store-assertions', + 'snap-store-proxy-id', + 'snap-store-proxy-url', + 'UpdateBehavior'], + 'type': 'object'}, + 'ContainerLXDProfile': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}}, + 'required': ['profile', 'name'], + 'type': 'object'}, + 'ContainerManagerConfig': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ContainerManagerConfigParams': {'additionalProperties': False, + 'properties': {'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ContainerProfileResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'lxd-profiles': {'items': {'$ref': '#/definitions/ContainerLXDProfile'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ContainerProfileResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ContainerProfileResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DeviceBridgeInfo': {'additionalProperties': False, + 'properties': {'bridge-name': {'type': 'string'}, + 'host-device-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['host-device-name', + 'bridge-name', + 'mac-address'], + 'type': 'object'}, + 'DistributionGroupResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'DistributionGroupResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DistributionGroupResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'os-type': {'type': 'string'}}, + 'required': ['number', + 'major', + 'arch', + 'os-type', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}, + 'HostNetworkChange': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-bridges': {'items': {'$ref': '#/definitions/DeviceBridgeInfo'}, + 'type': 'array'}, + 'reconfigure-delay': {'type': 'integer'}}, + 'required': ['new-bridges', + 'reconfigure-delay'], + 'type': 'object'}, + 'HostNetworkChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/HostNetworkChange'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'InstanceInfo': {'additionalProperties': False, + 'properties': {'characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'charm-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'display-name': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'network-config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'volume-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentInfo'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['tag', + 'instance-id', + 'display-name', + 'nonce', + 'characteristics', + 'volumes', + 'volume-attachments', + 'network-config', + 'charm-profiles'], + 'type': 'object'}, + 'InstancesInfo': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/InstanceInfo'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainerResult': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'determined': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-types', + 'determined'], + 'type': 'object'}, + 'MachineContainerResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineContainerResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainers': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-types'], + 'type': 'object'}, + 'MachineContainersParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachineContainers'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachineNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'MachineNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'origin': {'type': 'string'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-network-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'ProvisioningInfo': {'additionalProperties': False, + 'properties': {'ProvisioningNetworkTopology': {'$ref': '#/definitions/ProvisioningNetworkTopology'}, + 'base': {'$ref': '#/definitions/Base'}, + 'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'root-disk': {'$ref': '#/definitions/VolumeParams'}, + 'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'base', + 'placement', + 'jobs', + 'subnet-zones', + 'space-subnets', + 'ProvisioningNetworkTopology'], + 'type': 'object'}, + 'ProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProvisioningNetworkTopology': {'additionalProperties': False, + 'properties': {'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['subnet-zones', + 'space-subnets'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Settings': {'additionalProperties': False, + 'properties': {'AutoNoProxy': {'type': 'string'}, + 'Ftp': {'type': 'string'}, + 'Http': {'type': 'string'}, + 'Https': {'type': 'string'}, + 'NoProxy': {'type': 'string'}}, + 'required': ['Http', + 'Https', + 'Ftp', + 'NoProxy', + 'AutoNoProxy'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateBehavior': {'additionalProperties': False, + 'properties': {'enable-os-refresh-update': {'type': 'boolean'}, + 'enable-os-upgrade': {'type': 'boolean'}}, + 'required': ['enable-os-refresh-update', + 'enable-os-upgrade'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'WatchContainer': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-type'], + 'type': 'object'}, + 'WatchContainers': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/WatchContainer'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AvailabilityZone': {'description': 'AvailabilityZone returns ' + 'a provider-specific ' + 'availability zone for ' + 'each given machine entity', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'Constraints': {'description': 'Constraints returns the ' + 'constraints for each given ' + 'machine entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConstraintsResults'}}, + 'type': 'object'}, + 'ContainerConfig': {'description': 'ContainerConfig returns ' + 'information from the model ' + 'config that is\n' + 'needed for container ' + 'cloud-init.', + 'properties': {'Result': {'$ref': '#/definitions/ContainerConfig'}}, + 'type': 'object'}, + 'ContainerManagerConfig': {'description': 'ContainerManagerConfig ' + 'returns information ' + 'from the model ' + 'config that is\n' + 'needed for ' + 'configuring the ' + 'container manager.', + 'properties': {'Params': {'$ref': '#/definitions/ContainerManagerConfigParams'}, + 'Result': {'$ref': '#/definitions/ContainerManagerConfig'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DistributionGroup': {'description': 'DistributionGroup ' + 'returns, for each given ' + 'machine entity,\n' + 'a slice of instance.Ids ' + 'that belong to the same ' + 'distribution\n' + 'group as that machine. ' + 'This information may be ' + 'used to\n' + 'distribute instances for ' + 'high availability.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DistributionGroupResults'}}, + 'type': 'object'}, + 'DistributionGroupByMachineId': {'description': 'DistributionGroupByMachineId ' + 'returns, for ' + 'each given ' + 'machine ' + 'entity,\n' + 'a slice of ' + 'machine.Ids ' + 'that belong ' + 'to the same ' + 'distribution\n' + 'group as that ' + 'machine. This ' + 'information ' + 'may be used ' + 'to\n' + 'distribute ' + 'instances for ' + 'high ' + 'availability.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'GetContainerInterfaceInfo': {'description': 'GetContainerInterfaceInfo ' + 'returns ' + 'information to ' + 'configure ' + 'networking for ' + 'a\n' + 'container. It ' + 'accepts ' + 'container tags ' + 'as arguments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'GetContainerProfileInfo': {'description': 'GetContainerProfileInfo ' + 'returns ' + 'information to ' + 'configure a lxd ' + 'profile(s) for a\n' + 'container based on ' + 'the charms ' + 'deployed to the ' + 'container. It ' + 'accepts container\n' + 'tags as arguments. ' + 'Unlike ' + 'machineLXDProfileNames ' + 'which has the ' + 'environ\n' + 'write the lxd ' + 'profiles and ' + 'returns the names ' + 'of profiles ' + 'already written.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ContainerProfileResults'}}, + 'type': 'object'}, + 'HostChangesForContainers': {'description': 'HostChangesForContainers ' + 'returns the set ' + 'of changes that ' + 'need to be done\n' + 'to the host ' + 'machine to ' + 'prepare it for ' + 'the containers to ' + 'be created.\n' + 'Pass in a list of ' + 'the containers ' + 'that you want the ' + 'changes for.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/HostNetworkChangeResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'description': 'InstanceStatus returns the ' + 'instance status for each ' + 'given entity.\n' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'KeepInstance': {'description': 'KeepInstance returns the ' + 'keep-instance value for each ' + 'given machine entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MachinesWithTransientErrors': {'description': 'MachinesWithTransientErrors ' + 'returns status ' + 'data for ' + 'machines with ' + 'provisioning\n' + 'errors which ' + 'are transient.', + 'properties': {'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'MarkMachinesForRemoval': {'description': 'MarkMachinesForRemoval ' + 'indicates that the ' + 'specified machines ' + 'are\n' + 'ready to have any ' + 'provider-level ' + 'resources cleaned ' + 'up and then be\n' + 'removed.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that the current connection is ' + 'for.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PrepareContainerInterfaceInfo': {'description': 'PrepareContainerInterfaceInfo ' + 'allocates an ' + 'address and ' + 'returns ' + 'information ' + 'to\n' + 'configure ' + 'networking ' + 'for a ' + 'container. ' + 'It accepts ' + 'container ' + 'tags as ' + 'arguments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the provisioning ' + 'information for each ' + 'given machine entity.\n' + 'It supports all positive ' + 'space constraints.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResults'}}, + 'type': 'object'}, + 'ReleaseContainerAddresses': {'description': 'ReleaseContainerAddresses ' + 'finds addresses ' + 'allocated to a ' + 'container and ' + 'marks\n' + 'them as Dead, to ' + 'be released and ' + 'removed. It ' + 'accepts ' + 'container tags ' + 'as\n' + 'arguments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'description': 'SetCharmProfiles records ' + 'the given slice of charm ' + 'profile names.', + 'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetHostMachineNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetInstanceInfo': {'description': 'SetInstanceInfo sets the ' + 'provider specific machine ' + 'id, nonce,\n' + 'metadata and network info ' + 'for each given machine. ' + 'Once set, the\n' + 'instance id cannot be ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/InstancesInfo'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'description': 'SetInstanceStatus ' + 'updates the instance ' + 'status for each given\n' + 'entity. Only machine ' + 'tags are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'description': 'SetModificationStatus ' + 'updates the instance ' + 'whilst changes are ' + 'occurring. This\n' + 'is different from ' + 'SetStatus and ' + 'SetInstanceStatus, ' + 'by the fact this ' + 'holds\n' + 'information about ' + 'the ongoing changes ' + 'that are happening ' + 'to instances.\n' + 'Consider LXD Profile ' + 'updates that can ' + 'modify a instance, ' + 'but may not cause\n' + 'the instance to be ' + 'placed into a error ' + 'state. This ' + 'modification status\n' + 'serves the purpose ' + 'of highlighting that ' + 'to the operator.\n' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'description': 'SetObservedNetworkConfig ' + 'reads the network ' + 'config for the ' + 'machine\n' + 'identified by the ' + 'input args.\n' + 'This config is ' + 'merged with the ' + 'new network ' + 'config supplied ' + 'in the\n' + 'same args and ' + 'updated if it has ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetSupportedContainers': {'description': 'SetSupportedContainers ' + 'updates the list of ' + 'containers ' + 'supported by the ' + 'machines passed in ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/MachineContainersParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Status': {'description': 'Status returns the status of each ' + 'given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'SupportedContainers': {'description': 'SupportedContainers ' + 'returns the list of ' + 'containers supported ' + 'by the machines passed ' + 'in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineContainerResults'}}, + 'type': 'object'}, + 'Tools': {'description': 'Tools finds the tools necessary for ' + 'the given agents.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchAllContainers': {'description': 'WatchAllContainers ' + 'starts a StringsWatcher ' + 'to watch all containers ' + 'deployed to\n' + 'any machine passed in ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainers': {'description': 'WatchContainers starts a ' + 'StringsWatcher to watch ' + 'containers deployed to\n' + 'any machine passed in ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMachineErrorRetry': {'description': 'WatchMachineErrorRetry ' + 'returns a ' + 'NotifyWatcher that ' + 'notifies when\n' + 'the provisioner ' + 'should retry ' + 'provisioning ' + 'machines with ' + 'transient errors.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIAddresses', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIHostPorts', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + AvailabilityZone returns a provider-specific availability zone for each given machine entity + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='AvailabilityZone', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='CACert', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConstraintsResults) + async def Constraints(self, entities=None): + ''' + Constraints returns the constraints for each given machine entity. + + entities : typing.Sequence[~Entity] + Returns -> ConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Constraints', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerConfig) + async def ContainerConfig(self): + ''' + ContainerConfig returns information from the model config that is + needed for container cloud-init. + + + Returns -> ContainerConfig + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerConfig', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerManagerConfig) + async def ContainerManagerConfig(self, type_=None): + ''' + ContainerManagerConfig returns information from the model config that is + needed for configuring the container manager. + + type_ : str + Returns -> ContainerManagerConfig + ''' + if type_ is not None and not isinstance(type_, (bytes, str)): + raise Exception("Expected type_ to be a str, received: {}".format(type(type_))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerManagerConfig', + version=11, + params=_params) + _params['type'] = type_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerAPIInfoForModels', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerConfig', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DistributionGroupResults) + async def DistributionGroup(self, entities=None): + ''' + DistributionGroup returns, for each given machine entity, + a slice of instance.Ids that belong to the same distribution + group as that machine. This information may be used to + distribute instances for high availability. + + entities : typing.Sequence[~Entity] + Returns -> DistributionGroupResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='DistributionGroup', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def DistributionGroupByMachineId(self, entities=None): + ''' + DistributionGroupByMachineId returns, for each given machine entity, + a slice of machine.Ids that belong to the same distribution + group as that machine. This information may be used to + distribute instances for high availability. + + entities : typing.Sequence[~Entity] + Returns -> StringsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='DistributionGroupByMachineId', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='EnsureDead', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + number : Number + os_type : str + Returns -> FindToolsResult + ''' + if agentstream is not None and not isinstance(agentstream, (bytes, str)): + raise Exception("Expected agentstream to be a str, received: {}".format(type(agentstream))) + + if arch is not None and not isinstance(arch, (bytes, str)): + raise Exception("Expected arch to be a str, received: {}".format(type(arch))) + + if major is not None and not isinstance(major, int): + raise Exception("Expected major to be a int, received: {}".format(type(major))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if os_type is not None and not isinstance(os_type, (bytes, str)): + raise Exception("Expected os_type to be a str, received: {}".format(type(os_type))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='FindTools', + version=11, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['number'] = number + _params['os-type'] = os_type + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def GetContainerInterfaceInfo(self, entities=None): + ''' + GetContainerInterfaceInfo returns information to configure networking for a + container. It accepts container tags as arguments. + + entities : typing.Sequence[~Entity] + Returns -> MachineNetworkConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='GetContainerInterfaceInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerProfileResults) + async def GetContainerProfileInfo(self, entities=None): + ''' + GetContainerProfileInfo returns information to configure a lxd profile(s) for a + container based on the charms deployed to the container. It accepts container + tags as arguments. Unlike machineLXDProfileNames which has the environ + write the lxd profiles and returns the names of profiles already written. + + entities : typing.Sequence[~Entity] + Returns -> ContainerProfileResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='GetContainerProfileInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostNetworkChangeResults) + async def HostChangesForContainers(self, entities=None): + ''' + HostChangesForContainers returns the set of changes that need to be done + to the host machine to prepare it for the containers to be created. + Pass in a list of the containers that you want the changes for. + + entities : typing.Sequence[~Entity] + Returns -> HostNetworkChangeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='HostChangesForContainers', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='InstanceId', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + InstanceStatus returns the instance status for each given entity. + Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='InstanceStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def KeepInstance(self, entities=None): + ''' + KeepInstance returns the keep-instance value for each given machine entity. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='KeepInstance', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Life', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def MachinesWithTransientErrors(self): + ''' + MachinesWithTransientErrors returns status data for machines with provisioning + errors which are transient. + + + Returns -> StatusResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MachinesWithTransientErrors', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MarkMachinesForRemoval(self, entities=None): + ''' + MarkMachinesForRemoval indicates that the specified machines are + ready to have any provider-level resources cleaned up and then be + removed. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MarkMachinesForRemoval', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that the current connection is for. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def PrepareContainerInterfaceInfo(self, entities=None): + ''' + PrepareContainerInterfaceInfo allocates an address and returns information to + configure networking for a container. It accepts container tags as arguments. + + entities : typing.Sequence[~Entity] + Returns -> MachineNetworkConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='PrepareContainerInterfaceInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): + ''' + ProvisioningInfo returns the provisioning information for each given machine entity. + It supports all positive space constraints. + + entities : typing.Sequence[~Entity] + Returns -> ProvisioningInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ProvisioningInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(self, entities=None): + ''' + ReleaseContainerAddresses finds addresses allocated to a container and marks + them as Dead, to be released and removed. It accepts container tags as + arguments. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ReleaseContainerAddresses', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Remove', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): + ''' + SetCharmProfiles records the given slice of charm profile names. + + args : typing.Sequence[~SetProfileArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetCharmProfiles', + version=11, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetHostMachineNetworkConfig(self, config=None, tag=None): + ''' + config : typing.Sequence[~NetworkConfig] + tag : str + Returns -> None + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetHostMachineNetworkConfig', + version=11, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceInfo(self, machines=None): + ''' + SetInstanceInfo sets the provider specific machine id, nonce, + metadata and network info for each given machine. Once set, the + instance id cannot be changed. + + machines : typing.Sequence[~InstanceInfo] + Returns -> ErrorResults + ''' + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetInstanceInfo', + version=11, + params=_params) + _params['machines'] = machines + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + SetInstanceStatus updates the instance status for each given + entity. Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetInstanceStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModificationStatus(self, entities=None): + ''' + SetModificationStatus updates the instance whilst changes are occurring. This + is different from SetStatus and SetInstanceStatus, by the fact this holds + information about the ongoing changes that are happening to instances. + Consider LXD Profile updates that can modify a instance, but may not cause + the instance to be placed into a error state. This modification status + serves the purpose of highlighting that to the operator. + Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetModificationStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(self, config=None, tag=None): + ''' + SetObservedNetworkConfig reads the network config for the machine + identified by the input args. + This config is merged with the new network config supplied in the + same args and updated if it has changed. + + config : typing.Sequence[~NetworkConfig] + tag : str + Returns -> None + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetObservedNetworkConfig', + version=11, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetPasswords', + version=11, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetSupportedContainers(self, params=None): + ''' + SetSupportedContainers updates the list of containers supported by the machines passed in args. + + params : typing.Sequence[~MachineContainers] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetSupportedContainers', + version=11, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + Status returns the status of each given entity. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Status', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineContainerResults) + async def SupportedContainers(self, entities=None): + ''' + SupportedContainers returns the list of containers supported by the machines passed in args. + + entities : typing.Sequence[~Entity] + Returns -> MachineContainerResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SupportedContainers', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def Tools(self, entities=None): + ''' + Tools finds the tools necessary for the given agents. + + entities : typing.Sequence[~Entity] + Returns -> ToolsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Tools', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAPIHostPorts', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchAllContainers(self, params=None): + ''' + WatchAllContainers starts a StringsWatcher to watch all containers deployed to + any machine passed in args. + + params : typing.Sequence[~WatchContainer] + Returns -> StringsWatchResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAllContainers', + version=11, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainers(self, params=None): + ''' + WatchContainers starts a StringsWatcher to watch containers deployed to + any machine passed in args. + + params : typing.Sequence[~WatchContainer] + Returns -> StringsWatchResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchContainers', + version=11, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchForModelConfigChanges', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMachineErrorRetry(self): + ''' + WatchMachineErrorRetry returns a NotifyWatcher that notifies when + the provisioner should retry provisioning machines with transient errors. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchMachineErrorRetry', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachineStartTimes(self): + ''' + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachineStartTimes', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachines', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/_client19.py b/juju/client/_client19.py index 897e95da..3171ef69 100644 --- a/juju/client/_client19.py +++ b/juju/client/_client19.py @@ -1811,3 +1811,4504 @@ async def UpdateApplicationBase(self, args=None): return reply + +class UniterFacade(Type): + name = 'Uniter' + version = 19 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'execution-group': {'type': 'string'}, + 'name': {'type': 'string'}, + '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'}, + 'ActionMessageParams': {'additionalProperties': False, + 'properties': {'messages': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['messages'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CommitHookChangesArg': {'additionalProperties': False, + 'properties': {'add-storage': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}, + 'close-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'open-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'pod-spec': {'$ref': '#/definitions/PodSpec'}, + 'relation-unit-settings': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}, + 'secret-creates': {'items': {'$ref': '#/definitions/CreateSecretArg'}, + 'type': 'array'}, + 'secret-deletes': {'items': {'$ref': '#/definitions/DeleteSecretArg'}, + 'type': 'array'}, + 'secret-grants': {'items': {'$ref': '#/definitions/GrantRevokeSecretArg'}, + 'type': 'array'}, + 'secret-revokes': {'items': {'$ref': '#/definitions/GrantRevokeSecretArg'}, + 'type': 'array'}, + 'secret-track-latest': {'items': {'type': 'string'}, + 'type': 'array'}, + 'secret-updates': {'items': {'$ref': '#/definitions/UpdateSecretArg'}, + 'type': 'array'}, + 'set-raw-k8s-spec': {'$ref': '#/definitions/PodSpec'}, + 'tag': {'type': 'string'}, + 'unit-state': {'$ref': '#/definitions/SetUnitStateArg'}, + 'update-network-info': {'type': 'boolean'}}, + 'required': ['tag', + 'update-network-info'], + 'type': 'object'}, + 'CommitHookChangesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CommitHookChangesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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': {'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'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port', + 'endpoint'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + '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'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + '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'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListSecretResult': {'additionalProperties': False, + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + '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'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenPortRangesByEndpointResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-port-ranges': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/OpenUnitPortRangesByEndpoint'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['unit-port-ranges'], + 'type': 'object'}, + 'OpenPortRangesByEndpointResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OpenPortRangesByEndpointResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenUnitPortRangesByEndpoint': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, + 'type': 'array'}}, + 'required': ['endpoint', + 'port-ranges'], + 'type': 'object'}, + 'PodSpec': {'additionalProperties': False, + 'properties': {'spec': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + 'properties': {'bool': {'type': 'boolean'}, + 'endpoint': {'$ref': '#/definitions/Endpoint'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'integer'}, + 'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'other-application': {'type': 'string'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings', + 'application-settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + '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': {'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'}, + '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'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'secret-state': {'type': 'string'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'secret-state': {'type': 'string'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}, + 'target': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}, + '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': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ActionStatus': {'description': 'ActionStatus returns the ' + 'status of Actions by Tags ' + 'passed in.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Actions': {'description': 'Actions returns the Actions by ' + 'Tags passed and ensures that the ' + 'Unit asking\n' + 'for them is the same Unit that has ' + 'the Actions.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'description': 'AddMetricBatches adds the ' + 'metrics for the specified ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'description': 'ApplicationStatus ' + 'returns the status of ' + 'the Applications and its ' + 'workloads\n' + 'if the given unit is the ' + 'leader.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'description': 'AssignedMachine returns ' + 'the machine tag for each ' + 'given unit tag, or\n' + 'an error satisfying ' + 'params.IsCodeNotAssigned ' + 'when a unit has no\n' + 'assigned machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'description': 'AvailabilityZone returns ' + 'the availability zone for ' + 'each given unit, if ' + 'applicable.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'description': 'BeginActions marks the ' + 'actions represented by the ' + 'passed in Tags as running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CanApplyLXDProfile': {'description': 'CanApplyLXDProfile is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'description': 'CharmArchiveSha256 ' + 'returns the SHA256 ' + 'digest of the charm ' + 'archive\n' + '(bundle) data for each ' + 'charm url in the given ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'description': 'CharmModifiedVersion ' + 'returns the most ' + 'CharmModifiedVersion ' + 'for all given\n' + 'units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'description': 'CharmURL returns the charm URL ' + 'for all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'description': 'ClearResolved removes any ' + 'resolved setting from each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'description': 'CloudAPIVersion returns ' + 'the cloud API version, if ' + 'available.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'description': 'CloudSpec returns the cloud spec ' + 'used by the model in which the\n' + 'authenticated unit or ' + 'application resides.\n' + 'A check is made beforehand to ' + 'ensure that the request is made ' + 'by an entity\n' + 'that has been granted the ' + 'appropriate trust.', + 'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'CommitHookChanges': {'description': 'CommitHookChanges ' + 'batches together all ' + 'required API calls for ' + 'applying\n' + 'a set of changes after a ' + 'hook successfully ' + 'completes and executes ' + 'them in a\n' + 'single transaction.', + 'properties': {'Params': {'$ref': '#/definitions/CommitHookChangesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'description': 'ConfigSettings returns the ' + 'complete set of application ' + 'charm config\n' + 'settings available to each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + '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'}, + 'CurrentModel': {'description': 'CurrentModel returns the name ' + 'and UUID for the current juju ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'description': 'Destroy advances all given Alive ' + "units' lifecycles as far as\n" + 'possible. See ' + 'state/Unit.Destroy().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'description': 'DestroyAllSubordinates ' + 'destroys all ' + 'subordinates of ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'description': 'DestroyUnitStorageAttachments ' + 'marks each ' + 'storage ' + 'attachment ' + 'of the\n' + 'specified ' + 'units as ' + 'Dying.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'description': 'EnterScope ensures each unit ' + 'has entered its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.EnterScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'description': 'FinishActions saves the ' + 'result of a completed Action', + 'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + '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'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPodSpec': {'description': 'GetPodSpec gets the pod specs ' + 'for a set of applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'description': 'GetPrincipal returns the ' + 'result of calling ' + 'PrincipalName() and\n' + 'converting it to a tag, on ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GetRawK8sSpec': {'description': 'GetRawK8sSpec gets the raw ' + 'k8s specs for a set of ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetSecretBackendConfigs': {'description': 'GetSecretBackendConfigs ' + 'gets the config ' + 'needed to create a ' + 'client to secret ' + 'backends.', + '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'}, + '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'}, + 'GoalStates': {'description': 'GoalStates returns information ' + 'of charm units and relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'description': 'HasSubordinates returns ' + 'the whether each given ' + 'unit has any subordinates.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LXDProfileName': {'description': 'LXDProfileName is a shim to ' + 'call the LXDProfileAPIv2 ' + 'version of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'LXDProfileRequired': {'description': 'LXDProfileRequired is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'description': 'LeaveScope signals each unit ' + 'has left its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.LeaveScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'LogActionsMessages': {'description': 'LogActionsMessages ' + 'records the log ' + 'messages against the ' + 'specified actions.', + 'properties': {'Params': {'$ref': '#/definitions/ActionMessageParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Merge': {'description': 'Merge merges in the provided ' + 'leadership settings. Only leaders ' + 'for\n' + 'the given service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'description': 'NetworkInfo returns network ' + 'interfaces/addresses for ' + 'specified bindings.', + 'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenedMachinePortRangesByEndpoint': {'description': 'OpenedMachinePortRangesByEndpoint ' + 'returns ' + 'the port ' + 'ranges ' + 'opened ' + 'by each\n' + 'unit on ' + 'the ' + 'provided ' + 'machines ' + 'grouped ' + 'by ' + 'application ' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OpenPortRangesByEndpointResults'}}, + 'type': 'object'}, + 'OpenedPortRangesByEndpoint': {'description': 'OpenedPortRangesByEndpoint ' + 'returns the ' + 'port ranges ' + 'opened by the ' + 'unit.', + 'properties': {'Result': {'$ref': '#/definitions/OpenPortRangesByEndpointResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress returns the ' + 'private address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'description': 'ProviderType returns the ' + 'provider type used by the ' + 'current juju\n' + 'model.\n' + '\n' + 'TODO(dimitern): Refactor the ' + 'uniter to call this instead ' + 'of calling\n' + 'ModelConfig() just to get the ' + 'provider type. Once we have ' + 'machine\n' + 'addresses, this might be ' + 'completely unnecessary ' + 'though.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress returns the ' + 'public address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'description': 'Read reads leadership settings for ' + 'the provided service ID. Any\n' + 'unit of the service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadLocalApplicationSettings': {'description': 'ReadLocalApplicationSettings ' + 'returns the ' + 'local ' + 'application ' + 'settings for ' + 'a\n' + 'particular ' + 'relation when ' + 'invoked by ' + 'the leader ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnit'}, + 'Result': {'$ref': '#/definitions/SettingsResult'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'description': 'ReadRemoteSettings ' + 'returns the remote ' + 'settings of each given ' + 'set of\n' + 'relation/local ' + 'unit/remote unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'description': 'ReadSettings returns the ' + 'local settings of each given ' + 'set of\n' + 'relation/unit.\n' + '\n' + 'NOTE(achilleasa): Using this ' + 'call to read application data ' + 'is deprecated\n' + 'and will not work for k8s ' + 'charms (see LP1876097). ' + 'Instead, clients should\n' + 'use ' + 'ReadLocalApplicationSettings.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'description': 'Refresh retrieves the latest ' + 'values for attributes on this ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'description': 'Relation returns information ' + 'about all given relation/unit ' + 'pairs,\n' + 'including their id, key and the ' + 'local endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'description': 'RelationById returns ' + 'information about all given ' + 'relations,\n' + 'specified by their ids, ' + 'including their key and the ' + 'local\n' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'description': 'RelationsStatus returns ' + 'for each unit the ' + 'corresponding relation and ' + 'status information.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveSecrets': {'description': 'RemoveSecrets removes the ' + 'specified secrets.', + 'properties': {'Params': {'$ref': '#/definitions/DeleteSecretArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'description': 'RemoveStorageAttachments ' + 'removes the ' + 'specified ' + 'storage\n' + 'attachments from ' + 'state.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'description': 'RequestReboot sets the ' + 'reboot flag on the provided ' + 'machines', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved returns the current ' + 'resolved setting for each given ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': "SLALevel returns the model's SLA " + 'level.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + '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'}, + 'SetAgentStatus': {'description': 'SetAgentStatus will set ' + 'status for agents of Units ' + 'passed in args, if one\n' + 'of the args is not an Unit ' + 'it will fail.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'description': 'SetApplicationStatus ' + 'sets the status for ' + 'all the Applications ' + 'in args if the given ' + 'Unit is\n' + 'the leader.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'description': 'SetCharmURL sets the charm URL ' + 'for each given unit. An error ' + 'will\n' + 'be returned if a unit is dead, ' + 'or the charm URL is not known.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'description': 'SetRelationStatus ' + 'updates the status of ' + 'the specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetState': {'description': 'SetState sets the state persisted ' + 'by the charm running in this ' + 'unit\n' + 'and the state internal to the ' + 'uniter for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus will set status for a ' + 'entities passed in args. If the ' + 'entity is\n' + 'a Unit it will instead set ' + 'status to its agent, to emulate ' + 'backwards\n' + 'compatibility.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'description': 'SetUnitStatus sets status ' + 'for all elements passed in ' + 'args, the difference\n' + 'with SetStatus is that if an ' + 'entity is a Unit it will set ' + 'its status instead\n' + 'of its agent.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'description': 'SetWorkloadVersion sets ' + 'the workload version ' + 'for each given unit. An ' + 'error will\n' + 'be returned if a unit ' + 'is dead.', + 'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'description': 'State returns the state persisted by ' + 'the charm running in this unit\n' + 'and the state internal to the uniter ' + 'for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'description': 'StorageAttachmentLife ' + 'returns the ' + 'lifecycle state of ' + 'the storage ' + 'attachments\n' + 'with the specified ' + 'tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'description': 'StorageAttachments ' + 'returns the storage ' + 'attachments with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'description': 'UnitStatus returns the workload ' + 'status information for the ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'description': 'UnitStorageAttachments ' + 'returns the IDs of ' + 'storage attachments ' + 'for a collection of ' + 'units.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateNetworkInfo': {'description': 'UpdateNetworkInfo ' + 'refreshes the network ' + "settings for a unit's " + 'bound\n' + 'endpoints.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSecrets': {'description': 'UpdateSecrets updates the ' + 'specified secrets.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSecretArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'description': 'WatchActionNotifications ' + 'returns a ' + 'StringsWatcher ' + 'for observing\n' + 'incoming action ' + 'calls to a unit. ' + 'See also ' + 'state/watcher.go\n' + 'Unit.WatchActionNotifications(). ' + 'This method is ' + 'called from\n' + 'api/uniter/uniter.go ' + 'WatchActionNotifications().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'description': 'WatchConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields a ' + 'hash\n' + 'of the config ' + 'values every time ' + 'the config ' + 'changes. The ' + 'uniter can\n' + 'save this hash and ' + 'use it to decide ' + 'whether the ' + 'config-changed ' + 'hook\n' + 'needs to be run ' + '(or whether this ' + 'was just an agent ' + 'restart with no\n' + 'substantive config ' + 'change).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + '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'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchInstanceData': {'description': 'WatchInstanceData is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'description': 'WatchLeadershipSettings ' + 'will block the ' + 'caller until ' + 'leadership ' + 'settings\n' + 'for the given ' + 'service ID change.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + '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'}, + 'WatchRelationUnits': {'description': 'WatchRelationUnits ' + 'returns a ' + 'RelationUnitsWatcher ' + 'for observing\n' + 'changes to every unit ' + 'in the supplied ' + 'relation that is ' + 'visible to\n' + 'the supplied unit. See ' + 'also ' + 'state/watcher.go:RelationUnit.Watch().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + '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'}, + 'WatchStorageAttachments': {'description': 'WatchStorageAttachments ' + 'creates watchers ' + 'for a collection ' + 'of storage\n' + 'attachments, each ' + 'of which can be ' + 'used to watch ' + 'changes to ' + 'storage\n' + 'attachment info.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'description': 'WatchTrustConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields ' + 'a\n' + 'hash of the ' + 'application ' + 'config values ' + 'whenever they ' + 'change. The\n' + 'uniter can ' + 'use the hash ' + 'to determine ' + 'whether the ' + 'actual values ' + 'have\n' + 'changed since ' + 'it last saw ' + 'the config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'description': 'WatchUnitAddressesHash ' + 'returns a ' + 'StringsWatcher that ' + 'yields the\n' + 'hashes of the ' + 'addresses for the ' + 'unit whenever the ' + 'addresses\n' + 'change. The uniter ' + 'can use the hash to ' + 'determine whether ' + 'the actual\n' + 'address values have ' + 'changed since it ' + 'last saw the ' + 'config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'description': 'WatchUnitRelations ' + 'returns a ' + 'StringsWatcher, for ' + 'each given\n' + 'unit, that notifies of ' + 'changes to the ' + 'lifecycles of ' + 'relations\n' + 'relevant to that unit. ' + 'For principal units, ' + 'this will be all of ' + 'the\n' + 'relations for the ' + 'application. For ' + 'subordinate units, ' + 'only\n' + 'relations with the ' + "principal unit's " + 'application will be ' + 'monitored.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'description': 'WatchUnitStorageAttachments ' + 'creates ' + 'watchers for a ' + 'collection of ' + 'units,\n' + 'each of which ' + 'can be used to ' + 'watch for ' + 'lifecycle ' + 'changes to the ' + 'corresponding\n' + "unit's storage " + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'description': 'WorkloadVersion returns ' + 'the workload version for ' + 'all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def ActionStatus(self, entities=None): + ''' + ActionStatus returns the status of Actions by Tags passed in. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ActionStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + Actions returns the Actions by Tags passed and ensures that the Unit asking + for them is the same Unit that has the Actions. + + entities : typing.Sequence[~Entity] + Returns -> ActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Actions', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + AddMetricBatches adds the metrics for the specified unit. + + batches : typing.Sequence[~MetricBatchParam] + Returns -> ErrorResults + ''' + if batches is not None and not isinstance(batches, (bytes, str, list)): + raise Exception("Expected batches to be a Sequence, received: {}".format(type(batches))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='AddMetricBatches', + version=19, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + ApplicationStatus returns the status of the Applications and its workloads + if the given unit is the leader. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + AssignedMachine returns the machine tag for each given unit tag, or + an error satisfying params.IsCodeNotAssigned when a unit has no + assigned machine. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='AssignedMachine', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + AvailabilityZone returns the availability zone for each given unit, if applicable. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='AvailabilityZone', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + BeginActions marks the actions represented by the passed in Tags as running. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='BeginActions', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def CanApplyLXDProfile(self, entities=None): + ''' + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CanApplyLXDProfile', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. + + urls : typing.Sequence[~CharmURL] + Returns -> StringResults + ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmArchiveSha256', + version=19, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. + + entities : typing.Sequence[~Entity] + Returns -> IntResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + CharmURL returns the charm URL for all given units or applications. + + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmURL', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + ClearResolved removes any resolved setting from each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ClearResolved', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + CloudAPIVersion returns the cloud API version, if available. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + CloudSpec returns the cloud spec used by the model in which the + authenticated unit or application resides. + A check is made beforehand to ensure that the request is made by an entity + that has been granted the appropriate trust. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=None): + ''' + CommitHookChanges batches together all required API calls for applying + a set of changes after a hook successfully completes and executes them in a + single transaction. + + args : typing.Sequence[~CommitHookChangesArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CommitHookChanges', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + ConfigSettings returns the complete set of application charm config + settings available to each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ConfigSettingsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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='Uniter', + request='CreateSecretURIs', + version=19, + params=_params) + _params['count'] = count + reply = await self.rpc(msg) + return reply + + + + @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='Uniter', + request='CreateSecrets', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + CurrentModel returns the name and UUID for the current juju model. + + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Destroy', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + DestroyAllSubordinates destroys all subordinates of each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='DestroyAllSubordinates', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='DestroyUnitStorageAttachments', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='EnsureDead', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='EnterScope', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + FinishActions saves the result of a completed Action + + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults + ''' + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='FinishActions', + version=19, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretConsumerInfoResults) + async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + ''' + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults + ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetConsumerSecretsRevisionInfo', + version=19, + params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MeterStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetMeterStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): + ''' + GetPodSpec gets the pod specs for a set of applications. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetPodSpec', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. + + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetPrincipal', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): + ''' + GetRawK8sSpec gets the raw k8s specs for a set of applications. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetRawK8sSpec', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretBackendConfigs', + version=19, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretContentInfo', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + async def GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretMetadata', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretRevisionContentInfo', + version=19, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + GoalStates returns information of charm units and relations. + + entities : typing.Sequence[~Entity] + Returns -> GoalStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GoalStates', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + HasSubordinates returns the whether each given unit has any subordinates. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='HasSubordinates', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def LXDProfileName(self, entities=None): + ''' + LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileName', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def LXDProfileRequired(self, urls=None): + ''' + LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + + urls : typing.Sequence[~CharmURL] + Returns -> BoolResults + ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileRequired', + version=19, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + LeaveScope signals each unit has left its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.LeaveScope(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LeaveScope', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Life', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LogActionsMessages(self, messages=None): + ''' + LogActionsMessages records the log messages against the specified actions. + + messages : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if messages is not None and not isinstance(messages, (bytes, str, list)): + raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LogActionsMessages', + version=19, + params=_params) + _params['messages'] = messages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + Merge merges in the provided leadership settings. Only leaders for + the given service may perform this operation. + + params : typing.Sequence[~MergeLeadershipSettingsParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Merge', + version=19, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + NetworkInfo returns network interfaces/addresses for specified bindings. + + bindings : typing.Sequence[str] + relation_id : int + unit : str + Returns -> NetworkInfoResults + ''' + if bindings is not None and not isinstance(bindings, (bytes, str, list)): + raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='NetworkInfo', + version=19, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + async def OpenedMachinePortRangesByEndpoint(self, entities=None): + ''' + OpenedMachinePortRangesByEndpoint returns the port ranges opened by each + unit on the provided machines grouped by application endpoint. + + entities : typing.Sequence[~Entity] + Returns -> OpenPortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedMachinePortRangesByEndpoint', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + async def OpenedPortRangesByEndpoint(self): + ''' + OpenedPortRangesByEndpoint returns the port ranges opened by the unit. + + + Returns -> OpenPortRangesByEndpointResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedPortRangesByEndpoint', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + PrivateAddress returns the private address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PrivateAddress', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + ProviderType returns the provider type used by the current juju + model. + + TODO(dimitern): Refactor the uniter to call this instead of calling + ModelConfig() just to get the provider type. Once we have machine + addresses, this might be completely unnecessary though. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + PublicAddress returns the public address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PublicAddress', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + Read reads leadership settings for the provided service ID. Any + unit of the service may perform this operation. + + entities : typing.Sequence[~Entity] + Returns -> GetLeadershipSettingsBulkResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Read', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResult) + async def ReadLocalApplicationSettings(self, relation=None, unit=None): + ''' + ReadLocalApplicationSettings returns the local application settings for a + particular relation when invoked by the leader unit. + + relation : str + unit : str + Returns -> SettingsResult + ''' + if relation is not None and not isinstance(relation, (bytes, str)): + raise Exception("Expected relation to be a str, received: {}".format(type(relation))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadLocalApplicationSettings', + version=19, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + ReadRemoteSettings returns the remote settings of each given set of + relation/local unit/remote unit. + + relation_unit_pairs : typing.Sequence[~RelationUnitPair] + Returns -> SettingsResults + ''' + if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): + raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadRemoteSettings', + version=19, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + ReadSettings returns the local settings of each given set of + relation/unit. + + NOTE(achilleasa): Using this call to read application data is deprecated + and will not work for k8s charms (see LP1876097). Instead, clients should + use ReadLocalApplicationSettings. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> SettingsResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadSettings', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + Refresh retrieves the latest values for attributes on this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitRefreshResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Refresh', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + Relation returns information about all given relation/unit pairs, + including their id, key and the local endpoint. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Relation', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + RelationById returns information about all given relations, + specified by their ids, including their key and the local + endpoint. + + relation_ids : typing.Sequence[int] + Returns -> RelationResults + ''' + if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): + raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationById', + version=19, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + RelationsStatus returns for each unit the corresponding relation and status information. + + entities : typing.Sequence[~Entity] + Returns -> RelationUnitStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationsStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveSecrets', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + RemoveStorageAttachments removes the specified storage + attachments from state. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveStorageAttachments', + version=19, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RequestReboot', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + Resolved returns the current resolved setting for each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ResolvedModeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Resolved', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the model's SLA level. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsGrant', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRevoke', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRotated', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetAgentStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + SetApplicationStatus sets the status for all the Applications in args if the given Unit is + the leader. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetApplicationStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + SetCharmURL sets the charm URL for each given unit. An error will + be returned if a unit is dead, or the charm URL is not known. + + entities : typing.Sequence[~EntityCharmURL] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetCharmURL', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + SetRelationStatus updates the status of the specified relations. + + args : typing.Sequence[~RelationStatusArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetRelationStatus', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetState(self, args=None): + ''' + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetState', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus will set status for a entities passed in args. If the entity is + a Unit it will instead set status to its agent, to emulate backwards + compatibility. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + SetUnitStatus sets status for all elements passed in args, the difference + with SetStatus is that if an entity is a Unit it will set its status instead + of its agent. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUnitStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUpgradeSeriesUnitStatus', + version=19, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + SetWorkloadVersion sets the workload version for each given unit. An error will + be returned if a unit is dead. + + entities : typing.Sequence[~EntityWorkloadVersion] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetWorkloadVersion', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def State(self, entities=None): + ''' + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='State', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> LifeResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='StorageAttachmentLife', + version=19, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + StorageAttachments returns the storage attachments with the specified tags. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> StorageAttachmentResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='StorageAttachments', + version=19, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + UnitStatus returns the workload status information for the unit. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. + + entities : typing.Sequence[~Entity] + Returns -> StorageAttachmentIdsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateNetworkInfo(self, entities=None): + ''' + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UpdateNetworkInfo', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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='Uniter', + request='UpdateSecrets', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. + + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UpgradeSeriesUnitStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Watch', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a unit. See also state/watcher.go + Unit.WatchActionNotifications(). This method is called from + api/uniter/uniter.go WatchActionNotifications(). + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchActionNotifications', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): + ''' + WatchConfigSettingsHash returns a StringsWatcher that yields a hash + of the config values every time the config changes. The uniter can + save this hash and use it to decide whether the config-changed hook + needs to be run (or whether this was just an agent restart with no + substantive config change). + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchConfigSettingsHash', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConsumedSecretsChanges(self, entities=None): + ''' + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchConsumedSecretsChanges', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchInstanceData(self, entities=None): + ''' + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchInstanceData', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchLeadershipSettings', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchMeterStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchObsolete(self, entities=None): + ''' + WatchObsolete returns a watcher for notifying when: + - a secret owned by the entity is deleted + - a secret revision owed by the entity no longer + has any consumers + + Obsolete revisions results are "uri/revno" and deleted + secret results are "uri". + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchObsolete', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + WatchRelationUnits returns a RelationUnitsWatcher for observing + changes to every unit in the supplied relation that is visible to + the supplied unit. See also state/watcher.go:RelationUnit.Watch(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationUnitsWatchResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchRelationUnits', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @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='Uniter', + request='WatchSecretRevisionsExpiryChanges', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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='Uniter', + request='WatchSecretsRotationChanges', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + WatchStorageAttachments creates watchers for a collection of storage + attachments, each of which can be used to watch changes to storage + attachment info. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> NotifyWatchResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchStorageAttachments', + version=19, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchTrustConfigSettingsHash(self, entities=None): + ''' + WatchTrustConfigSettingsHash returns a StringsWatcher that yields a + hash of the application config values whenever they change. The + uniter can use the hash to determine whether the actual values have + changed since it last saw the config. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchTrustConfigSettingsHash', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitAddressesHash(self, entities=None): + ''' + WatchUnitAddressesHash returns a StringsWatcher that yields the + hashes of the addresses for the unit whenever the addresses + change. The uniter can use the hash to determine whether the actual + address values have changed since it last saw the config. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitAddressesHash', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitRelations(self, entities=None): + ''' + WatchUnitRelations returns a StringsWatcher, for each given + unit, that notifies of changes to the lifecycles of relations + relevant to that unit. For principal units, this will be all of the + relations for the application. For subordinate units, only + relations with the principal unit's application will be monitored. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitRelations', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + WatchUnitStorageAttachments creates watchers for a collection of units, + each of which can be used to watch for lifecycle changes to the corresponding + unit's storage attachments. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitStorageAttachments', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUpgradeSeriesNotifications', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + WorkloadVersion returns the workload version for all given units or applications. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WorkloadVersion', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/_client2.py b/juju/client/_client2.py index c8e5ed59..217bd88b 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -250,41 +250,67 @@ async def SwitchBlockOn(self, message=None, type_=None): -class HighAvailabilityFacade(Type): - name = 'HighAvailability' +class CAASAgentFacade(Type): + name = 'CAASAgent' version = 2 - schema = {'definitions': {'ControllersChangeResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ControllersChanges'}}, - 'required': ['result'], + schema = {'definitions': {'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], 'type': 'object'}, - 'ControllersChangeResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ControllersChangeResult'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'ControllersChanges': {'additionalProperties': False, - 'properties': {'added': {'items': {'type': 'string'}, - 'type': 'array'}, - 'converted': {'items': {'type': 'string'}, - 'type': 'array'}, - 'maintained': {'items': {'type': 'string'}, - 'type': 'array'}, - 'removed': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ControllersSpec': {'additionalProperties': False, - 'properties': {'constraints': {'$ref': '#/definitions/Value'}, - 'num-controllers': {'type': 'integer'}, - 'placement': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['num-controllers'], - 'type': 'object'}, - 'ControllersSpecs': {'additionalProperties': False, - 'properties': {'specs': {'items': {'$ref': '#/definitions/ControllersSpec'}, - 'type': 'array'}}, - 'required': ['specs'], - '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, @@ -293,151 +319,209 @@ class HighAvailabilityFacade(Type): 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, - 'Value': {'additionalProperties': False, - 'properties': {'allocate-public-ip': {'type': 'boolean'}, - 'arch': {'type': 'string'}, - 'container': {'type': 'string'}, - 'cores': {'type': 'integer'}, - 'cpu-power': {'type': 'integer'}, - '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': {'EnableHA': {'description': 'EnableHA adds controller machines ' - 'as necessary to ensure the\n' - 'controller has the number of ' - 'machines specified.', - 'properties': {'Params': {'$ref': '#/definitions/ControllersSpecs'}, - 'Result': {'$ref': '#/definitions/ControllersChangeResults'}}, - 'type': 'object'}}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(ControllersChangeResults) - async def EnableHA(self, specs=None): + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): ''' - EnableHA adds controller machines as necessary to ensure the - controller has the number of machines specified. + CloudSpec returns the model's cloud spec. - specs : typing.Sequence[~ControllersSpec] - Returns -> ControllersChangeResults + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults ''' - if specs is not None and not isinstance(specs, (bytes, str, list)): - raise Exception("Expected specs to be a Sequence, received: {}".format(type(specs))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='HighAvailability', - request='EnableHA', + msg = dict(type='CAASAgent', + request='CloudSpec', version=2, params=_params) - _params['specs'] = specs + _params['entities'] = entities reply = await self.rpc(msg) return reply -class MetricsDebugFacade(Type): - name = 'MetricsDebug' - version = 2 - schema = {'definitions': {'Entities': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'Entity': {'additionalProperties': False, - 'properties': {'tag': {'type': 'string'}}, - 'required': ['tag'], - 'type': 'object'}, - 'EntityMetrics': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'metrics': {'items': {'$ref': '#/definitions/MetricResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'Error': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'info': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'message': {'type': 'string'}}, - 'required': ['message', 'code'], - 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'ErrorResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'MeterStatusParam': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'info': {'type': 'string'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'code'], - 'type': 'object'}, - 'MeterStatusParams': {'additionalProperties': False, - 'properties': {'statues': {'items': {'$ref': '#/definitions/MeterStatusParam'}, - 'type': 'array'}}, - 'required': ['statues'], - 'type': 'object'}, - 'MetricResult': {'additionalProperties': False, - 'properties': {'key': {'type': 'string'}, - 'labels': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'time': {'format': 'date-time', - 'type': 'string'}, - 'unit': {'type': 'string'}, - 'value': {'type': 'string'}}, - 'required': ['time', - 'key', - 'value', - 'unit', - 'labels'], - 'type': 'object'}, - 'MetricResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/EntityMetrics'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'GetMetrics': {'description': 'GetMetrics returns all metrics ' - 'stored by the state server.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/MetricResults'}}, - 'type': 'object'}, - 'SetMeterStatus': {'description': 'SetMeterStatus sets meter ' - 'statuses for entities.', - 'properties': {'Params': {'$ref': '#/definitions/MeterStatusParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. - @ReturnMapping(MetricResults) - async def GetMetrics(self, entities=None): + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='ControllerAPIInfoForModels', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult ''' - GetMetrics returns all metrics stored by the state server. + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='ControllerConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='GetCloudSpec', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='ModelConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. entities : typing.Sequence[~Entity] - Returns -> MetricResults + 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='MetricsDebug', - request='GetMetrics', + msg = dict(type='CAASAgent', + request='WatchCloudSpecsChanges', version=2, params=_params) _params['entities'] = entities @@ -446,70 +530,326 @@ async def GetMetrics(self, entities=None): - @ReturnMapping(ErrorResults) - async def SetMeterStatus(self, statues=None): + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): ''' - SetMeterStatus sets meter statuses for entities. + 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. - statues : typing.Sequence[~MeterStatusParam] - Returns -> ErrorResults + + Returns -> NotifyWatchResult ''' - if statues is not None and not isinstance(statues, (bytes, str, list)): - raise Exception("Expected statues to be a Sequence, received: {}".format(type(statues))) # map input types to rpc msg _params = dict() - msg = dict(type='MetricsDebug', - request='SetMeterStatus', + msg = dict(type='CAASAgent', + request='WatchForModelConfigChanges', version=2, params=_params) - _params['statues'] = statues + reply = await self.rpc(msg) return reply -class SecretsFacade(Type): - name = 'Secrets' +class CAASUnitProvisionerFacade(Type): + name = 'CAASUnitProvisioner' version = 2 - schema = {'definitions': {'AccessInfo': {'additionalProperties': False, - 'properties': {'role': {'type': 'string'}, - 'scope-tag': {'type': 'string'}, - 'target-tag': {'type': 'string'}}, - 'required': ['target-tag', 'scope-tag', 'role'], + schema = {'definitions': {'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationGetConfigResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'ApplicationUnitInfo': {'additionalProperties': False, + 'properties': {'provider-id': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['provider-id', + 'unit-tag'], + 'type': 'object'}, + 'ApplicationUnitParams': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-info': {'items': {'$ref': '#/definitions/KubernetesFilesystemInfo'}, + 'type': 'array'}, + 'info': {'type': 'string'}, + 'ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'stateful': {'type': 'boolean'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['provider-id', + 'unit-tag', + 'address', + 'ports', + 'status', + 'info'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], 'type': 'object'}, - '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'}, + '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'}, - 'rotate-policy': {'type': 'string'}, - 'uri': {'type': 'string'}}, - 'required': ['UpsertSecretArg', - 'owner-tag'], + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], 'type': 'object'}, - 'CreateSecretArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/CreateSecretArg'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'DeleteSecretArg': {'additionalProperties': False, - 'properties': {'label': {'type': 'string'}, - 'revisions': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'uri': {'type': 'string'}}, - 'required': ['uri', 'label'], + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'DockerImageInfo': {'additionalProperties': False, + 'properties': {'auth': {'type': 'string'}, + 'email': {'type': 'string'}, + 'identitytoken': {'type': 'string'}, + 'image-name': {'type': 'string'}, + 'password': {'type': 'string'}, + 'registrytoken': {'type': 'string'}, + 'repository': {'type': 'string'}, + 'serveraddress': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['image-name'], 'type': 'object'}, - 'DeleteSecretArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/DeleteSecretArg'}, - 'type': 'array'}}, - 'required': ['args'], + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, @@ -527,254 +867,5367 @@ class SecretsFacade(Type): 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'GrantRevokeUserSecretArg': {'additionalProperties': False, - 'properties': {'applications': {'items': {'type': 'string'}, - 'type': 'array'}, - 'label': {'type': 'string'}, - 'uri': {'type': 'string'}}, - 'required': ['uri', - 'label', - 'applications'], - 'type': 'object'}, - 'ListSecretResult': {'additionalProperties': False, - 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, - 'type': 'array'}, - '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'}, - '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'], + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], 'type': 'object'}, - 'SecretValueResult': {'additionalProperties': False, - 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesDeploymentInfo': {'additionalProperties': False, + 'properties': {'deployment-type': {'type': 'string'}, + 'service-type': {'type': 'string'}}, + 'required': ['deployment-type', + 'service-type'], + 'type': 'object'}, + 'KubernetesDeviceParams': {'additionalProperties': False, + 'properties': {'Attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'Count': {'type': 'integer'}, + 'Type': {'type': 'string'}}, + 'required': ['Type', + 'Count', + 'Attributes'], + 'type': 'object'}, + 'KubernetesFilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesFilesystemInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'mount-point': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'storagename': {'type': 'string'}, + 'volume': {'$ref': '#/definitions/KubernetesVolumeInfo'}}, + 'required': ['storagename', + 'pool', + 'size', + 'filesystem-id', + 'status', + 'info', + 'volume'], + 'type': 'object'}, + 'KubernetesFilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'KubernetesProvisioningInfo': {'additionalProperties': False, + 'properties': {'charm-modified-version': {'type': 'integer'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'deployment-info': {'$ref': '#/definitions/KubernetesDeploymentInfo'}, + 'devices': {'items': {'$ref': '#/definitions/KubernetesDeviceParams'}, + 'type': 'array'}, + 'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'}, + 'type': 'array'}, + 'image-repo': {'$ref': '#/definitions/DockerImageInfo'}, + 'pod-spec': {'type': 'string'}, + 'raw-k8s-spec': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/KubernetesVolumeParams'}, + 'type': 'array'}}, + 'required': ['pod-spec', + 'constraints'], + 'type': 'object'}, + 'KubernetesProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/KubernetesProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'KubernetesProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/KubernetesProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesVolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesVolumeInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'volume-id': {'type': 'string'}}, + 'required': ['volume-id', + 'size', + 'persistent', + 'status', + 'info'], + 'type': 'object'}, + 'KubernetesVolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesVolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], 'type': 'object'}, - 'SecretsFilter': {'additionalProperties': False, - 'properties': {'label': {'type': 'string'}, - 'owner-tag': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'uri': {'type': 'string'}}, - 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, 'StringResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'type': 'string'}}, 'required': ['result'], 'type': 'object'}, - 'StringResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, - 'type': 'array'}}, - 'required': ['results'], + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateApplicationServiceArg': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'provider-id': {'type': 'string'}, + 'scale': {'type': 'integer'}}, + 'required': ['application-tag', + 'provider-id', + 'addresses'], + 'type': 'object'}, + 'UpdateApplicationServiceArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationServiceArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationUnits'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/UpdateApplicationUnitsInfo'}}, + 'type': 'object'}, + 'UpdateApplicationUnitResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateApplicationUnitResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateApplicationUnits': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'scale': {'type': 'integer'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'units': {'items': {'$ref': '#/definitions/ApplicationUnitParams'}, + 'type': 'array'}}, + 'required': ['application-tag', + 'units'], + 'type': 'object'}, + 'UpdateApplicationUnitsInfo': {'additionalProperties': False, + 'properties': {'units': {'items': {'$ref': '#/definitions/ApplicationUnitInfo'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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'}, + 'ApplicationsConfig': {'description': 'ApplicationsConfig ' + 'returns the config for ' + 'the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'ApplicationsScale': {'description': 'ApplicationsScale ' + 'returns the scaling info ' + 'for specified ' + 'applications in this ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'ApplicationsTrust': {'description': 'ApplicationsTrust ' + 'returns the trust status ' + 'for specified ' + 'applications in this ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ClearApplicationsResources': {'description': 'ClearApplicationsResources ' + 'clears the ' + 'flags which ' + 'indicate\n' + 'applications ' + 'still have ' + 'resources in ' + 'the cluster.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DeploymentMode': {'description': 'DeploymentMode returns the ' + 'deployment mode of the ' + "given applications' charms.", + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the provisioning info for ' + 'specified applications in ' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/KubernetesProvisioningInfoResults'}}, + 'type': 'object'}, + 'SetOperatorStatus': {'description': 'SetOperatorStatus ' + 'updates the operator ' + 'status for each given ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationsService': {'description': 'UpdateApplicationsService ' + 'updates the Juju ' + 'data model to ' + 'reflect the ' + 'given\n' + 'service details ' + 'of the specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationServiceArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationsUnits': {'description': 'UpdateApplicationsUnits ' + 'updates the Juju ' + 'data model to ' + 'reflect the given\n' + 'units of the ' + 'specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationUnitArgs'}, + 'Result': {'$ref': '#/definitions/UpdateApplicationUnitResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts a NotifyWatcher for ' + 'each entity given.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchApplicationsScale': {'description': 'WatchApplicationsScale ' + 'starts a ' + 'NotifyWatcher to ' + 'watch changes\n' + 'to the ' + "applications' " + 'scale.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplicationsTrustHash': {'description': 'WatchApplicationsTrustHash ' + 'starts a ' + 'StringsWatcher ' + 'to watch ' + 'changes\n' + 'to the ' + "applications' " + 'trust status.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchPodSpec': {'description': 'WatchPodSpec starts a ' + 'NotifyWatcher to watch ' + 'changes to the\n' + 'pod spec for specified units ' + 'in this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationCharmInfo', + version=2, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): + ''' + ApplicationsConfig returns the config for the specified applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsConfig', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def ApplicationsScale(self, entities=None): + ''' + ApplicationsScale returns the scaling info for specified applications in this model. + + entities : typing.Sequence[~Entity] + Returns -> IntResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsScale', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def ApplicationsTrust(self, entities=None): + ''' + ApplicationsTrust returns the trust status for specified applications in this model. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsTrust', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='CharmInfo', + version=2, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearApplicationsResources(self, entities=None): + ''' + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ClearApplicationsResources', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DeploymentMode(self, entities=None): + ''' + DeploymentMode returns the deployment mode of the given applications' charms. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='DeploymentMode', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='Life', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(KubernetesProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): + ''' + ProvisioningInfo returns the provisioning info for specified applications in this model. + + entities : typing.Sequence[~Entity] + Returns -> KubernetesProvisioningInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ProvisioningInfo', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetOperatorStatus(self, entities=None): + ''' + SetOperatorStatus updates the operator status for each given application. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='SetOperatorStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationsService(self, args=None): + ''' + UpdateApplicationsService updates the Juju data model to reflect the given + service details of the specified application. + + args : typing.Sequence[~UpdateApplicationServiceArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsService', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateApplicationUnitResults) + async def UpdateApplicationsUnits(self, args=None): + ''' + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. + + args : typing.Sequence[~UpdateApplicationUnits] + Returns -> UpdateApplicationUnitResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsUnits', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts a NotifyWatcher for each entity given. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='Watch', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplications', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchApplicationsScale(self, entities=None): + ''' + WatchApplicationsScale starts a NotifyWatcher to watch changes + to the applications' scale. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsScale', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchApplicationsTrustHash(self, entities=None): + ''' + WatchApplicationsTrustHash starts a StringsWatcher to watch changes + to the applications' trust status. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsTrustHash', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchPodSpec(self, entities=None): + ''' + WatchPodSpec starts a NotifyWatcher to watch changes to the + pod spec for specified units in this model. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchPodSpec', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class CharmRevisionUpdaterFacade(Type): + name = 'CharmRevisionUpdater' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}}, + 'properties': {'UpdateLatestRevisions': {'description': 'UpdateLatestRevisions ' + 'retrieves the latest ' + 'revision information ' + 'from the charm store ' + 'for all deployed ' + 'charms\n' + 'and records this ' + 'information in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def UpdateLatestRevisions(self): + ''' + UpdateLatestRevisions retrieves the latest revision information from the charm store for all deployed charms + and records this information in state. + + + Returns -> ErrorResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CharmRevisionUpdater', + request='UpdateLatestRevisions', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CleanerFacade(Type): + name = 'Cleaner' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'Cleanup': {'description': 'Cleanup triggers a state cleanup', + 'type': 'object'}, + 'WatchCleanups': {'description': 'WatchCleanups watches for ' + 'cleanups to be performed in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Cleanup(self): + ''' + Cleanup triggers a state cleanup + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cleaner', + request='Cleanup', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchCleanups(self): + ''' + WatchCleanups watches for cleanups to be performed in state. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cleaner', + request='WatchCleanups', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CredentialValidatorFacade(Type): + name = 'CredentialValidator' + version = 2 + schema = {'definitions': {'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'InvalidateCredentialArg': {'additionalProperties': False, + 'properties': {'reason': {'type': 'string'}}, + 'type': 'object'}, + 'ModelCredential': {'additionalProperties': False, + 'properties': {'credential-tag': {'type': 'string'}, + 'exists': {'type': 'boolean'}, + 'model-tag': {'type': 'string'}, + 'valid': {'type': 'boolean'}}, + 'required': ['model-tag', + 'credential-tag'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'InvalidateModelCredential': {'description': 'InvalidateModelCredential ' + 'marks the cloud ' + 'credential for ' + 'this model as ' + 'invalid.', + 'properties': {'Params': {'$ref': '#/definitions/InvalidateCredentialArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'ModelCredential': {'description': 'ModelCredential returns ' + 'cloud credential ' + 'information for a model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelCredential'}}, + 'type': 'object'}, + 'WatchCredential': {'description': 'WatchCredential returns a ' + 'NotifyWatcher that ' + 'observes\n' + 'changes to a given cloud ' + 'credential.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelCredential': {'description': 'WatchModelCredential ' + 'returns a ' + 'NotifyWatcher that ' + 'watches what cloud ' + 'credential a model ' + 'uses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def InvalidateModelCredential(self, reason=None): + ''' + InvalidateModelCredential marks the cloud credential for this model as invalid. + + reason : str + Returns -> ErrorResult + ''' + if reason is not None and not isinstance(reason, (bytes, str)): + raise Exception("Expected reason to be a str, received: {}".format(type(reason))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='InvalidateModelCredential', + version=2, + params=_params) + _params['reason'] = reason + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelCredential) + async def ModelCredential(self): + ''' + ModelCredential returns cloud credential information for a model. + + + Returns -> ModelCredential + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='ModelCredential', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchCredential(self, tag=None): + ''' + WatchCredential returns a NotifyWatcher that observes + changes to a given cloud credential. + + tag : str + Returns -> NotifyWatchResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='WatchCredential', + version=2, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchModelCredential(self): + ''' + WatchModelCredential returns a NotifyWatcher that watches what cloud credential a model uses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='WatchModelCredential', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CrossModelRelationsFacade(Type): + name = 'CrossModelRelations' + version = 2 + schema = {'definitions': {'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'IngressNetworksChangeEvent': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'ingress-required': {'type': 'boolean'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'networks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token', + 'ingress-required'], + 'type': 'object'}, + 'IngressNetworksChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/IngressNetworksChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'OfferArg': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'offer-uuid': {'type': 'string'}}, + 'required': ['offer-uuid'], + 'type': 'object'}, + 'OfferArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/OfferArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'OfferStatusChange': {'additionalProperties': False, + 'properties': {'offer-name': {'type': 'string'}, + 'status': {'$ref': '#/definitions/EntityStatus'}}, + 'required': ['offer-name', 'status'], + 'type': 'object'}, + 'OfferStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'OfferStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OfferStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RegisterRemoteRelationArg': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'consume-version': {'type': 'integer'}, + 'local-endpoint-name': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'offer-uuid': {'type': 'string'}, + 'relation-token': {'type': 'string'}, + 'remote-endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, + 'remote-space': {'$ref': '#/definitions/RemoteSpace'}, + 'source-model-tag': {'type': 'string'}}, + 'required': ['application-token', + 'source-model-tag', + 'relation-token', + 'remote-endpoint', + 'remote-space', + 'offer-uuid', + 'local-endpoint-name'], + 'type': 'object'}, + 'RegisterRemoteRelationArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/RegisterRemoteRelationArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}, + 'RegisterRemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelationDetails'}}, + 'type': 'object'}, + 'RegisterRemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RegisterRemoteRelationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['key', + 'life', + 'suspended', + 'suspended-reason'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteEntityArg': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteEntityArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RemoteEntityArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RemoteRelationChangeEvent': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, + 'type': 'array'}, + 'departed-units': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'force-cleanup': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}, + 'unit-count': {'type': 'integer'}}, + 'required': ['relation-token', + 'application-token', + 'life', + 'unit-count'], + 'type': 'object'}, + 'RemoteRelationDetails': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RemoteRelationWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'SecretRevisionChange': {'additionalProperties': False, + 'properties': {'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', 'revision'], + 'type': 'object'}, + 'SecretRevisionWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRevisionChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'SecretRevisionWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SecretRevisionWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'WatchRemoteSecretChangesArg': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['application-token', + 'relation-token'], + 'type': 'object'}, + 'WatchRemoteSecretChangesArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/WatchRemoteSecretChangesArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}}, + 'properties': {'PublishIngressNetworkChanges': {'description': 'PublishIngressNetworkChanges ' + 'publishes ' + 'changes to ' + 'the required\n' + 'ingress ' + 'addresses to ' + 'the model ' + 'hosting the ' + 'offer in the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/IngressNetworksChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PublishRelationChanges': {'description': 'PublishRelationChanges ' + 'publishes relation ' + 'changes to the\n' + 'model hosting the ' + 'remote application ' + 'involved in the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RegisterRemoteRelations': {'description': 'RegisterRemoteRelations ' + 'sets up the model ' + 'to participate\n' + 'in the specified ' + 'relations. This ' + 'operation is ' + 'idempotent.', + 'properties': {'Params': {'$ref': '#/definitions/RegisterRemoteRelationArgs'}, + 'Result': {'$ref': '#/definitions/RegisterRemoteRelationResults'}}, + 'type': 'object'}, + 'WatchConsumedSecretsChanges': {'description': 'WatchConsumedSecretsChanges ' + 'returns a ' + 'watcher which ' + 'notifies of ' + 'changes to any ' + 'secrets\n' + 'for the ' + 'specified ' + 'remote ' + 'consumers.', + 'properties': {'Params': {'$ref': '#/definitions/WatchRemoteSecretChangesArgs'}, + 'Result': {'$ref': '#/definitions/SecretRevisionWatchResults'}}, + 'type': 'object'}, + 'WatchEgressAddressesForRelations': {'description': 'WatchEgressAddressesForRelations ' + 'creates a ' + 'watcher ' + 'that ' + 'notifies ' + 'when ' + 'addresses, ' + 'from ' + 'which\n' + 'connections ' + 'will ' + 'originate ' + 'for the ' + 'relation, ' + 'change.\n' + 'Each ' + 'event ' + 'contains ' + 'the ' + 'entire ' + 'set of ' + 'addresses ' + 'which are ' + 'required ' + 'for ' + 'ingress ' + 'for the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchOfferStatus': {'description': 'WatchOfferStatus starts ' + 'an OfferStatusWatcher ' + 'for\n' + 'watching the status of an ' + 'offer.', + 'properties': {'Params': {'$ref': '#/definitions/OfferArgs'}, + 'Result': {'$ref': '#/definitions/OfferStatusWatchResults'}}, + 'type': 'object'}, + 'WatchRelationChanges': {'description': 'WatchRelationChanges ' + 'starts a ' + 'RemoteRelationChangesWatcher ' + 'for each\n' + 'specified relation, ' + 'returning the watcher ' + 'IDs and initial ' + 'values,\n' + 'or an error if the ' + 'remote relations ' + "couldn't be watched.", + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RemoteRelationWatchResults'}}, + 'type': 'object'}, + 'WatchRelationsSuspendedStatus': {'description': 'WatchRelationsSuspendedStatus ' + 'starts a ' + 'RelationStatusWatcher ' + 'for\n' + 'watching the ' + 'life and ' + 'suspended ' + 'status of a ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RelationStatusWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def PublishIngressNetworkChanges(self, changes=None): + ''' + PublishIngressNetworkChanges publishes changes to the required + ingress addresses to the model hosting the offer in the relation. + + changes : typing.Sequence[~IngressNetworksChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishIngressNetworkChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def PublishRelationChanges(self, changes=None): + ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RegisterRemoteRelationResults) + async def RegisterRemoteRelations(self, relations=None): + ''' + RegisterRemoteRelations sets up the model to participate + in the specified relations. This operation is idempotent. + + relations : typing.Sequence[~RegisterRemoteRelationArg] + Returns -> RegisterRemoteRelationResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='RegisterRemoteRelations', + version=2, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretRevisionWatchResults) + async def WatchConsumedSecretsChanges(self, relations=None): + ''' + WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets + for the specified remote consumers. + + relations : typing.Sequence[~WatchRemoteSecretChangesArg] + Returns -> SecretRevisionWatchResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchConsumedSecretsChanges', + version=2, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, args=None): + ''' + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchEgressAddressesForRelations', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OfferStatusWatchResults) + async def WatchOfferStatus(self, args=None): + ''' + WatchOfferStatus starts an OfferStatusWatcher for + watching the status of an offer. + + args : typing.Sequence[~OfferArg] + Returns -> OfferStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchOfferStatus', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationWatchResults) + async def WatchRelationChanges(self, args=None): + ''' + WatchRelationChanges starts a RemoteRelationChangesWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RemoteRelationWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationChanges', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationStatusWatchResults) + async def WatchRelationsSuspendedStatus(self, args=None): + ''' + WatchRelationsSuspendedStatus starts a RelationStatusWatcher for + watching the life and suspended status of a relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationsSuspendedStatus', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class DiskManagerFacade(Type): + name = 'DiskManager' + version = 2 + schema = {'definitions': {'BlockDevice': {'additionalProperties': False, + 'properties': {'BusAddress': {'type': 'string'}, + 'DeviceLinks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'DeviceName': {'type': 'string'}, + 'FilesystemType': {'type': 'string'}, + 'HardwareId': {'type': 'string'}, + 'InUse': {'type': 'boolean'}, + 'Label': {'type': 'string'}, + 'MountPoint': {'type': 'string'}, + 'SerialId': {'type': 'string'}, + 'Size': {'type': 'integer'}, + 'UUID': {'type': 'string'}, + 'WWN': {'type': 'string'}}, + 'required': ['DeviceName', + 'DeviceLinks', + 'Label', + 'UUID', + 'HardwareId', + 'WWN', + 'BusAddress', + 'Size', + 'FilesystemType', + 'InUse', + 'MountPoint', + 'SerialId'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineBlockDevices': {'additionalProperties': False, + 'properties': {'block-devices': {'items': {'$ref': '#/definitions/BlockDevice'}, + 'type': 'array'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'SetMachineBlockDevices': {'additionalProperties': False, + 'properties': {'machine-block-devices': {'items': {'$ref': '#/definitions/MachineBlockDevices'}, + 'type': 'array'}}, + 'required': ['machine-block-devices'], + 'type': 'object'}}, + 'properties': {'SetMachineBlockDevices': {'properties': {'Params': {'$ref': '#/definitions/SetMachineBlockDevices'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def SetMachineBlockDevices(self, machine_block_devices=None): + ''' + machine_block_devices : typing.Sequence[~MachineBlockDevices] + Returns -> ErrorResults + ''' + if machine_block_devices is not None and not isinstance(machine_block_devices, (bytes, str, list)): + raise Exception("Expected machine_block_devices to be a Sequence, received: {}".format(type(machine_block_devices))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='DiskManager', + request='SetMachineBlockDevices', + version=2, + params=_params) + _params['machine-block-devices'] = machine_block_devices + reply = await self.rpc(msg) + return reply + + + +class EntityWatcherFacade(Type): + name = 'EntityWatcher' + version = 2 + schema = {'definitions': {'EntitiesWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvEntitiesWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/EntitiesWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(EntitiesWatchResult) + async def Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvEntitiesWatcher. + + + Returns -> EntitiesWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='EntityWatcher', + request='Next', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='EntityWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class FilesystemAttachmentsWatcherFacade(Type): + name = 'FilesystemAttachmentsWatcher' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvMachineStorageIdsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MachineStorageIdsWatchResult) + async def Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvMachineStorageIdsWatcher. + + + Returns -> MachineStorageIdsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FilesystemAttachmentsWatcher', + request='Next', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FilesystemAttachmentsWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class HighAvailabilityFacade(Type): + name = 'HighAvailability' + version = 2 + schema = {'definitions': {'ControllersChangeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ControllersChanges'}}, + 'required': ['result'], + 'type': 'object'}, + 'ControllersChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllersChangeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllersChanges': {'additionalProperties': False, + 'properties': {'added': {'items': {'type': 'string'}, + 'type': 'array'}, + 'converted': {'items': {'type': 'string'}, + 'type': 'array'}, + 'maintained': {'items': {'type': 'string'}, + 'type': 'array'}, + 'removed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllersSpec': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'num-controllers': {'type': 'integer'}, + 'placement': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['num-controllers'], + 'type': 'object'}, + 'ControllersSpecs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/ControllersSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'EnableHA': {'description': 'EnableHA adds controller machines ' + 'as necessary to ensure the\n' + 'controller has the number of ' + 'machines specified.', + 'properties': {'Params': {'$ref': '#/definitions/ControllersSpecs'}, + 'Result': {'$ref': '#/definitions/ControllersChangeResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ControllersChangeResults) + async def EnableHA(self, specs=None): + ''' + EnableHA adds controller machines as necessary to ensure the + controller has the number of machines specified. + + specs : typing.Sequence[~ControllersSpec] + Returns -> ControllersChangeResults + ''' + if specs is not None and not isinstance(specs, (bytes, str, list)): + raise Exception("Expected specs to be a Sequence, received: {}".format(type(specs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='HighAvailability', + request='EnableHA', + version=2, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + +class LeadershipServiceFacade(Type): + name = 'LeadershipService' + version = 2 + schema = {'definitions': {'ApplicationTag': {'additionalProperties': False, + 'properties': {'Name': {'type': 'string'}}, + 'required': ['Name'], + 'type': 'object'}, + 'ClaimLeadershipBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/ClaimLeadershipParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'ClaimLeadershipBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ClaimLeadershipParams': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'duration': {'type': 'number'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['application-tag', + 'unit-tag', + 'duration'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}}, + 'properties': {'BlockUntilLeadershipReleased': {'description': 'BlockUntilLeadershipReleased ' + 'blocks the ' + 'caller until ' + 'leadership ' + 'is\n' + 'released for ' + 'the given ' + 'service.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationTag'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'ClaimLeadership': {'description': 'ClaimLeadership makes a ' + 'leadership claim with the ' + 'given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/ClaimLeadershipBulkParams'}, + 'Result': {'$ref': '#/definitions/ClaimLeadershipBulkResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def BlockUntilLeadershipReleased(self, name=None): + ''' + BlockUntilLeadershipReleased blocks the caller until leadership is + released for the given service. + + name : str + Returns -> ErrorResult + ''' + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LeadershipService', + request='BlockUntilLeadershipReleased', + version=2, + params=_params) + _params['Name'] = name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ClaimLeadershipBulkResults) + async def ClaimLeadership(self, params=None): + ''' + ClaimLeadership makes a leadership claim with the given parameters. + + params : typing.Sequence[~ClaimLeadershipParams] + Returns -> ClaimLeadershipBulkResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LeadershipService', + request='ClaimLeadership', + version=2, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + +class MeterStatusFacade(Type): + name = 'MeterStatus' + version = 2 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'secret-state': {'type': 'string'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'secret-state': {'type': 'string'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'GetMeterStatus': {'description': 'GetMeterStatus returns ' + 'meter status information ' + 'for each unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'SetState': {'description': 'SetState sets the state persisted ' + 'by the charm running in this ' + 'unit\n' + 'and the state internal to the ' + 'uniter for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'description': 'State returns the state persisted by ' + 'the charm running in this unit\n' + 'and the state internal to the uniter ' + 'for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'description': 'WatchMeterStatus returns ' + 'a NotifyWatcher for ' + 'observing changes\n' + "to each unit's meter " + 'status.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + GetMeterStatus returns meter status information for each unit. + + entities : typing.Sequence[~Entity] + Returns -> MeterStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='GetMeterStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetState(self, args=None): + ''' + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='SetState', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def State(self, entities=None): + ''' + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='State', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + WatchMeterStatus returns a NotifyWatcher for observing changes + to each unit's meter status. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='WatchMeterStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MetricsAdderFacade(Type): + name = 'MetricsAdder' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}}, + 'properties': {'AddMetricBatches': {'description': 'AddMetricBatches ' + 'implements the ' + 'MetricsAdder interface.', + 'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + AddMetricBatches implements the MetricsAdder interface. + + batches : typing.Sequence[~MetricBatchParam] + Returns -> ErrorResults + ''' + if batches is not None and not isinstance(batches, (bytes, str, list)): + raise Exception("Expected batches to be a Sequence, received: {}".format(type(batches))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsAdder', + request='AddMetricBatches', + version=2, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + +class MetricsDebugFacade(Type): + name = 'MetricsDebug' + version = 2 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityMetrics': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'metrics': {'items': {'$ref': '#/definitions/MetricResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MeterStatusParam': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'code'], + 'type': 'object'}, + 'MeterStatusParams': {'additionalProperties': False, + 'properties': {'statues': {'items': {'$ref': '#/definitions/MeterStatusParam'}, + 'type': 'array'}}, + 'required': ['statues'], + 'type': 'object'}, + 'MetricResult': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'unit': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['time', + 'key', + 'value', + 'unit', + 'labels'], + 'type': 'object'}, + 'MetricResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntityMetrics'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'GetMetrics': {'description': 'GetMetrics returns all metrics ' + 'stored by the state server.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MetricResults'}}, + 'type': 'object'}, + 'SetMeterStatus': {'description': 'SetMeterStatus sets meter ' + 'statuses for entities.', + 'properties': {'Params': {'$ref': '#/definitions/MeterStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MetricResults) + async def GetMetrics(self, entities=None): + ''' + GetMetrics returns all metrics stored by the state server. + + entities : typing.Sequence[~Entity] + Returns -> MetricResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsDebug', + request='GetMetrics', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMeterStatus(self, statues=None): + ''' + SetMeterStatus sets meter statuses for entities. + + statues : typing.Sequence[~MeterStatusParam] + Returns -> ErrorResults + ''' + if statues is not None and not isinstance(statues, (bytes, str, list)): + raise Exception("Expected statues to be a Sequence, received: {}".format(type(statues))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsDebug', + request='SetMeterStatus', + version=2, + params=_params) + _params['statues'] = statues + reply = await self.rpc(msg) + return reply + + + +class ProxyUpdaterFacade(Type): + name = 'ProxyUpdater' + version = 2 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProxyConfig': {'additionalProperties': False, + 'properties': {'ftp': {'type': 'string'}, + 'http': {'type': 'string'}, + 'https': {'type': 'string'}, + 'no-proxy': {'type': 'string'}}, + 'required': ['http', + 'https', + 'ftp', + 'no-proxy'], + 'type': 'object'}, + 'ProxyConfigResult': {'additionalProperties': False, + 'properties': {'apt-mirror': {'type': 'string'}, + 'apt-proxy-settings': {'$ref': '#/definitions/ProxyConfig'}, + 'error': {'$ref': '#/definitions/Error'}, + 'juju-proxy-settings': {'$ref': '#/definitions/ProxyConfig'}, + 'legacy-proxy-settings': {'$ref': '#/definitions/ProxyConfig'}, + 'snap-proxy-settings': {'$ref': '#/definitions/ProxyConfig'}, + 'snap-store-assertions': {'type': 'string'}, + 'snap-store-id': {'type': 'string'}, + 'snap-store-proxy-url': {'type': 'string'}}, + 'required': ['legacy-proxy-settings', + 'juju-proxy-settings'], + 'type': 'object'}, + 'ProxyConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProxyConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ProxyConfig': {'description': 'ProxyConfig returns the proxy ' + 'settings for the current ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProxyConfigResults'}}, + 'type': 'object'}, + 'WatchForProxyConfigAndAPIHostPortChanges': {'description': 'WatchForProxyConfigAndAPIHostPortChanges ' + 'watches ' + 'for ' + 'changes ' + 'to ' + 'the ' + 'proxy ' + 'and ' + 'api ' + 'host ' + 'port ' + 'settings.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ProxyConfigResults) + async def ProxyConfig(self, entities=None): + ''' + ProxyConfig returns the proxy settings for the current model. + + entities : typing.Sequence[~Entity] + Returns -> ProxyConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ProxyUpdater', + request='ProxyConfig', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): + ''' + WatchForProxyConfigAndAPIHostPortChanges watches for changes to the proxy and api host port settings. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ProxyUpdater', + request='WatchForProxyConfigAndAPIHostPortChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class RaftLeaseFacade(Type): + name = 'RaftLease' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LeaseOperationCommand': {'additionalProperties': False, + 'properties': {'duration': {'type': 'integer'}, + 'holder': {'type': 'string'}, + 'lease': {'type': 'string'}, + 'model-uuid': {'type': 'string'}, + 'namespace': {'type': 'string'}, + 'new-time': {'format': 'date-time', + 'type': 'string'}, + 'old-time': {'format': 'date-time', + 'type': 'string'}, + 'operation': {'type': 'string'}, + 'pin-entity': {'type': 'string'}, + 'version': {'type': 'integer'}}, + 'required': ['version', 'operation'], + 'type': 'object'}, + 'LeaseOperationsV2': {'additionalProperties': False, + 'properties': {'commands': {'items': {'$ref': '#/definitions/LeaseOperationCommand'}, + 'type': 'array'}}, + 'required': ['commands'], + 'type': 'object'}}, + 'properties': {'ApplyLease': {'description': 'ApplyLease is a bulk API to ' + 'allow applying lease operations ' + 'to a raft\n' + 'context. If the current ' + 'controller is not the leader, ' + 'then a NotLeaderError\n' + 'is returned. Information about ' + 'where they can locate the ' + 'leader maybe\n' + 'supplied in the error message, ' + "but isn't guaranteed.\n" + 'If no information is supplied, ' + 'it is expected that the client ' + 'performs their\n' + 'own algorithm to locate the ' + 'leader (roundrobin or listen to ' + 'the apidetails\n' + 'topic).', + 'properties': {'Params': {'$ref': '#/definitions/LeaseOperationsV2'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ApplyLease(self, commands=None): + ''' + ApplyLease is a bulk API to allow applying lease operations to a raft + context. If the current controller is not the leader, then a NotLeaderError + is returned. Information about where they can locate the leader maybe + supplied in the error message, but isn't guaranteed. + If no information is supplied, it is expected that the client performs their + own algorithm to locate the leader (roundrobin or listen to the apidetails + topic). + + commands : typing.Sequence[~LeaseOperationCommand] + Returns -> ErrorResults + ''' + if commands is not None and not isinstance(commands, (bytes, str, list)): + raise Exception("Expected commands to be a Sequence, received: {}".format(type(commands))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RaftLease', + request='ApplyLease', + version=2, + params=_params) + _params['commands'] = commands + reply = await self.rpc(msg) + return reply + + + +class RebootFacade(Type): + name = 'Reboot' + version = 2 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'RebootActionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'type': 'object'}, + 'RebootActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RebootActionResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'ClearReboot': {'description': 'ClearReboot will clear the ' + 'reboot flag on provided ' + 'machines, if it exists.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetRebootAction': {'description': 'GetRebootAction returns ' + 'the action a machine agent ' + 'should take.\n' + 'If a reboot flag is set on ' + 'the machine, then that ' + 'machine is\n' + 'expected to reboot ' + '(params.ShouldReboot).\n' + 'a reboot flag set on the ' + 'machine parent or ' + 'grandparent, will\n' + 'cause the machine to ' + 'shutdown ' + '(params.ShouldShutdown).\n' + 'If no reboot flag is set, ' + 'the machine should do ' + 'nothing ' + '(params.ShouldDoNothing).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RebootActionResults'}}, + 'type': 'object'}, + 'RequestReboot': {'description': 'RequestReboot sets the ' + 'reboot flag on the provided ' + 'machines', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchForRebootEvent': {'description': 'WatchForRebootEvent ' + 'starts a watcher to ' + 'track if there is a ' + 'new\n' + 'reboot request on the ' + 'machines ID or any of ' + 'its parents (in case ' + 'we are a container).', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ClearReboot(self, entities=None): + ''' + ClearReboot will clear the reboot flag on provided machines, if it exists. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='ClearReboot', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RebootActionResults) + async def GetRebootAction(self, entities=None): + ''' + GetRebootAction returns the action a machine agent should take. + If a reboot flag is set on the machine, then that machine is + expected to reboot (params.ShouldReboot). + a reboot flag set on the machine parent or grandparent, will + cause the machine to shutdown (params.ShouldShutdown). + If no reboot flag is set, the machine should do nothing (params.ShouldDoNothing). + + entities : typing.Sequence[~Entity] + Returns -> RebootActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='GetRebootAction', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='RequestReboot', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForRebootEvent(self): + ''' + WatchForRebootEvent starts a watcher to track if there is a new + reboot request on the machines ID or any of its parents (in case we are a container). + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='WatchForRebootEvent', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class RemoteRelationsFacade(Type): + name = 'RemoteRelations' + version = 2 + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityMacaroonArg': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'tag': {'type': 'string'}}, + 'required': ['macaroon', 'tag'], + 'type': 'object'}, + 'EntityMacaroonArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/EntityMacaroonArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ExternalControllerInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}}, + 'required': ['controller-tag', + 'controller-alias', + 'addrs', + 'ca-cert'], + 'type': 'object'}, + 'GetTokenArg': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'GetTokenArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/GetTokenArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'LatestSecretRevisionChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRevisionChange'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RemoteApplication': {'additionalProperties': False, + 'properties': {'consume-version': {'type': 'integer'}, + 'is-consumer-proxy': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['name', + 'offer-uuid', + 'model-uuid', + 'is-consumer-proxy'], + 'type': 'object'}, + 'RemoteApplicationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteApplication'}}, + 'type': 'object'}, + 'RemoteApplicationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteEntityTokenArg': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'token': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'RemoteEntityTokenArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/RemoteEntityTokenArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'RemoteRelation': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, + 'id': {'type': 'integer'}, + 'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'remote-application-name': {'type': 'string'}, + 'remote-endpoint-name': {'type': 'string'}, + 'source-model-uuid': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'unit-count': {'type': 'integer'}}, + 'required': ['life', + 'suspended', + 'id', + 'key', + 'application-name', + 'endpoint', + 'unit-count', + 'remote-application-name', + 'remote-endpoint-name', + 'source-model-uuid'], + 'type': 'object'}, + 'RemoteRelationChangeEvent': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, + 'type': 'array'}, + 'departed-units': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'force-cleanup': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}, + 'unit-count': {'type': 'integer'}}, + 'required': ['relation-token', + 'application-token', + 'life', + 'unit-count'], + 'type': 'object'}, + 'RemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelation'}}, + 'type': 'object'}, + 'RemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RemoteRelationWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SecretRevisionChange': {'additionalProperties': False, + 'properties': {'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', 'revision'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TokenResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'token': {'type': 'string'}}, + 'type': 'object'}, + 'TokenResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/TokenResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UpdateControllerForModel': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', 'info'], + 'type': 'object'}, + 'UpdateControllersForModelsParams': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/UpdateControllerForModel'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}}, + 'properties': {'ConsumeRemoteRelationChanges': {'description': 'ConsumeRemoteRelationChanges ' + 'consumes ' + 'changes to ' + 'settings ' + 'originating\n' + 'from the ' + 'remote/offering ' + 'side of ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConsumeRemoteSecretChanges': {'description': 'ConsumeRemoteSecretChanges ' + 'updates the ' + 'local model ' + 'with secret ' + 'revision ' + 'changes\n' + 'originating ' + 'from the ' + 'remote/offering ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/LatestSecretRevisionChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'ExportEntities': {'description': 'ExportEntities allocates ' + 'unique, remote entity IDs ' + 'for the given entities in ' + 'the local model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/TokenResults'}}, + 'type': 'object'}, + 'GetTokens': {'description': 'GetTokens returns the token ' + 'associated with the entities ' + 'with the given tags for the ' + 'given models.', + 'properties': {'Params': {'$ref': '#/definitions/GetTokenArgs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ImportRemoteEntities': {'description': 'ImportRemoteEntities ' + 'adds entities to the ' + 'remote entities ' + 'collection with the ' + 'specified opaque ' + 'tokens.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityTokenArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Relations': {'description': 'Relations returns information ' + 'about the cross-model relations ' + 'with the specified keys\n' + 'in the local model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteRelationResults'}}, + 'type': 'object'}, + 'RemoteApplications': {'description': 'RemoteApplications ' + 'returns the current ' + 'state of the remote ' + 'applications with\n' + 'the specified names in ' + 'the local model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteApplicationResults'}}, + 'type': 'object'}, + 'SaveMacaroons': {'description': 'SaveMacaroons saves the ' + 'macaroons for the given ' + 'entities.', + 'properties': {'Params': {'$ref': '#/definitions/EntityMacaroonArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRemoteApplicationsStatus': {'description': 'SetRemoteApplicationsStatus ' + 'sets the ' + 'status for the ' + 'specified ' + 'remote ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateControllersForModels': {'description': 'UpdateControllersForModels ' + 'changes the ' + 'external ' + 'controller ' + 'records for ' + 'the\n' + 'associated ' + 'model entities. ' + 'This is used ' + 'when the remote ' + 'relations ' + 'worker gets\n' + 'redirected ' + 'following ' + 'migration of an ' + 'offering model.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateControllersForModelsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchLocalRelationChanges': {'description': 'WatchLocalRelationChanges ' + 'starts a ' + 'RemoteRelationWatcher ' + 'for each\n' + 'specified ' + 'relation, ' + 'returning the ' + 'watcher IDs and ' + 'initial values,\n' + 'or an error if ' + 'the remote ' + 'relations ' + "couldn't be " + 'watched.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteRelationWatchResults'}}, + 'type': 'object'}, + 'WatchRemoteApplicationRelations': {'description': 'WatchRemoteApplicationRelations ' + 'starts a ' + 'StringsWatcher ' + 'for ' + 'watching ' + 'the ' + 'relations ' + 'of\n' + 'each ' + 'specified ' + 'application ' + 'in the ' + 'local ' + 'model, and ' + 'returns ' + 'the ' + 'watcher ' + 'IDs\n' + 'and ' + 'initial ' + 'values, or ' + 'an error ' + 'if the ' + "services' " + 'relations ' + 'could not ' + 'be\n' + 'watched.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchRemoteApplications': {'description': 'WatchRemoteApplications ' + 'starts a strings ' + 'watcher that ' + 'notifies of the ' + 'addition,\n' + 'removal, and ' + 'lifecycle changes ' + 'of remote ' + 'applications in ' + 'the model; and\n' + 'returns the ' + 'watcher ID and ' + 'initial IDs of ' + 'remote ' + 'applications, or ' + 'an error if\n' + 'watching failed.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchRemoteRelations': {'description': 'WatchRemoteRelations ' + 'starts a strings ' + 'watcher that notifies ' + 'of the addition,\n' + 'removal, and ' + 'lifecycle changes of ' + 'remote relations in ' + 'the model; and\n' + 'returns the watcher ' + 'ID and initial IDs of ' + 'remote relations, or ' + 'an error if\n' + 'watching failed.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ConsumeRemoteRelationChanges(self, changes=None): + ''' + ConsumeRemoteRelationChanges consumes changes to settings originating + from the remote/offering side of relations. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ConsumeRemoteRelationChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ConsumeRemoteSecretChanges(self, changes=None): + ''' + ConsumeRemoteSecretChanges updates the local model with secret revision changes + originating from the remote/offering model. + + changes : typing.Sequence[~SecretRevisionChange] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ConsumeRemoteSecretChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ControllerAPIInfoForModels', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ControllerConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(TokenResults) + async def ExportEntities(self, entities=None): + ''' + ExportEntities allocates unique, remote entity IDs for the given entities in the local model. + + entities : typing.Sequence[~Entity] + Returns -> TokenResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ExportEntities', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetTokens(self, args=None): + ''' + GetTokens returns the token associated with the entities with the given tags for the given models. + + args : typing.Sequence[~GetTokenArg] + Returns -> StringResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='GetTokens', + version=2, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ImportRemoteEntities(self, args=None): + ''' + ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens. + + args : typing.Sequence[~RemoteEntityTokenArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ImportRemoteEntities', + version=2, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationResults) + async def Relations(self, entities=None): + ''' + Relations returns information about the cross-model relations with the specified keys + in the local model. + + entities : typing.Sequence[~Entity] + Returns -> RemoteRelationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='Relations', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteApplicationResults) + async def RemoteApplications(self, entities=None): + ''' + RemoteApplications returns the current state of the remote applications with + the specified names in the local model. + + entities : typing.Sequence[~Entity] + Returns -> RemoteApplicationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='RemoteApplications', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SaveMacaroons(self, args=None): + ''' + SaveMacaroons saves the macaroons for the given entities. + + args : typing.Sequence[~EntityMacaroonArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='SaveMacaroons', + version=2, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRemoteApplicationsStatus(self, entities=None): + ''' + SetRemoteApplicationsStatus sets the status for the specified remote applications. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='SetRemoteApplicationsStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateControllersForModels(self, changes=None): + ''' + UpdateControllersForModels changes the external controller records for the + associated model entities. This is used when the remote relations worker gets + redirected following migration of an offering model. + + changes : typing.Sequence[~UpdateControllerForModel] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='UpdateControllersForModels', + version=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationWatchResults) + async def WatchLocalRelationChanges(self, entities=None): + ''' + WatchLocalRelationChanges starts a RemoteRelationWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + entities : typing.Sequence[~Entity] + Returns -> RemoteRelationWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchLocalRelationChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchRemoteApplicationRelations(self, entities=None): + ''' + WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of + each specified application in the local model, and returns the watcher IDs + and initial values, or an error if the services' relations could not be + watched. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteApplicationRelations', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchRemoteApplications(self): + ''' + WatchRemoteApplications starts a strings watcher that notifies of the addition, + removal, and lifecycle changes of remote applications in the model; and + returns the watcher ID and initial IDs of remote applications, or an error if + watching failed. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteApplications', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchRemoteRelations(self): + ''' + WatchRemoteRelations starts a strings watcher that notifies of the addition, + removal, and lifecycle changes of remote relations in the model; and + returns the watcher ID and initial IDs of remote relations, or an error if + watching failed. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteRelations', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class SecretsFacade(Type): + name = 'Secrets' + version = 2 + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'CreateSecretArg': {'additionalProperties': False, + 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, + 'content': {'$ref': '#/definitions/SecretContentParams'}, + 'description': {'type': 'string'}, + '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'}, + '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'}, + 'GrantRevokeUserSecretArg': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'label': {'type': 'string'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', + 'label', + 'applications'], + 'type': 'object'}, + 'ListSecretResult': {'additionalProperties': False, + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + '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'}, + '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'}, + 'SecretsFilter': {'additionalProperties': False, + 'properties': {'label': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + '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'}, + 'UpdateUserSecretArg': {'additionalProperties': False, + 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, + 'auto-prune': {'type': 'boolean'}, + 'content': {'$ref': '#/definitions/SecretContentParams'}, + 'description': {'type': 'string'}, + 'existing-label': {'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', + 'existing-label'], + 'type': 'object'}, + 'UpdateUserSecretArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateUserSecretArg'}, + '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': {'CreateSecrets': {'description': 'CreateSecrets creates new ' + 'secrets.', + 'properties': {'Params': {'$ref': '#/definitions/CreateSecretArgs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GrantSecret': {'description': 'GrantSecret grants access to a ' + 'user secret.', + 'properties': {'Params': {'$ref': '#/definitions/GrantRevokeUserSecretArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListSecrets': {'description': 'ListSecrets lists available ' + 'secrets.', + 'properties': {'Params': {'$ref': '#/definitions/ListSecretsArgs'}, + 'Result': {'$ref': '#/definitions/ListSecretResults'}}, + 'type': 'object'}, + 'RemoveSecrets': {'description': 'RemoveSecrets remove user ' + 'secret.', + 'properties': {'Params': {'$ref': '#/definitions/DeleteSecretArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RevokeSecret': {'description': 'RevokeSecret revokes access ' + 'to a user secret.', + 'properties': {'Params': {'$ref': '#/definitions/GrantRevokeUserSecretArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSecrets': {'description': 'UpdateSecrets creates new ' + 'secrets.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateUserSecretArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def CreateSecrets(self, args=None): + ''' + CreateSecrets creates new secrets. + + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='CreateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def GrantSecret(self, applications=None, label=None, uri=None): + ''' + GrantSecret grants access to a user secret. + + applications : typing.Sequence[str] + label : str + uri : str + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if label is not None and not isinstance(label, (bytes, str)): + raise Exception("Expected label to be a str, received: {}".format(type(label))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='GrantSecret', + version=2, + params=_params) + _params['applications'] = applications + _params['label'] = label + _params['uri'] = uri + reply = await self.rpc(msg) + return reply + + + + @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=2, + params=_params) + _params['filter'] = filter_ + _params['show-secrets'] = show_secrets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveSecrets(self, args=None): + ''' + RemoveSecrets remove user secret. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='RemoveSecrets', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RevokeSecret(self, applications=None, label=None, uri=None): + ''' + RevokeSecret revokes access to a user secret. + + applications : typing.Sequence[str] + label : str + uri : str + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if label is not None and not isinstance(label, (bytes, str)): + raise Exception("Expected label to be a str, received: {}".format(type(label))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='RevokeSecret', + version=2, + params=_params) + _params['applications'] = applications + _params['label'] = label + _params['uri'] = uri + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSecrets(self, args=None): + ''' + UpdateSecrets creates new secrets. + + args : typing.Sequence[~UpdateUserSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='UpdateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class SecretsManagerFacade(Type): + name = 'SecretsManager' + version = 2 + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'CreateSecretArg': {'additionalProperties': False, + 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, + 'content': {'$ref': '#/definitions/SecretContentParams'}, + 'description': {'type': 'string'}, + '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': {'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'}, + 'Entities': {'additionalProperties': 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': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + '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'}, + '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'}, + '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': {'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'}, + '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'}, + 'GetSecretBackendConfigs': {'description': 'GetSecretBackendConfigs ' + 'gets the config ' + 'needed to create a ' + 'client to secret ' + 'backends.', + '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'}, + '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'}, + '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'} + + + @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=2, + params=_params) + _params['count'] = count + reply = await self.rpc(msg) + return reply + + + + @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=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretConsumerInfoResults) + async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + ''' + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults + ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetConsumerSecretsRevisionInfo', + version=2, + params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretBackendConfigs', + version=2, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretContentInfo', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + async def GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretMetadata', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretRevisionContentInfo', + version=2, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='RemoveSecrets', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='SecretsGrant', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='SecretsRevoke', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='SecretsRotated', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @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=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConsumedSecretsChanges(self, entities=None): + ''' + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchConsumedSecretsChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class SingularFacade(Type): + name = 'Singular' + version = 2 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SingularClaim': {'additionalProperties': False, + 'properties': {'claimant-tag': {'type': 'string'}, + 'duration': {'type': 'integer'}, + 'entity-tag': {'type': 'string'}}, + 'required': ['entity-tag', + 'claimant-tag', + 'duration'], 'type': 'object'}, - 'UpdateUserSecretArg': {'additionalProperties': False, - 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, - 'auto-prune': {'type': 'boolean'}, - 'content': {'$ref': '#/definitions/SecretContentParams'}, - 'description': {'type': 'string'}, - 'existing-label': {'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', - 'existing-label'], - 'type': 'object'}, - 'UpdateUserSecretArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateUserSecretArg'}, - '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': {'CreateSecrets': {'description': 'CreateSecrets creates new ' - 'secrets.', - 'properties': {'Params': {'$ref': '#/definitions/CreateSecretArgs'}, - 'Result': {'$ref': '#/definitions/StringResults'}}, - 'type': 'object'}, - 'GrantSecret': {'description': 'GrantSecret grants access to a ' - 'user secret.', - 'properties': {'Params': {'$ref': '#/definitions/GrantRevokeUserSecretArg'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ListSecrets': {'description': 'ListSecrets lists available ' - 'secrets.', - 'properties': {'Params': {'$ref': '#/definitions/ListSecretsArgs'}, - 'Result': {'$ref': '#/definitions/ListSecretResults'}}, - 'type': 'object'}, - 'RemoveSecrets': {'description': 'RemoveSecrets remove user ' - 'secret.', - 'properties': {'Params': {'$ref': '#/definitions/DeleteSecretArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RevokeSecret': {'description': 'RevokeSecret revokes access ' - 'to a user secret.', - 'properties': {'Params': {'$ref': '#/definitions/GrantRevokeUserSecretArg'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UpdateSecrets': {'description': 'UpdateSecrets creates new ' - 'secrets.', - 'properties': {'Params': {'$ref': '#/definitions/UpdateUserSecretArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, + 'SingularClaims': {'additionalProperties': False, + 'properties': {'claims': {'items': {'$ref': '#/definitions/SingularClaim'}, + 'type': 'array'}}, + 'required': ['claims'], + 'type': 'object'}}, + 'properties': {'Claim': {'description': 'Claim makes the supplied ' + 'singular-controller lease requests. ' + '(In practice,\n' + 'any requests not for the ' + "connection's model or controller, or " + 'not on behalf\n' + 'of the connected ModelManager ' + 'machine, will be rejected.)', + 'properties': {'Params': {'$ref': '#/definitions/SingularClaims'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Wait': {'description': 'Wait waits for the ' + 'singular-controller lease to expire ' + 'for all supplied\n' + 'entities. (In practice, any requests ' + 'that do not refer to the ' + "connection's\n" + 'model or controller will be ' + 'rejected.)', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(StringResults) - async def CreateSecrets(self, args=None): + @ReturnMapping(ErrorResults) + async def Claim(self, claims=None): ''' - CreateSecrets creates new secrets. + Claim makes the supplied singular-controller lease requests. (In practice, + any requests not for the connection's model or controller, or not on behalf + of the connected ModelManager machine, will be rejected.) - args : typing.Sequence[~CreateSecretArg] - Returns -> StringResults + claims : typing.Sequence[~SingularClaim] + Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if claims is not None and not isinstance(claims, (bytes, str, list)): + raise Exception("Expected claims to be a Sequence, received: {}".format(type(claims))) # map input types to rpc msg _params = dict() - msg = dict(type='Secrets', - request='CreateSecrets', + msg = dict(type='Singular', + request='Claim', version=2, params=_params) - _params['args'] = args + _params['claims'] = claims reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def GrantSecret(self, applications=None, label=None, uri=None): + async def Wait(self, entities=None): ''' - GrantSecret grants access to a user secret. + Wait waits for the singular-controller lease to expire for all supplied + entities. (In practice, any requests that do not refer to the connection's + model or controller will be rejected.) - applications : typing.Sequence[str] - label : str - uri : str + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if applications is not None and not isinstance(applications, (bytes, str, list)): - raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - if label is not None and not isinstance(label, (bytes, str)): - raise Exception("Expected label to be a str, received: {}".format(type(label))) + # map input types to rpc msg + _params = dict() + msg = dict(type='Singular', + request='Wait', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply - if uri is not None and not isinstance(uri, (bytes, str)): - raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + +class StatusHistoryFacade(Type): + name = 'StatusHistory' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'StatusHistoryPruneArgs': {'additionalProperties': False, + 'properties': {'max-history-mb': {'type': 'integer'}, + 'max-history-time': {'type': 'integer'}}, + 'required': ['max-history-time', + 'max-history-mb'], + 'type': 'object'}}, + 'properties': {'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'Prune': {'description': 'Prune endpoint removes status ' + 'history entries until\n' + 'only the ones newer than now - ' + 'p.MaxHistoryTime remain and\n' + 'the history is smaller than ' + 'p.MaxHistoryMB.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryPruneArgs'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Secrets', - request='GrantSecret', + msg = dict(type='StatusHistory', + request='ModelConfig', version=2, params=_params) - _params['applications'] = applications - _params['label'] = label - _params['uri'] = uri + reply = await self.rpc(msg) return reply - @ReturnMapping(ListSecretResults) - async def ListSecrets(self, filter_=None, show_secrets=None): + @ReturnMapping(None) + async def Prune(self, max_history_mb=None, max_history_time=None): ''' - ListSecrets lists available secrets. + Prune endpoint removes status history entries until + only the ones newer than now - p.MaxHistoryTime remain and + the history is smaller than p.MaxHistoryMB. - filter_ : SecretsFilter - show_secrets : bool - Returns -> ListSecretResults + max_history_mb : int + max_history_time : int + Returns -> None ''' - if filter_ is not None and not isinstance(filter_, (dict, SecretsFilter)): - raise Exception("Expected filter_ to be a SecretsFilter, received: {}".format(type(filter_))) + 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 show_secrets is not None and not isinstance(show_secrets, bool): - raise Exception("Expected show_secrets to be a bool, received: {}".format(type(show_secrets))) + if 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='Secrets', - request='ListSecrets', + msg = dict(type='StatusHistory', + request='Prune', version=2, params=_params) - _params['filter'] = filter_ - _params['show-secrets'] = show_secrets + _params['max-history-mb'] = max_history_mb + _params['max-history-time'] = max_history_time + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StatusHistory', + request='WatchForModelConfigChanges', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class UpgradeStepsFacade(Type): + name = 'UpgradeSteps' + version = 2 + schema = {'definitions': {'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'secret-state': {'type': 'string'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}}, + 'properties': {'ResetKVMMachineModificationStatusIdle': {'description': 'ResetKVMMachineModificationStatusIdle ' + 'sets ' + 'the ' + 'modification ' + 'status\n' + 'of a ' + 'kvm ' + 'machine ' + 'to ' + 'idle ' + 'if ' + 'it ' + 'is ' + 'in ' + 'an ' + 'error ' + 'state ' + 'before ' + 'upgrade.\n' + 'Related ' + 'to ' + 'lp:1829393.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'WriteAgentState': {'description': 'WriteAgentState writes the ' + 'agent state for the set of ' + 'units provided. This\n' + 'call presently deals with ' + 'the state for the unit ' + 'agent.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def ResetKVMMachineModificationStatusIdle(self, tag=None): + ''' + ResetKVMMachineModificationStatusIdle sets the modification status + of a kvm machine to idle if it is in an error state before upgrade. + Related to lp:1829393. + + tag : str + Returns -> ErrorResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSteps', + request='ResetKVMMachineModificationStatusIdle', + version=2, + params=_params) + _params['tag'] = tag reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def RemoveSecrets(self, args=None): + async def WriteAgentState(self, args=None): ''' - RemoveSecrets remove user secret. + WriteAgentState writes the agent state for the set of units provided. This + call presently deals with the state for the unit agent. - args : typing.Sequence[~DeleteSecretArg] + args : typing.Sequence[~SetUnitStateArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -782,8 +6235,8 @@ async def RemoveSecrets(self, args=None): # map input types to rpc msg _params = dict() - msg = dict(type='Secrets', - request='RemoveSecrets', + msg = dict(type='UpgradeSteps', + request='WriteAgentState', version=2, params=_params) _params['args'] = args @@ -792,58 +6245,98 @@ async def RemoveSecrets(self, args=None): - @ReturnMapping(ErrorResults) - async def RevokeSecret(self, applications=None, label=None, uri=None): - ''' - RevokeSecret revokes access to a user secret. +class VolumeAttachmentsWatcherFacade(Type): + name = 'VolumeAttachmentsWatcher' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvMachineStorageIdsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + - applications : typing.Sequence[str] - label : str - uri : str - Returns -> ErrorResults + @ReturnMapping(MachineStorageIdsWatchResult) + async def Next(self): ''' - if applications is not None and not isinstance(applications, (bytes, str, list)): - raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + 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. - if label is not None and not isinstance(label, (bytes, str)): - raise Exception("Expected label to be a str, received: {}".format(type(label))) - if uri is not None and not isinstance(uri, (bytes, str)): - raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + Returns -> MachineStorageIdsWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Secrets', - request='RevokeSecret', + msg = dict(type='VolumeAttachmentsWatcher', + request='Next', version=2, params=_params) - _params['applications'] = applications - _params['label'] = label - _params['uri'] = uri + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UpdateSecrets(self, args=None): + @ReturnMapping(None) + async def Stop(self): ''' - UpdateSecrets creates new secrets. + Stop stops the watcher. - args : typing.Sequence[~UpdateUserSecretArg] - Returns -> ErrorResults + + Returns -> None ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() - msg = dict(type='Secrets', - request='UpdateSecrets', + msg = dict(type='VolumeAttachmentsWatcher', + request='Stop', version=2, params=_params) - _params['args'] = args + reply = await self.rpc(msg) return reply + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + diff --git a/juju/client/_client3.py b/juju/client/_client3.py index 97b22d90..a44d6f35 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -204,65 +204,315 @@ async def RedirectInfo(self): -class AllWatcherFacade(Type): - name = 'AllWatcher' +class AgentFacade(Type): + name = 'Agent' version = 3 - schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False, - 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'}, - 'type': 'array'}}, - 'required': ['deltas'], + schema = {'definitions': {'AgentGetEntitiesResult': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'life': {'type': 'string'}}, + 'required': ['life', + 'jobs', + 'container-type'], + 'type': 'object'}, + 'AgentGetEntitiesResults': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/AgentGetEntitiesResult'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'IsMasterResult': {'additionalProperties': False, + 'properties': {'master': {'type': 'boolean'}}, + 'required': ['master'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StateServingInfo': {'additionalProperties': False, + 'properties': {'api-port': {'type': 'integer'}, + 'ca-private-key': {'type': 'string'}, + 'cert': {'type': 'string'}, + 'controller-api-port': {'type': 'integer'}, + 'private-key': {'type': 'string'}, + 'shared-secret': {'type': 'string'}, + 'state-port': {'type': 'integer'}, + 'system-identity': {'type': 'string'}}, + 'required': ['api-port', + 'state-port', + 'cert', + 'private-key', + 'ca-private-key', + 'shared-secret', + 'system-identity'], + 'type': 'object'}}, + 'properties': {'ClearReboot': {'description': 'ClearReboot will clear the ' + 'reboot flag on provided ' + 'machines, if it exists.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/AgentGetEntitiesResults'}}, + 'type': 'object'}, + 'IsMaster': {'properties': {'Result': {'$ref': '#/definitions/IsMasterResult'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateServingInfo': {'properties': {'Result': {'$ref': '#/definitions/StateServingInfo'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, 'type': 'object'}, - 'Delta': {'additionalProperties': False, - 'properties': {'entity': {'additionalProperties': True, - 'type': 'object'}, - 'removed': {'type': 'boolean'}}, - 'required': ['removed', 'entity'], - 'type': 'object'}}, - 'properties': {'Next': {'description': 'Next will return the current state of ' - 'everything on the first call\n' - 'and subsequent calls will', - 'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}}, - 'type': 'object'}, - 'Stop': {'description': 'Stop stops the watcher.', - 'type': 'object'}}, + 'WatchCredentials': {'description': 'WatchCredentials watches ' + 'for changes to the ' + 'specified credentials.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(AllWatcherNextResults) - async def Next(self): + @ReturnMapping(ErrorResults) + async def ClearReboot(self, entities=None): ''' - Next will return the current state of everything on the first call - and subsequent calls will + ClearReboot will clear the reboot flag on provided machines, if it exists. + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - Returns -> AllWatcherNextResults + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='ClearReboot', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): ''' + CloudSpec returns the model's cloud spec. + + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='AllWatcher', - request='Next', + msg = dict(type='Agent', + request='CloudSpec', version=3, params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='ControllerAPIInfoForModels', + version=3, + params=_params) + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): ''' - Stop stops the watcher. + ControllerConfig returns the controller's configuration. - Returns -> None + Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='AllWatcher', - request='Stop', + msg = dict(type='Agent', + request='ControllerConfig', version=3, params=_params) @@ -271,264 +521,80 @@ async def Stop(self): - async def rpc(self, msg): + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): ''' - Patch rpc method to add Id. + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult ''' - if not hasattr(self, 'Id'): - raise RuntimeError('Missing "Id" field') - msg['Id'] = id - from .facade import TypeEncoder - reply = await self.connection.rpc(msg, encoder=TypeEncoder) - return reply + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='GetCloudSpec', + version=3, + params=_params) + reply = await self.rpc(msg) + return reply -class BackupsFacade(Type): - name = 'Backups' - version = 3 - schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, - 'properties': {'no-download': {'type': 'boolean'}, - 'notes': {'type': 'string'}}, - 'required': ['notes', 'no-download'], - 'type': 'object'}, - 'BackupsMetadataResult': {'additionalProperties': False, - 'properties': {'base': {'type': 'string'}, - 'checksum': {'type': 'string'}, - 'checksum-format': {'type': 'string'}, - 'controller-machine-id': {'type': 'string'}, - 'controller-machine-inst-id': {'type': 'string'}, - 'controller-uuid': {'type': 'string'}, - 'filename': {'type': 'string'}, - 'finished': {'format': 'date-time', - 'type': 'string'}, - 'format-version': {'type': 'integer'}, - 'ha-nodes': {'type': 'integer'}, - 'hostname': {'type': 'string'}, - 'id': {'type': 'string'}, - 'machine': {'type': 'string'}, - 'model': {'type': 'string'}, - 'notes': {'type': 'string'}, - 'size': {'type': 'integer'}, - 'started': {'format': 'date-time', - 'type': 'string'}, - 'stored': {'format': 'date-time', - 'type': 'string'}, - 'version': {'$ref': '#/definitions/Number'}}, - 'required': ['id', - 'checksum', - 'checksum-format', - 'size', - 'stored', - 'started', - 'finished', - 'notes', - 'model', - 'machine', - 'hostname', - 'version', - 'base', - 'filename', - 'format-version', - 'controller-uuid', - 'controller-machine-id', - 'controller-machine-inst-id', - 'ha-nodes'], - 'type': 'object'}, - 'Number': {'additionalProperties': False, - 'properties': {'Build': {'type': 'integer'}, - 'Major': {'type': 'integer'}, - 'Minor': {'type': 'integer'}, - 'Patch': {'type': 'integer'}, - 'Tag': {'type': 'string'}}, - 'required': ['Major', - 'Minor', - 'Tag', - 'Patch', - 'Build'], - 'type': 'object'}}, - 'properties': {'Create': {'description': 'Create is the API method that ' - 'requests juju to create a new ' - 'backup\n' - 'of its state.', - 'properties': {'Params': {'$ref': '#/definitions/BackupsCreateArgs'}, - 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - @ReturnMapping(BackupsMetadataResult) - async def Create(self, no_download=None, notes=None): + @ReturnMapping(AgentGetEntitiesResults) + async def GetEntities(self, entities=None): ''' - Create is the API method that requests juju to create a new backup - of its state. + entities : typing.Sequence[~Entity] + Returns -> AgentGetEntitiesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - no_download : bool - notes : str - Returns -> BackupsMetadataResult + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='GetEntities', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IsMasterResult) + async def IsMaster(self): ''' - if no_download is not None and not isinstance(no_download, bool): - raise Exception("Expected no_download to be a bool, received: {}".format(type(no_download))) - if notes is not None and not isinstance(notes, (bytes, str)): - raise Exception("Expected notes to be a str, received: {}".format(type(notes))) + Returns -> IsMasterResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Backups', - request='Create', + msg = dict(type='Agent', + request='IsMaster', version=3, params=_params) - _params['no-download'] = no_download - _params['notes'] = notes + reply = await self.rpc(msg) return reply -class ModelConfigFacade(Type): - name = 'ModelConfig' - version = 3 - schema = {'definitions': {'ConfigValue': {'additionalProperties': False, - 'properties': {'source': {'type': 'string'}, - 'value': {'additionalProperties': True, - 'type': 'object'}}, - 'required': ['value', 'source'], - 'type': 'object'}, - 'Error': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'info': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'message': {'type': 'string'}}, - 'required': ['message', 'code'], - 'type': 'object'}, - 'GetConstraintsResults': {'additionalProperties': False, - 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['constraints'], - 'type': 'object'}, - 'ModelConfigResults': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, - 'ModelSLA': {'additionalProperties': False, - 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, - 'creds': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', - 'owner', - 'ModelSLAInfo', - 'creds'], - 'type': 'object'}, - 'ModelSLAInfo': {'additionalProperties': False, - 'properties': {'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', 'owner'], - 'type': 'object'}, - 'ModelSequencesResult': {'additionalProperties': False, - 'properties': {'sequences': {'patternProperties': {'.*': {'type': 'integer'}}, - 'type': 'object'}}, - 'required': ['sequences'], - 'type': 'object'}, - 'ModelSet': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, - 'ModelUnset': {'additionalProperties': False, - 'properties': {'keys': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['keys'], - 'type': 'object'}, - 'SetConstraints': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['application', 'constraints'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'Value': {'additionalProperties': False, - 'properties': {'allocate-public-ip': {'type': 'boolean'}, - 'arch': {'type': 'string'}, - 'container': {'type': 'string'}, - 'cores': {'type': 'integer'}, - 'cpu-power': {'type': 'integer'}, - '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': {'GetModelConstraints': {'description': 'GetModelConstraints ' - 'returns the ' - 'constraints for the ' - 'model.', - 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, - 'type': 'object'}, - 'ModelGet': {'description': 'ModelGet implements the ' - 'server-side part of the\n' - 'model-config CLI command.', - 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, - 'type': 'object'}, - 'ModelSet': {'description': 'ModelSet implements the ' - 'server-side part of the\n' - 'set-model-config CLI command.', - 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, - 'type': 'object'}, - 'ModelUnset': {'description': 'ModelUnset implements the ' - 'server-side part of the\n' - 'set-model-config CLI command.', - 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, - 'type': 'object'}, - 'SLALevel': {'description': 'SLALevel returns the current sla ' - 'level for the model.', - 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'Sequences': {'description': "Sequences returns the model's " - 'sequence names and next values.', - 'properties': {'Result': {'$ref': '#/definitions/ModelSequencesResult'}}, - 'type': 'object'}, - 'SetModelConstraints': {'description': 'SetModelConstraints ' - 'sets the constraints ' - 'for the model.', - 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, - 'type': 'object'}, - 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' - 'on the model.', - 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(GetConstraintsResults) - async def GetModelConstraints(self): + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): ''' - GetModelConstraints returns the constraints for the model. + ModelConfig returns the current model's configuration. - Returns -> GetConstraintsResults + Returns -> ModelConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='GetModelConstraints', + msg = dict(type='Agent', + request='ModelConfig', version=3, params=_params) @@ -537,110 +603,111 @@ async def GetModelConstraints(self): - @ReturnMapping(ModelConfigResults) - async def ModelGet(self): + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): ''' - ModelGet implements the server-side part of the - model-config CLI command. - + SetPasswords sets the given password for each supplied entity, if possible. - Returns -> ModelConfigResults + 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='ModelConfig', - request='ModelGet', + msg = dict(type='Agent', + request='SetPasswords', version=3, params=_params) - + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ModelSet(self, config=None): + @ReturnMapping(StateServingInfo) + async def StateServingInfo(self): ''' - ModelSet implements the server-side part of the - set-model-config CLI command. - config : typing.Mapping[str, typing.Any] - Returns -> None + Returns -> StateServingInfo ''' - if config is not None and not isinstance(config, dict): - raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='ModelSet', + msg = dict(type='Agent', + request='StateServingInfo', version=3, params=_params) - _params['config'] = config + reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ModelUnset(self, keys=None): + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): ''' - ModelUnset implements the server-side part of the - set-model-config CLI command. + WatchCloudSpecsChanges returns a watcher for cloud spec changes. - keys : typing.Sequence[str] - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - if keys is not None and not isinstance(keys, (bytes, str, list)): - raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='ModelUnset', + msg = dict(type='Agent', + request='WatchCloudSpecsChanges', version=3, params=_params) - _params['keys'] = keys + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def SLALevel(self): + @ReturnMapping(NotifyWatchResults) + async def WatchCredentials(self, entities=None): ''' - SLALevel returns the current sla level for the model. - + WatchCredentials watches for changes to the specified credentials. - Returns -> StringResult + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='SLALevel', + msg = dict(type='Agent', + request='WatchCredentials', version=3, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ModelSequencesResult) - async def Sequences(self): + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): ''' - Sequences returns the model's sequence names and next values. + 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 -> ModelSequencesResult + Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='Sequences', + msg = dict(type='Agent', + request='WatchForModelConfigChanges', version=3, params=_params) @@ -649,56 +716,2642 @@ async def Sequences(self): - @ReturnMapping(None) - async def SetModelConstraints(self, application=None, constraints=None): - ''' - SetModelConstraints sets the constraints for the model. +class AllWatcherFacade(Type): + name = 'AllWatcher' + version = 3 + schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False, + 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'}, + 'type': 'array'}}, + 'required': ['deltas'], + 'type': 'object'}, + 'Delta': {'additionalProperties': False, + 'properties': {'entity': {'additionalProperties': True, + 'type': 'object'}, + 'removed': {'type': 'boolean'}}, + 'required': ['removed', 'entity'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next will return the current state of ' + 'everything on the first call\n' + 'and subsequent calls will', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + - application : str - constraints : Value - Returns -> None + @ReturnMapping(AllWatcherNextResults) + async def Next(self): ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + Next will return the current state of everything on the first call + and subsequent calls will - if constraints is not None and not isinstance(constraints, (dict, Value)): - raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + Returns -> AllWatcherNextResults + ''' # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='SetModelConstraints', + msg = dict(type='AllWatcher', + request='Next', version=3, params=_params) - _params['application'] = application - _params['constraints'] = constraints + reply = await self.rpc(msg) return reply @ReturnMapping(None) - async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): + async def Stop(self): ''' - SetSLALevel sets the sla level on the model. + Stop stops the watcher. + - modelslainfo : ModelSLAInfo - creds : typing.Sequence[int] - level : str - owner : str Returns -> None ''' - if modelslainfo is not None and not isinstance(modelslainfo, (dict, ModelSLAInfo)): - raise Exception("Expected modelslainfo to be a ModelSLAInfo, received: {}".format(type(modelslainfo))) - - if creds is not None and not isinstance(creds, (bytes, str, list)): - raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) - - if level is not None and not isinstance(level, (bytes, str)): - raise Exception("Expected level to be a str, received: {}".format(type(level))) - - if owner is not None and not isinstance(owner, (bytes, str)): - raise Exception("Expected owner to be a str, received: {}".format(type(owner))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='AllWatcher', + request='Stop', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class BackupsFacade(Type): + name = 'Backups' + version = 3 + schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, + 'properties': {'no-download': {'type': 'boolean'}, + 'notes': {'type': 'string'}}, + 'required': ['notes', 'no-download'], + 'type': 'object'}, + 'BackupsMetadataResult': {'additionalProperties': False, + 'properties': {'base': {'type': 'string'}, + 'checksum': {'type': 'string'}, + 'checksum-format': {'type': 'string'}, + 'controller-machine-id': {'type': 'string'}, + 'controller-machine-inst-id': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'filename': {'type': 'string'}, + 'finished': {'format': 'date-time', + 'type': 'string'}, + 'format-version': {'type': 'integer'}, + 'ha-nodes': {'type': 'integer'}, + 'hostname': {'type': 'string'}, + 'id': {'type': 'string'}, + 'machine': {'type': 'string'}, + 'model': {'type': 'string'}, + 'notes': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'stored': {'format': 'date-time', + 'type': 'string'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['id', + 'checksum', + 'checksum-format', + 'size', + 'stored', + 'started', + 'finished', + 'notes', + 'model', + 'machine', + 'hostname', + 'version', + 'base', + 'filename', + 'format-version', + 'controller-uuid', + 'controller-machine-id', + 'controller-machine-inst-id', + 'ha-nodes'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}}, + 'properties': {'Create': {'description': 'Create is the API method that ' + 'requests juju to create a new ' + 'backup\n' + 'of its state.', + 'properties': {'Params': {'$ref': '#/definitions/BackupsCreateArgs'}, + 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BackupsMetadataResult) + async def Create(self, no_download=None, notes=None): + ''' + Create is the API method that requests juju to create a new backup + of its state. + + no_download : bool + notes : str + Returns -> BackupsMetadataResult + ''' + if no_download is not None and not isinstance(no_download, bool): + raise Exception("Expected no_download to be a bool, received: {}".format(type(no_download))) + + if notes is not None and not isinstance(notes, (bytes, str)): + raise Exception("Expected notes to be a str, received: {}".format(type(notes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Create', + version=3, + params=_params) + _params['no-download'] = no_download + _params['notes'] = notes + reply = await self.rpc(msg) + return reply + + + +class CrossModelRelationsFacade(Type): + name = 'CrossModelRelations' + version = 3 + schema = {'definitions': {'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'IngressNetworksChangeEvent': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'ingress-required': {'type': 'boolean'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'networks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token', + 'ingress-required'], + 'type': 'object'}, + 'IngressNetworksChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/IngressNetworksChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'OfferArg': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'offer-uuid': {'type': 'string'}}, + 'required': ['offer-uuid'], + 'type': 'object'}, + 'OfferArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/OfferArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'OfferStatusChange': {'additionalProperties': False, + 'properties': {'offer-name': {'type': 'string'}, + 'status': {'$ref': '#/definitions/EntityStatus'}}, + 'required': ['offer-name', 'status'], + 'type': 'object'}, + 'OfferStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'OfferStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OfferStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RegisterRemoteRelationArg': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'consume-version': {'type': 'integer'}, + 'local-endpoint-name': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'offer-uuid': {'type': 'string'}, + 'relation-token': {'type': 'string'}, + 'remote-endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, + 'remote-space': {'$ref': '#/definitions/RemoteSpace'}, + 'source-model-tag': {'type': 'string'}}, + 'required': ['application-token', + 'source-model-tag', + 'relation-token', + 'remote-endpoint', + 'remote-space', + 'offer-uuid', + 'local-endpoint-name'], + 'type': 'object'}, + 'RegisterRemoteRelationArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/RegisterRemoteRelationArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}, + 'RegisterRemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelationDetails'}}, + 'type': 'object'}, + 'RegisterRemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RegisterRemoteRelationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['key', + 'life', + 'suspended', + 'suspended-reason'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteEntityArg': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteEntityArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RemoteEntityArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RemoteRelationChangeEvent': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, + 'type': 'array'}, + 'departed-units': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'force-cleanup': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}, + 'unit-count': {'type': 'integer'}}, + 'required': ['relation-token', + 'application-token', + 'life', + 'unit-count'], + 'type': 'object'}, + 'RemoteRelationDetails': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RemoteRelationWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'SecretRevisionChange': {'additionalProperties': False, + 'properties': {'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', 'revision'], + 'type': 'object'}, + 'SecretRevisionWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRevisionChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'SecretRevisionWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SecretRevisionWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'WatchRemoteSecretChangesArg': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['application-token', + 'relation-token'], + 'type': 'object'}, + 'WatchRemoteSecretChangesArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/WatchRemoteSecretChangesArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}}, + 'properties': {'PublishIngressNetworkChanges': {'description': 'PublishIngressNetworkChanges ' + 'publishes ' + 'changes to ' + 'the required\n' + 'ingress ' + 'addresses to ' + 'the model ' + 'hosting the ' + 'offer in the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/IngressNetworksChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PublishRelationChanges': {'description': 'PublishRelationChanges ' + 'publishes relation ' + 'changes to the\n' + 'model hosting the ' + 'remote application ' + 'involved in the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RegisterRemoteRelations': {'description': 'RegisterRemoteRelations ' + 'sets up the model ' + 'to participate\n' + 'in the specified ' + 'relations. This ' + 'operation is ' + 'idempotent.', + 'properties': {'Params': {'$ref': '#/definitions/RegisterRemoteRelationArgs'}, + 'Result': {'$ref': '#/definitions/RegisterRemoteRelationResults'}}, + 'type': 'object'}, + 'WatchConsumedSecretsChanges': {'description': 'WatchConsumedSecretsChanges ' + 'returns a ' + 'watcher which ' + 'notifies of ' + 'changes to any ' + 'secrets\n' + 'for the ' + 'specified ' + 'remote ' + 'consumers.', + 'properties': {'Params': {'$ref': '#/definitions/WatchRemoteSecretChangesArgs'}, + 'Result': {'$ref': '#/definitions/SecretRevisionWatchResults'}}, + 'type': 'object'}, + 'WatchEgressAddressesForRelations': {'description': 'WatchEgressAddressesForRelations ' + 'creates a ' + 'watcher ' + 'that ' + 'notifies ' + 'when ' + 'addresses, ' + 'from ' + 'which\n' + 'connections ' + 'will ' + 'originate ' + 'for the ' + 'relation, ' + 'change.\n' + 'Each ' + 'event ' + 'contains ' + 'the ' + 'entire ' + 'set of ' + 'addresses ' + 'which are ' + 'required ' + 'for ' + 'ingress ' + 'for the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchOfferStatus': {'description': 'WatchOfferStatus starts ' + 'an OfferStatusWatcher ' + 'for\n' + 'watching the status of an ' + 'offer.', + 'properties': {'Params': {'$ref': '#/definitions/OfferArgs'}, + 'Result': {'$ref': '#/definitions/OfferStatusWatchResults'}}, + 'type': 'object'}, + 'WatchRelationChanges': {'description': 'WatchRelationChanges ' + 'starts a ' + 'RemoteRelationChangesWatcher ' + 'for each\n' + 'specified relation, ' + 'returning the watcher ' + 'IDs and initial ' + 'values,\n' + 'or an error if the ' + 'remote relations ' + "couldn't be watched.", + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RemoteRelationWatchResults'}}, + 'type': 'object'}, + 'WatchRelationsSuspendedStatus': {'description': 'WatchRelationsSuspendedStatus ' + 'starts a ' + 'RelationStatusWatcher ' + 'for\n' + 'watching the ' + 'life and ' + 'suspended ' + 'status of a ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RelationStatusWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def PublishIngressNetworkChanges(self, changes=None): + ''' + PublishIngressNetworkChanges publishes changes to the required + ingress addresses to the model hosting the offer in the relation. + + changes : typing.Sequence[~IngressNetworksChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishIngressNetworkChanges', + version=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def PublishRelationChanges(self, changes=None): + ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', + version=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RegisterRemoteRelationResults) + async def RegisterRemoteRelations(self, relations=None): + ''' + RegisterRemoteRelations sets up the model to participate + in the specified relations. This operation is idempotent. + + relations : typing.Sequence[~RegisterRemoteRelationArg] + Returns -> RegisterRemoteRelationResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='RegisterRemoteRelations', + version=3, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretRevisionWatchResults) + async def WatchConsumedSecretsChanges(self, relations=None): + ''' + WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets + for the specified remote consumers. + + relations : typing.Sequence[~WatchRemoteSecretChangesArg] + Returns -> SecretRevisionWatchResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchConsumedSecretsChanges', + version=3, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, args=None): + ''' + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchEgressAddressesForRelations', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OfferStatusWatchResults) + async def WatchOfferStatus(self, args=None): + ''' + WatchOfferStatus starts an OfferStatusWatcher for + watching the status of an offer. + + args : typing.Sequence[~OfferArg] + Returns -> OfferStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchOfferStatus', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationWatchResults) + async def WatchRelationChanges(self, args=None): + ''' + WatchRelationChanges starts a RemoteRelationChangesWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RemoteRelationWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationChanges', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationStatusWatchResults) + async def WatchRelationsSuspendedStatus(self, args=None): + ''' + WatchRelationsSuspendedStatus starts a RelationStatusWatcher for + watching the life and suspended status of a relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationsSuspendedStatus', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class ImageMetadataFacade(Type): + name = 'ImageMetadata' + version = 3 + schema = {'properties': {'UpdateFromPublishedImages': {'description': 'UpdateFromPublishedImages ' + 'is now a no-op.\n' + 'It is retained ' + 'for ' + 'compatibility.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def UpdateFromPublishedImages(self): + ''' + UpdateFromPublishedImages is now a no-op. + It is retained for compatibility. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadata', + request='UpdateFromPublishedImages', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class InstanceMutaterFacade(Type): + name = 'InstanceMutater' + version = 3 + schema = {'definitions': {'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmProfilingInfoResult': {'additionalProperties': False, + 'properties': {'current-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-id': {'type': 'string'}, + 'model-name': {'type': 'string'}, + 'profile-changes': {'items': {'$ref': '#/definitions/ProfileInfoResult'}, + 'type': 'array'}}, + 'required': ['instance-id', + 'model-name', + 'profile-changes', + 'current-profiles', + 'error'], + 'type': 'object'}, + 'ContainerTypeResult': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-type', + 'error'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProfileInfoResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'revision': {'type': 'integer'}}, + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'CharmProfilingInfo': {'description': 'CharmProfilingInfo ' + 'returns info to update ' + 'lxd profiles on the ' + 'machine. If\n' + 'the machine is not ' + 'provisioned, no profile ' + 'change info will be ' + 'returned,\n' + 'nor will an error.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/CharmProfilingInfoResult'}}, + 'type': 'object'}, + 'ContainerType': {'description': 'ContainerType returns the ' + 'container type of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/ContainerTypeResult'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'description': 'SetCharmProfiles records ' + 'the given slice of charm ' + 'profile names.', + 'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'description': 'SetModificationStatus ' + 'updates the instance ' + 'whilst changes are ' + 'occurring. This\n' + 'is different from ' + 'SetStatus and ' + 'SetInstanceStatus, ' + 'by the fact this ' + 'holds\n' + 'information about ' + 'the ongoing changes ' + 'that are happening ' + 'to instances.\n' + 'Consider LXD Profile ' + 'updates that can ' + 'modify a instance, ' + 'but may not cause\n' + 'the instance to be ' + 'placed into a error ' + 'state. This ' + 'modification status\n' + 'serves the purpose ' + 'of highlighting that ' + 'to the operator.\n' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchContainers': {'description': 'WatchContainers starts a ' + 'watcher to track ' + 'Containers on a given\n' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchLXDProfileVerificationNeeded': {'description': 'WatchLXDProfileVerificationNeeded ' + 'starts a ' + 'watcher ' + 'to track ' + 'Applications ' + 'with\n' + 'LXD ' + 'Profiles.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMachines': {'description': 'WatchMachines starts a ' + 'watcher to track machines.\n' + 'WatchMachines does not ' + 'consume the initial event of ' + 'the watch response, as\n' + 'that returns the initial set ' + 'of machines that are ' + 'currently available.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'starts a watcher to ' + 'track machines, but not ' + 'containers.\n' + 'WatchModelMachines does ' + 'not consume the initial ' + 'event of the watch ' + 'response, as\n' + 'that returns the ' + 'initial set of machines ' + 'that are currently ' + 'available.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CharmProfilingInfoResult) + async def CharmProfilingInfo(self, tag=None): + ''' + CharmProfilingInfo returns info to update lxd profiles on the machine. If + the machine is not provisioned, no profile change info will be returned, + nor will an error. + + tag : str + Returns -> CharmProfilingInfoResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='CharmProfilingInfo', + version=3, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerTypeResult) + async def ContainerType(self, tag=None): + ''' + ContainerType returns the container type of a machine. + + tag : str + Returns -> ContainerTypeResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='ContainerType', + version=3, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='Life', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): + ''' + SetCharmProfiles records the given slice of charm profile names. + + args : typing.Sequence[~SetProfileArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='SetCharmProfiles', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModificationStatus(self, entities=None): + ''' + SetModificationStatus updates the instance whilst changes are occurring. This + is different from SetStatus and SetInstanceStatus, by the fact this holds + information about the ongoing changes that are happening to instances. + Consider LXD Profile updates that can modify a instance, but may not cause + the instance to be placed into a error state. This modification status + serves the purpose of highlighting that to the operator. + Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='SetModificationStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchContainers(self, tag=None): + ''' + WatchContainers starts a watcher to track Containers on a given + machine. + + tag : str + Returns -> StringsWatchResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchContainers', + version=3, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLXDProfileVerificationNeeded(self, entities=None): + ''' + WatchLXDProfileVerificationNeeded starts a watcher to track Applications with + LXD Profiles. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchLXDProfileVerificationNeeded', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchMachines(self): + ''' + WatchMachines starts a watcher to track machines. + WatchMachines does not consume the initial event of the watch response, as + that returns the initial set of machines that are currently available. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchMachines', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + WatchModelMachines starts a watcher to track machines, but not containers. + WatchModelMachines does not consume the initial event of the watch response, as + that returns the initial set of machines that are currently available. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchModelMachines', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MigrationMasterFacade(Type): + name = 'MigrationMaster' + version = 3 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MasterMigrationStatus': {'additionalProperties': False, + 'properties': {'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'phase-changed-time': {'format': 'date-time', + 'type': 'string'}, + 'spec': {'$ref': '#/definitions/MigrationSpec'}}, + 'required': ['spec', + 'migration-id', + 'phase', + 'phase-changed-time'], + 'type': 'object'}, + 'MigrationModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'facade-versions': {'patternProperties': {'.*': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'type': 'object'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'name', + 'owner-tag', + 'agent-version', + 'controller-agent-version'], + 'type': 'object'}, + 'MigrationSourceInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'local-related-models': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['local-related-models', + 'controller-tag', + 'addrs', + 'ca-cert'], + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + 'type': 'object'}, + 'MinionReports': {'additionalProperties': False, + 'properties': {'failed': {'items': {'type': 'string'}, + 'type': 'array'}, + 'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'success-count': {'type': 'integer'}, + 'unknown-count': {'type': 'integer'}, + 'unknown-sample': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['migration-id', + 'phase', + 'success-count', + 'unknown-count', + 'unknown-sample', + 'failed'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'PrechecksArgs': {'additionalProperties': False, + 'properties': {'target-controller-version': {'$ref': '#/definitions/Number'}}, + 'required': ['target-controller-version'], + 'type': 'object'}, + 'ProcessRelations': {'additionalProperties': False, + 'properties': {'controller-alias': {'type': 'string'}}, + 'required': ['controller-alias'], + 'type': 'object'}, + 'SerializedModel': {'additionalProperties': False, + 'properties': {'bytes': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'charms': {'items': {'type': 'string'}, + 'type': 'array'}, + 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, + 'type': 'array'}, + 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, + 'type': 'array'}}, + 'required': ['bytes', + 'charms', + 'tools', + 'resources'], + 'type': 'object'}, + 'SerializedModelResource': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'name': {'type': 'string'}, + 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, + 'type': 'object'}}, + 'required': ['application', + 'name', + 'application-revision', + 'charmstore-revision', + 'unit-revisions'], + 'type': 'object'}, + 'SerializedModelResourceRevision': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['revision', + 'type', + 'path', + 'description', + 'origin', + 'fingerprint', + 'size', + 'timestamp'], + 'type': 'object'}, + 'SerializedModelTools': {'additionalProperties': False, + 'properties': {'uri': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', 'uri'], + 'type': 'object'}, + 'SetMigrationPhaseArgs': {'additionalProperties': False, + 'properties': {'phase': {'type': 'string'}}, + 'required': ['phase'], + 'type': 'object'}, + 'SetMigrationStatusMessageArgs': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}}, + 'required': ['message'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'Export': {'description': 'Export serializes the model ' + 'associated with the API connection.', + 'properties': {'Result': {'$ref': '#/definitions/SerializedModel'}}, + 'type': 'object'}, + 'MigrationStatus': {'description': 'MigrationStatus returns ' + 'the details and progress ' + 'of the latest\n' + 'model migration.', + 'properties': {'Result': {'$ref': '#/definitions/MasterMigrationStatus'}}, + 'type': 'object'}, + 'MinionReportTimeout': {'description': 'MinionReportTimeout ' + 'returns the ' + 'configuration value ' + 'for this controller ' + 'that\n' + 'indicates how long the ' + 'migration master ' + 'worker should wait for ' + 'minions to\n' + 'reported on phases of ' + 'a migration.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'MinionReports': {'description': 'MinionReports returns ' + 'details of the reports made ' + 'by migration\n' + 'minions to the controller ' + 'for the current migration ' + 'phase.', + 'properties': {'Result': {'$ref': '#/definitions/MinionReports'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns essential ' + 'information about the model to ' + 'be\n' + 'migrated.', + 'properties': {'Result': {'$ref': '#/definitions/MigrationModelInfo'}}, + 'type': 'object'}, + 'Prechecks': {'description': 'Prechecks performs pre-migration ' + 'checks on the model and\n' + '(source) controller.', + 'properties': {'Params': {'$ref': '#/definitions/PrechecksArgs'}}, + 'type': 'object'}, + 'ProcessRelations': {'description': 'ProcessRelations ' + 'processes any relations ' + 'that need updating after ' + 'an export.\n' + 'This should help fix any ' + 'remoteApplications that ' + 'have been migrated.', + 'properties': {'Params': {'$ref': '#/definitions/ProcessRelations'}}, + 'type': 'object'}, + 'Reap': {'description': 'Reap removes all documents for the ' + 'model associated with the API\n' + 'connection.', + 'type': 'object'}, + 'SetPhase': {'description': 'SetPhase sets the phase of the ' + 'active model migration. The ' + 'provided\n' + 'phase must be a valid phase ' + 'value, for example QUIESCE" or\n' + '"ABORT". See the core/migration ' + 'package for the complete list.', + 'properties': {'Params': {'$ref': '#/definitions/SetMigrationPhaseArgs'}}, + 'type': 'object'}, + 'SetStatusMessage': {'description': 'SetStatusMessage sets a ' + 'human readable status ' + 'message containing\n' + 'information about the ' + "migration's progress. " + 'This will be shown in\n' + 'status output shown to ' + 'the end user.', + 'properties': {'Params': {'$ref': '#/definitions/SetMigrationStatusMessageArgs'}}, + 'type': 'object'}, + 'SourceControllerInfo': {'description': 'SourceControllerInfo ' + 'returns the details ' + 'required to connect ' + 'to\n' + 'the source controller ' + 'for model migration.', + 'properties': {'Result': {'$ref': '#/definitions/MigrationSourceInfo'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts watching for an active ' + 'migration for the model\n' + 'associated with the API connection. ' + 'The returned id should be used\n' + 'with the NotifyWatcher facade to ' + 'receive events.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMinionReports': {'description': 'WatchMinionReports sets ' + 'up a watcher which ' + 'reports when a report\n' + 'for a migration minion ' + 'has arrived.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SerializedModel) + async def Export(self): + ''' + Export serializes the model associated with the API connection. + + + Returns -> SerializedModel + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Export', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MasterMigrationStatus) + async def MigrationStatus(self): + ''' + MigrationStatus returns the details and progress of the latest + model migration. + + + Returns -> MasterMigrationStatus + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MigrationStatus', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def MinionReportTimeout(self): + ''' + MinionReportTimeout returns the configuration value for this controller that + indicates how long the migration master worker should wait for minions to + reported on phases of a migration. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MinionReportTimeout', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MinionReports) + async def MinionReports(self): + ''' + MinionReports returns details of the reports made by migration + minions to the controller for the current migration phase. + + + Returns -> MinionReports + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MinionReports', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MigrationModelInfo) + async def ModelInfo(self): + ''' + ModelInfo returns essential information about the model to be + migrated. + + + Returns -> MigrationModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='ModelInfo', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prechecks(self, target_controller_version=None): + ''' + Prechecks performs pre-migration checks on the model and + (source) controller. + + target_controller_version : Number + Returns -> None + ''' + if target_controller_version is not None and not isinstance(target_controller_version, (dict, Number)): + raise Exception("Expected target_controller_version to be a Number, received: {}".format(type(target_controller_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Prechecks', + version=3, + params=_params) + _params['target-controller-version'] = target_controller_version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ProcessRelations(self, controller_alias=None): + ''' + ProcessRelations processes any relations that need updating after an export. + This should help fix any remoteApplications that have been migrated. + + controller_alias : str + Returns -> None + ''' + if controller_alias is not None and not isinstance(controller_alias, (bytes, str)): + raise Exception("Expected controller_alias to be a str, received: {}".format(type(controller_alias))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='ProcessRelations', + version=3, + params=_params) + _params['controller-alias'] = controller_alias + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Reap(self): + ''' + Reap removes all documents for the model associated with the API + connection. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Reap', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetPhase(self, phase=None): + ''' + SetPhase sets the phase of the active model migration. The provided + phase must be a valid phase value, for example QUIESCE" or + "ABORT". See the core/migration package for the complete list. + + phase : str + Returns -> None + ''' + if phase is not None and not isinstance(phase, (bytes, str)): + raise Exception("Expected phase to be a str, received: {}".format(type(phase))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='SetPhase', + version=3, + params=_params) + _params['phase'] = phase + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetStatusMessage(self, message=None): + ''' + SetStatusMessage sets a human readable status message containing + information about the migration's progress. This will be shown in + status output shown to the end user. + + message : str + Returns -> None + ''' + if message is not None and not isinstance(message, (bytes, str)): + raise Exception("Expected message to be a str, received: {}".format(type(message))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='SetStatusMessage', + version=3, + params=_params) + _params['message'] = message + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MigrationSourceInfo) + async def SourceControllerInfo(self): + ''' + SourceControllerInfo returns the details required to connect to + the source controller for model migration. + + + Returns -> MigrationSourceInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='SourceControllerInfo', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def Watch(self): + ''' + Watch starts watching for an active migration for the model + associated with the API connection. The returned id should be used + with the NotifyWatcher facade to receive events. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Watch', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMinionReports(self): + ''' + WatchMinionReports sets up a watcher which reports when a report + for a migration minion has arrived. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='WatchMinionReports', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MigrationTargetFacade(Type): + name = 'MigrationTarget' + version = 3 + schema = {'definitions': {'ActivateModelArgs': {'additionalProperties': False, + 'properties': {'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'cross-model-uuids': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'source-api-addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'source-ca-cert': {'type': 'string'}}, + 'required': ['model-tag', + 'controller-tag', + 'source-api-addrs', + 'source-ca-cert', + 'cross-model-uuids'], + 'type': 'object'}, + 'AdoptResourcesArgs': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'source-controller-version': {'$ref': '#/definitions/Number'}}, + 'required': ['model-tag', + 'source-controller-version'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MigrationModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'facade-versions': {'patternProperties': {'.*': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'type': 'object'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'name', + 'owner-tag', + 'agent-version', + 'controller-agent-version'], + 'type': 'object'}, + 'ModelArgs': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}}, + 'required': ['model-tag'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'SerializedModel': {'additionalProperties': False, + 'properties': {'bytes': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'charms': {'items': {'type': 'string'}, + 'type': 'array'}, + 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, + 'type': 'array'}, + 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, + 'type': 'array'}}, + 'required': ['bytes', + 'charms', + 'tools', + 'resources'], + 'type': 'object'}, + 'SerializedModelResource': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'name': {'type': 'string'}, + 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, + 'type': 'object'}}, + 'required': ['application', + 'name', + 'application-revision', + 'charmstore-revision', + 'unit-revisions'], + 'type': 'object'}, + 'SerializedModelResourceRevision': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['revision', + 'type', + 'path', + 'description', + 'origin', + 'fingerprint', + 'size', + 'timestamp'], + 'type': 'object'}, + 'SerializedModelTools': {'additionalProperties': False, + 'properties': {'uri': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', 'uri'], + 'type': 'object'}}, + 'properties': {'Abort': {'description': 'Abort removes the specified model ' + 'from the database. It is an error ' + 'to\n' + 'attempt to Abort a model that has a ' + 'migration mode other than importing.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, + 'type': 'object'}, + 'Activate': {'description': 'Activate sets the migration mode ' + 'of the model to "none", meaning ' + 'it\n' + 'is ready for use. It is an error ' + 'to attempt to Abort a model that\n' + 'has a migration mode other than ' + 'importing. It also adds any ' + 'required\n' + 'external controller records for ' + 'those controllers hosting offers ' + 'used\n' + 'by the model.', + 'properties': {'Params': {'$ref': '#/definitions/ActivateModelArgs'}}, + 'type': 'object'}, + 'AdoptResources': {'description': 'AdoptResources asks the ' + 'cloud provider to update ' + 'the controller\n' + "tags for a model's " + 'resources. This prevents ' + 'the resources from\n' + 'being destroyed if the ' + 'source controller is ' + 'destroyed after the\n' + 'model is migrated away.', + 'properties': {'Params': {'$ref': '#/definitions/AdoptResourcesArgs'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'CheckMachines': {'description': 'CheckMachines compares the ' + 'machines in state with the ' + 'ones reported\n' + 'by the provider and reports ' + 'any discrepancies.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Import': {'description': 'Import takes a serialized Juju ' + 'model, deserializes it, and\n' + 'recreates it in the receiving ' + 'controller.', + 'properties': {'Params': {'$ref': '#/definitions/SerializedModel'}}, + 'type': 'object'}, + 'LatestLogTime': {'description': 'LatestLogTime returns the ' + 'time of the most recent log ' + 'record\n' + 'received by the logtransfer ' + 'endpoint. This can be used ' + 'as the start\n' + 'point for streaming logs ' + 'from the source if the ' + 'transfer was\n' + 'interrupted.\n' + '\n' + 'For performance reasons, not ' + 'every time is tracked, so if ' + 'the\n' + 'target controller died ' + 'during the transfer the ' + 'latest log time\n' + 'might be up to 2 minutes ' + 'earlier. If the transfer was ' + 'interrupted\n' + 'in some other way (like the ' + 'source controller going away ' + 'or a\n' + 'network partition) the time ' + 'will be up-to-date.\n' + '\n' + 'Log messages are assumed to ' + 'be sent in time order (which ' + 'is how\n' + 'debug-log emits them). If ' + "that isn't the case then " + 'this mechanism\n' + "can't be used to avoid " + 'duplicates when logtransfer ' + 'is restarted.\n' + '\n' + 'Returns the zero time if no ' + 'logs have been transferred.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, + 'Result': {'format': 'date-time', + 'type': 'string'}}, + 'type': 'object'}, + 'Prechecks': {'description': 'Prechecks ensure that the target ' + 'controller is ready to accept a\n' + 'model migration.', + 'properties': {'Params': {'$ref': '#/definitions/MigrationModelInfo'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Abort(self, model_tag=None): + ''' + Abort removes the specified model from the database. It is an error to + attempt to Abort a model that has a migration mode other than importing. + + model_tag : str + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Abort', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Activate(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None): + ''' + Activate sets the migration mode of the model to "none", meaning it + is ready for use. It is an error to attempt to Abort a model that + has a migration mode other than importing. It also adds any required + external controller records for those controllers hosting offers used + by the model. + + controller_alias : str + controller_tag : str + cross_model_uuids : typing.Sequence[str] + model_tag : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + Returns -> None + ''' + if controller_alias is not None and not isinstance(controller_alias, (bytes, str)): + raise Exception("Expected controller_alias to be a str, received: {}".format(type(controller_alias))) + + if controller_tag is not None and not isinstance(controller_tag, (bytes, str)): + raise Exception("Expected controller_tag to be a str, received: {}".format(type(controller_tag))) + + if cross_model_uuids is not None and not isinstance(cross_model_uuids, (bytes, str, list)): + raise Exception("Expected cross_model_uuids to be a Sequence, received: {}".format(type(cross_model_uuids))) + + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_api_addrs is not None and not isinstance(source_api_addrs, (bytes, str, list)): + raise Exception("Expected source_api_addrs to be a Sequence, received: {}".format(type(source_api_addrs))) + + if source_ca_cert is not None and not isinstance(source_ca_cert, (bytes, str)): + raise Exception("Expected source_ca_cert to be a str, received: {}".format(type(source_ca_cert))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Activate', + version=3, + params=_params) + _params['controller-alias'] = controller_alias + _params['controller-tag'] = controller_tag + _params['cross-model-uuids'] = cross_model_uuids + _params['model-tag'] = model_tag + _params['source-api-addrs'] = source_api_addrs + _params['source-ca-cert'] = source_ca_cert + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AdoptResources(self, model_tag=None, source_controller_version=None): + ''' + AdoptResources asks the cloud provider to update the controller + tags for a model's resources. This prevents the resources from + being destroyed if the source controller is destroyed after the + model is migrated away. + + model_tag : str + source_controller_version : Number + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): + raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='AdoptResources', + version=3, + params=_params) + _params['model-tag'] = model_tag + _params['source-controller-version'] = source_controller_version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CACert', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CheckMachines(self, model_tag=None): + ''' + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str + Returns -> ErrorResults + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CheckMachines', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + ''' + Import takes a serialized Juju model, deserializes it, and + recreates it in the receiving controller. + + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] + Returns -> None + ''' + if bytes_ is not None and not isinstance(bytes_, (bytes, str, list)): + raise Exception("Expected bytes_ to be a Sequence, received: {}".format(type(bytes_))) + + if charms is not None and not isinstance(charms, (bytes, str, list)): + raise Exception("Expected charms to be a Sequence, received: {}".format(type(charms))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tools is not None and not isinstance(tools, (bytes, str, list)): + raise Exception("Expected tools to be a Sequence, received: {}".format(type(tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Import', + version=3, + params=_params) + _params['bytes'] = bytes_ + _params['charms'] = charms + _params['resources'] = resources + _params['tools'] = tools + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(str) + async def LatestLogTime(self, model_tag=None): + ''' + LatestLogTime returns the time of the most recent log record + received by the logtransfer endpoint. This can be used as the start + point for streaming logs from the source if the transfer was + interrupted. + + For performance reasons, not every time is tracked, so if the + target controller died during the transfer the latest log time + might be up to 2 minutes earlier. If the transfer was interrupted + in some other way (like the source controller going away or a + network partition) the time will be up-to-date. + + Log messages are assumed to be sent in time order (which is how + debug-log emits them). If that isn't the case then this mechanism + can't be used to avoid duplicates when logtransfer is restarted. + + Returns the zero time if no logs have been transferred. + + model_tag : str + Returns -> str + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='LatestLogTime', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prechecks(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None): + ''' + Prechecks ensure that the target controller is ready to accept a + model migration. + + agent_version : Number + controller_agent_version : Number + facade_versions : typing.Mapping[str, typing.Sequence[int]] + name : str + owner_tag : str + uuid : str + Returns -> None + ''' + if agent_version is not None and not isinstance(agent_version, (dict, Number)): + raise Exception("Expected agent_version to be a Number, received: {}".format(type(agent_version))) + + if controller_agent_version is not None and not isinstance(controller_agent_version, (dict, Number)): + raise Exception("Expected controller_agent_version to be a Number, received: {}".format(type(controller_agent_version))) + + if facade_versions is not None and not isinstance(facade_versions, dict): + raise Exception("Expected facade_versions to be a Mapping, received: {}".format(type(facade_versions))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if uuid is not None and not isinstance(uuid, (bytes, str)): + raise Exception("Expected uuid to be a str, received: {}".format(type(uuid))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Prechecks', + version=3, + params=_params) + _params['agent-version'] = agent_version + _params['controller-agent-version'] = controller_agent_version + _params['facade-versions'] = facade_versions + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['uuid'] = uuid + reply = await self.rpc(msg) + return reply + + + +class ModelConfigFacade(Type): + name = 'ModelConfig' + version = 3 + schema = {'definitions': {'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSequencesResult': {'additionalProperties': False, + 'properties': {'sequences': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}}, + 'required': ['sequences'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'GetModelConstraints': {'description': 'GetModelConstraints ' + 'returns the ' + 'constraints for the ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Sequences': {'description': "Sequences returns the model's " + 'sequence names and next values.', + 'properties': {'Result': {'$ref': '#/definitions/ModelSequencesResult'}}, + 'type': 'object'}, + 'SetModelConstraints': {'description': 'SetModelConstraints ' + 'sets the constraints ' + 'for the model.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): + ''' + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='GetModelConstraints', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def ModelGet(self): + ''' + ModelGet implements the server-side part of the + model-config CLI command. + + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelGet', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelSet(self, config=None): + ''' + ModelSet implements the server-side part of the + set-model-config CLI command. + + config : typing.Mapping[str, typing.Any] + Returns -> None + ''' + if config is not None and not isinstance(config, dict): + raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelSet', + version=3, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelUnset(self, keys=None): + ''' + ModelUnset implements the server-side part of the + set-model-config CLI command. + + keys : typing.Sequence[str] + Returns -> None + ''' + if keys is not None and not isinstance(keys, (bytes, str, list)): + raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelUnset', + version=3, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the current sla level for the model. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SLALevel', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelSequencesResult) + async def Sequences(self): + ''' + Sequences returns the model's sequence names and next values. + + + Returns -> ModelSequencesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='Sequences', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelConstraints(self, application=None, constraints=None): + ''' + SetModelConstraints sets the constraints for the model. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SetModelConstraints', + version=3, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): + ''' + SetSLALevel sets the sla level on the model. + + modelslainfo : ModelSLAInfo + creds : typing.Sequence[int] + level : str + owner : str + Returns -> None + ''' + if modelslainfo is not None and not isinstance(modelslainfo, (dict, ModelSLAInfo)): + raise Exception("Expected modelslainfo to be a ModelSLAInfo, received: {}".format(type(modelslainfo))) + + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + if level is not None and not isinstance(level, (bytes, str)): + raise Exception("Expected level to be a str, received: {}".format(type(level))) + + if owner is not None and not isinstance(owner, (bytes, str)): + raise Exception("Expected owner to be a str, received: {}".format(type(owner))) # map input types to rpc msg _params = dict() @@ -706,249 +3359,898 @@ async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=Non request='SetSLALevel', version=3, params=_params) - _params['ModelSLAInfo'] = modelslainfo - _params['creds'] = creds - _params['level'] = level - _params['owner'] = owner + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = await self.rpc(msg) + return reply + + + +class ResourcesFacade(Type): + name = 'Resources' + version = 3 + schema = {'definitions': {'AddPendingResourcesArgsV2': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'resources': {'items': {'$ref': '#/definitions/CharmResource'}, + 'type': 'array'}, + 'tag': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'url', + 'charm-origin', + 'macaroon', + 'resources'], + 'type': 'object'}, + 'AddPendingResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'pending-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'pending-ids'], + 'type': 'object'}, + 'Base': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'channel'], + 'type': 'object'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'base': {'$ref': '#/definitions/Base'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'source': {'type': 'string'}, + 'track': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['source', 'type', 'id'], + 'type': 'object'}, + 'CharmResource': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ListResourcesArgs': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Resource': {'additionalProperties': False, + 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, + 'application': {'type': 'string'}, + 'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'pending-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size', + 'CharmResource', + 'id', + 'pending-id', + 'application', + 'username', + 'timestamp'], + 'type': 'object'}, + 'ResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'charm-store-resources': {'items': {'$ref': '#/definitions/CharmResource'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resources': {'items': {'$ref': '#/definitions/Resource'}, + 'type': 'array'}, + 'unit-resources': {'items': {'$ref': '#/definitions/UnitResources'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'resources', + 'charm-store-resources', + 'unit-resources'], + 'type': 'object'}, + 'ResourcesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitResources': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'download-progress': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'resources': {'items': {'$ref': '#/definitions/Resource'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'resources', + 'download-progress'], + 'type': 'object'}}, + 'properties': {'AddPendingResources': {'description': 'AddPendingResources ' + 'adds the provided ' + 'resources (info) to ' + 'the Juju\n' + 'model in a pending ' + 'state, meaning they ' + 'are not available ' + 'until\n' + 'resolved. Handles ' + 'CharmHub and Local ' + 'charms.', + 'properties': {'Params': {'$ref': '#/definitions/AddPendingResourcesArgsV2'}, + 'Result': {'$ref': '#/definitions/AddPendingResourcesResult'}}, + 'type': 'object'}, + 'ListResources': {'description': 'ListResources returns the ' + 'list of resources for the ' + 'given application.', + 'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'}, + 'Result': {'$ref': '#/definitions/ResourcesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddPendingResourcesResult) + async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): + ''' + AddPendingResources adds the provided resources (info) to the Juju + model in a pending state, meaning they are not available until + resolved. Handles CharmHub and Local charms. + + entity : Entity + charm_origin : CharmOrigin + macaroon : Macaroon + resources : typing.Sequence[~CharmResource] + tag : str + url : str + Returns -> AddPendingResourcesResult + ''' + if entity is not None and not isinstance(entity, (dict, Entity)): + raise Exception("Expected entity to be a Entity, received: {}".format(type(entity))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Resources', + request='AddPendingResources', + version=3, + params=_params) + _params['Entity'] = entity + _params['charm-origin'] = charm_origin + _params['macaroon'] = macaroon + _params['resources'] = resources + _params['tag'] = tag + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResourcesResults) + async def ListResources(self, entities=None): + ''' + ListResources returns the list of resources for the given application. + + entities : typing.Sequence[~Entity] + Returns -> ResourcesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Resources', + request='ListResources', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class UpgradeSeriesFacade(Type): + name = 'UpgradeSeries' + version = 3 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinApplicationResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['application-name'], + 'type': 'object'}, + 'PinApplicationsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PinApplicationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinnedLeadershipResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateChannelArg': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'channel'], + 'type': 'object'}, + 'UpdateChannelArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateChannelArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesStartUnitCompletionParam': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'message': {'type': 'string'}}, + 'required': ['entities', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}, + 'target': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'CurrentSeries': {'description': 'CurrentSeries returns what ' + 'Juju thinks the current ' + 'series of the machine is.\n' + 'Note that a machine could ' + 'have been upgraded ' + 'out-of-band by running\n' + 'do-release-upgrade outside ' + 'of the upgrade-machine ' + 'workflow,\n' + 'making this value incorrect.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'FinishUpgradeSeries': {'description': 'FinishUpgradeSeries is ' + 'the last action in the ' + 'upgrade workflow and ' + 'is\n' + 'called after all ' + 'machine and unit ' + 'statuses are ' + '"completed".\n' + 'It updates the machine ' + 'series to reflect the ' + 'completed upgrade, ' + 'then\n' + 'removes the ' + 'upgrade-machine lock.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateChannelArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MachineStatus': {'description': 'MachineStatus gets the ' + 'current upgrade-machine ' + 'status of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'PinMachineApplications': {'description': 'PinMachineApplications ' + 'pins leadership for ' + 'applications ' + 'represented by ' + 'units\n' + 'running on the ' + "auth'd machine.", + 'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'PinnedLeadership': {'description': 'PinnedLeadership returns ' + 'all pinned applications ' + 'and the entities that\n' + 'require their pinned ' + 'behaviour, for leadership ' + 'in the current model.', + 'properties': {'Result': {'$ref': '#/definitions/PinnedLeadershipResult'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'description': 'SetInstanceStatus sets ' + 'the status of the ' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetMachineStatus': {'description': 'SetMachineStatus sets the ' + 'current upgrade-machine ' + 'status of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StartUnitCompletion': {'description': 'StartUnitCompletion ' + 'starts the upgrade ' + 'series completion ' + 'phase for all ' + 'subordinate\n' + 'units of a given ' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStartUnitCompletionParam'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'TargetSeries': {'description': 'TargetSeries returns the ' + 'series that a machine has ' + 'been locked\n' + 'for upgrading to.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'UnitsCompleted': {'description': 'UnitsCompleted returns the ' + 'units running on this ' + 'machine that have ' + 'completed\n' + 'the upgrade-machine ' + 'workflow and are in their ' + 'normal running state.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnitsPrepared': {'description': 'UnitsPrepared returns the ' + 'units running on this ' + 'machine that have completed\n' + 'their upgrade-machine ' + 'preparation, and are ready ' + 'to be stopped and have ' + 'their\n' + 'unit agent services ' + 'converted for the target ' + 'series.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnpinMachineApplications': {'description': 'UnpinMachineApplications ' + 'unpins leadership ' + 'for applications ' + 'represented by\n' + 'units running on ' + "the auth'd " + 'machine.', + 'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def CurrentSeries(self, entities=None): + ''' + CurrentSeries returns what Juju thinks the current series of the machine is. + Note that a machine could have been upgraded out-of-band by running + do-release-upgrade outside of the upgrade-machine workflow, + making this value incorrect. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='CurrentSeries', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishUpgradeSeries(self, args=None): + ''' + FinishUpgradeSeries is the last action in the upgrade workflow and is + called after all machine and unit statuses are "completed". + It updates the machine series to reflect the completed upgrade, then + removes the upgrade-machine lock. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='FinishUpgradeSeries', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def MachineStatus(self, entities=None): + ''' + MachineStatus gets the current upgrade-machine status of a machine. + + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='MachineStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def PinMachineApplications(self): + ''' + PinMachineApplications pins leadership for applications represented by units + running on the auth'd machine. + + + Returns -> PinApplicationsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='PinMachineApplications', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinnedLeadershipResult) + async def PinnedLeadership(self): + ''' + PinnedLeadership returns all pinned applications and the entities that + require their pinned behaviour, for leadership in the current model. + + + Returns -> PinnedLeadershipResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='PinnedLeadership', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + SetInstanceStatus sets the status of the machine. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='SetInstanceStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMachineStatus(self, params=None): + ''' + SetMachineStatus sets the current upgrade-machine status of a machine. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='SetMachineStatus', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='SetUpgradeSeriesUnitStatus', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def StartUnitCompletion(self, entities=None, message=None): + ''' + StartUnitCompletion starts the upgrade series completion phase for all subordinate + units of a given machine. + + entities : typing.Sequence[~Entity] + message : str + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if message is not None and not isinstance(message, (bytes, str)): + raise Exception("Expected message to be a str, received: {}".format(type(message))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='StartUnitCompletion', + version=3, + params=_params) + _params['entities'] = entities + _params['message'] = message + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def TargetSeries(self, entities=None): + ''' + TargetSeries returns the series that a machine has been locked + for upgrading to. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='TargetSeries', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(EntitiesResults) + async def UnitsCompleted(self, entities=None): + ''' + UnitsCompleted returns the units running on this machine that have completed + the upgrade-machine workflow and are in their normal running state. + + entities : typing.Sequence[~Entity] + Returns -> EntitiesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnitsCompleted', + version=3, + params=_params) + _params['entities'] = entities reply = await self.rpc(msg) return reply -class ResourcesFacade(Type): - name = 'Resources' - version = 3 - schema = {'definitions': {'AddPendingResourcesArgsV2': {'additionalProperties': False, - 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, - 'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'resources': {'items': {'$ref': '#/definitions/CharmResource'}, - 'type': 'array'}, - 'tag': {'type': 'string'}, - 'url': {'type': 'string'}}, - 'required': ['tag', - 'Entity', - 'url', - 'charm-origin', - 'macaroon', - 'resources'], - 'type': 'object'}, - 'AddPendingResourcesResult': {'additionalProperties': False, - 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, - 'error': {'$ref': '#/definitions/Error'}, - 'pending-ids': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['ErrorResult', - 'pending-ids'], - 'type': 'object'}, - 'Base': {'additionalProperties': False, - 'properties': {'channel': {'type': 'string'}, - 'name': {'type': 'string'}}, - 'required': ['name', 'channel'], - 'type': 'object'}, - 'CharmOrigin': {'additionalProperties': False, - 'properties': {'architecture': {'type': 'string'}, - 'base': {'$ref': '#/definitions/Base'}, - 'branch': {'type': 'string'}, - 'hash': {'type': 'string'}, - 'id': {'type': 'string'}, - 'instance-key': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'risk': {'type': 'string'}, - 'source': {'type': 'string'}, - 'track': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['source', 'type', 'id'], - 'type': 'object'}, - 'CharmResource': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'fingerprint': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'name': {'type': 'string'}, - 'origin': {'type': 'string'}, - 'path': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'type': {'type': 'string'}}, - 'required': ['name', - 'type', - 'path', - 'origin', - 'revision', - 'fingerprint', - 'size'], - 'type': 'object'}, - 'Entity': {'additionalProperties': False, - 'properties': {'tag': {'type': 'string'}}, - 'required': ['tag'], - 'type': 'object'}, - 'Error': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'info': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'message': {'type': 'string'}}, - 'required': ['message', 'code'], - 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'ListResourcesArgs': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'Resource': {'additionalProperties': False, - 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, - 'application': {'type': 'string'}, - 'description': {'type': 'string'}, - 'fingerprint': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'id': {'type': 'string'}, - 'name': {'type': 'string'}, - 'origin': {'type': 'string'}, - 'path': {'type': 'string'}, - 'pending-id': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'timestamp': {'format': 'date-time', - 'type': 'string'}, - 'type': {'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['name', - 'type', - 'path', - 'origin', - 'revision', - 'fingerprint', - 'size', - 'CharmResource', - 'id', - 'pending-id', - 'application', - 'username', - 'timestamp'], - 'type': 'object'}, - 'ResourcesResult': {'additionalProperties': False, - 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, - 'charm-store-resources': {'items': {'$ref': '#/definitions/CharmResource'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'resources': {'items': {'$ref': '#/definitions/Resource'}, - 'type': 'array'}, - 'unit-resources': {'items': {'$ref': '#/definitions/UnitResources'}, - 'type': 'array'}}, - 'required': ['ErrorResult', - 'resources', - 'charm-store-resources', - 'unit-resources'], - 'type': 'object'}, - 'ResourcesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'UnitResources': {'additionalProperties': False, - 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, - 'download-progress': {'patternProperties': {'.*': {'type': 'integer'}}, - 'type': 'object'}, - 'resources': {'items': {'$ref': '#/definitions/Resource'}, - 'type': 'array'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', - 'Entity', - 'resources', - 'download-progress'], - 'type': 'object'}}, - 'properties': {'AddPendingResources': {'description': 'AddPendingResources ' - 'adds the provided ' - 'resources (info) to ' - 'the Juju\n' - 'model in a pending ' - 'state, meaning they ' - 'are not available ' - 'until\n' - 'resolved. Handles ' - 'CharmHub and Local ' - 'charms.', - 'properties': {'Params': {'$ref': '#/definitions/AddPendingResourcesArgsV2'}, - 'Result': {'$ref': '#/definitions/AddPendingResourcesResult'}}, - 'type': 'object'}, - 'ListResources': {'description': 'ListResources returns the ' - 'list of resources for the ' - 'given application.', - 'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'}, - 'Result': {'$ref': '#/definitions/ResourcesResults'}}, - 'type': 'object'}}, - 'type': 'object'} - + @ReturnMapping(EntitiesResults) + async def UnitsPrepared(self, entities=None): + ''' + UnitsPrepared returns the units running on this machine that have completed + their upgrade-machine preparation, and are ready to be stopped and have their + unit agent services converted for the target series. - @ReturnMapping(AddPendingResourcesResult) - async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): + entities : typing.Sequence[~Entity] + Returns -> EntitiesResults ''' - AddPendingResources adds the provided resources (info) to the Juju - model in a pending state, meaning they are not available until - resolved. Handles CharmHub and Local charms. + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - entity : Entity - charm_origin : CharmOrigin - macaroon : Macaroon - resources : typing.Sequence[~CharmResource] - tag : str - url : str - Returns -> AddPendingResourcesResult + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnitsPrepared', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def UnpinMachineApplications(self): ''' - if entity is not None and not isinstance(entity, (dict, Entity)): - raise Exception("Expected entity to be a Entity, received: {}".format(type(entity))) + UnpinMachineApplications unpins leadership for applications represented by + units running on the auth'd machine. - if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): - raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) - if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): - raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + Returns -> PinApplicationsResults + ''' - if resources is not None and not isinstance(resources, (bytes, str, list)): - raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnpinMachineApplications', + version=3, + params=_params) - if tag is not None and not isinstance(tag, (bytes, str)): - raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + reply = await self.rpc(msg) + return reply - if url is not None and not isinstance(url, (bytes, str)): - raise Exception("Expected url to be a str, received: {}".format(type(url))) + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. + + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Resources', - request='AddPendingResources', + msg = dict(type='UpgradeSeries', + request='UpgradeSeriesUnitStatus', version=3, params=_params) - _params['Entity'] = entity - _params['charm-origin'] = charm_origin - _params['macaroon'] = macaroon - _params['resources'] = resources - _params['tag'] = tag - _params['url'] = url + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ResourcesResults) - async def ListResources(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): ''' - ListResources returns the list of resources for the given application. + WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. entities : typing.Sequence[~Entity] - Returns -> ResourcesResults + 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='Resources', - request='ListResources', + msg = dict(type='UpgradeSeries', + request='WatchUpgradeSeriesNotifications', version=3, params=_params) _params['entities'] = entities diff --git a/juju/client/_client4.py b/juju/client/_client4.py index 090bbf04..b313103c 100644 --- a/juju/client/_client4.py +++ b/juju/client/_client4.py @@ -663,41 +663,51 @@ async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): -class ModelGenerationFacade(Type): - name = 'ModelGeneration' +class InstancePollerFacade(Type): + name = 'InstancePoller' version = 4 - schema = {'definitions': {'BoolResult': {'additionalProperties': False, + schema = {'definitions': {'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'type': 'boolean'}}, 'required': ['result'], 'type': 'object'}, - 'BranchArg': {'additionalProperties': False, - 'properties': {'branch': {'type': 'string'}}, - 'required': ['branch'], - 'type': 'object'}, - 'BranchInfoArgs': {'additionalProperties': False, - 'properties': {'branches': {'items': {'type': 'string'}, - 'type': 'array'}, - 'detailed': {'type': 'boolean'}}, - 'required': ['branches', 'detailed'], - 'type': 'object'}, - 'BranchResults': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'generations': {'items': {'$ref': '#/definitions/Generation'}, - 'type': 'array'}}, - 'required': ['generations'], - 'type': 'object'}, - 'BranchTrackArg': {'additionalProperties': False, - 'properties': {'branch': {'type': 'string'}, - 'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}, - 'num-units': {'type': 'integer'}}, - 'required': ['branch', 'entities'], - 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, @@ -714,478 +724,2621 @@ class ModelGenerationFacade(Type): 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'Generation': {'additionalProperties': False, - 'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'}, - 'type': 'array'}, - 'branch': {'type': 'string'}, - 'completed': {'type': 'integer'}, - 'completed-by': {'type': 'string'}, - 'created': {'type': 'integer'}, - 'created-by': {'type': 'string'}, - 'generation-id': {'type': 'integer'}}, - 'required': ['branch', - 'created', - 'created-by', - 'applications'], + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], 'type': 'object'}, - 'GenerationApplication': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'pending': {'items': {'type': 'string'}, - 'type': 'array'}, - 'progress': {'type': 'string'}, - 'tracking': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['application', - 'progress', - 'config'], + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'MachineAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'MachineAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'origin': {'type': 'string'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-network-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'ProviderNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], 'type': 'object'}, - 'GenerationId': {'additionalProperties': False, - 'properties': {'generation-id': {'type': 'integer'}}, - 'required': ['generation-id'], + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetProviderNetworkConfig': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ProviderNetworkConfig'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetProviderNetworkConfigResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'modified': {'type': 'boolean'}}, + 'required': ['addresses', + 'modified'], + 'type': 'object'}, + 'SetProviderNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SetProviderNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], 'type': 'object'}, - 'GenerationResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'generation': {'$ref': '#/definitions/Generation'}}, - 'required': ['generation'], - 'type': 'object'}, - 'IntResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'integer'}}, - 'required': ['result'], - 'type': 'object'}}, - 'properties': {'AbortBranch': {'description': 'AbortBranch aborts the input ' - 'branch, marking it complete. ' - 'However no\n' - 'changes are made applicable to ' - 'the whole model. No units may ' - 'be assigned\n' - 'to the branch when aborting.', - 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, - 'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}, - 'AddBranch': {'description': 'AddBranch adds a new branch with ' - 'the input name to the model.', - 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, - 'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}, - 'BranchInfo': {'description': 'BranchInfo will return details ' - 'of branch identified by the ' - 'input argument,\n' - 'including units on the branch ' - 'and the configuration disjoint ' - 'with the\n' - 'master generation.\n' - 'An error is returned if no ' - 'in-flight branch matching in ' - 'input is found.', - 'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'}, - 'Result': {'$ref': '#/definitions/BranchResults'}}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned ' + 'returns whether ' + 'each given entity ' + 'is\n' + 'manually ' + 'provisioned or not. ' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, 'type': 'object'}, - 'CommitBranch': {'description': 'CommitBranch commits the ' - 'input branch, making its ' - 'changes applicable to\n' - 'the whole model and marking ' - 'it complete.', - 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, - 'Result': {'$ref': '#/definitions/IntResult'}}, - 'type': 'object'}, - 'HasActiveBranch': {'description': 'HasActiveBranch returns a ' - 'true result if the input ' - 'model has an "in-flight"\n' - 'branch matching the input ' - 'name.', - 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, - 'Result': {'$ref': '#/definitions/BoolResult'}}, - 'type': 'object'}, - 'ListCommits': {'description': 'ListCommits will return the ' - 'commits, hence only branches ' - 'with generation_id higher than ' - '0', - 'properties': {'Result': {'$ref': '#/definitions/BranchResults'}}, + 'InstanceStatus': {'description': 'InstanceStatus returns the ' + 'instance status for each ' + 'given entity.\n' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, 'type': 'object'}, - 'ShowCommit': {'description': 'ShowCommit will return details ' - 'a commit given by its ' - 'generationId\n' - 'An error is returned if either ' - 'no branch can be found ' - 'corresponding to the generation ' - 'id.\n' - 'Or the generation id given is ' - 'below 1.', - 'properties': {'Params': {'$ref': '#/definitions/GenerationId'}, - 'Result': {'$ref': '#/definitions/GenerationResult'}}, - 'type': 'object'}, - 'TrackBranch': {'description': 'TrackBranch marks the input ' - 'units and/or applications as ' - 'tracking the input\n' - 'branch, causing them to ' - 'realise changes made under ' - 'that branch.', - 'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, + 'ProviderAddresses': {'description': 'ProviderAddresses ' + 'returns the list of all ' + 'known provider ' + 'addresses\n' + 'for each given entity. ' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineAddressesResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'description': 'SetInstanceStatus ' + 'updates the instance ' + 'status for each given ' + 'entity.\n' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderAddresses': {'description': 'SetProviderAddresses ' + 'updates the list of ' + 'known provider ' + 'addresses\n' + 'for each given ' + 'entity. Only machine ' + 'tags are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'description': 'SetProviderNetworkConfig ' + 'updates the ' + 'provider ' + 'addresses for one ' + 'or more\n' + 'machines.\n' + '\n' + "What's more, if " + 'the client ' + 'request includes ' + 'provider-specific ' + 'IDs (e.g.\n' + 'network, subnet ' + 'or address IDs), ' + 'this method will ' + 'also iterate any ' + 'present\n' + 'link layer ' + 'devices (and ' + 'their addresses) ' + 'and merge in any ' + 'missing\n' + 'provider-specific ' + 'information.', + 'properties': {'Params': {'$ref': '#/definitions/SetProviderNetworkConfig'}, + 'Result': {'$ref': '#/definitions/SetProviderNetworkConfigResults'}}, + 'type': 'object'}, + 'Status': {'description': 'Status returns the status of each ' + 'given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(ErrorResult) - async def AbortBranch(self, branch=None): + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=None): ''' - AbortBranch aborts the input branch, marking it complete. However no - changes are made applicable to the whole model. No units may be assigned - to the branch when aborting. + AreManuallyProvisioned returns whether each given entity is + manually provisioned or not. Only machine tags are accepted. - branch : str - Returns -> ErrorResult + entities : typing.Sequence[~Entity] + Returns -> BoolResults ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='AbortBranch', + msg = dict(type='InstancePoller', + request='AreManuallyProvisioned', version=4, params=_params) - _params['branch'] = branch + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResult) - async def AddBranch(self, branch=None): + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): ''' - AddBranch adds a new branch with the input name to the model. + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. - branch : str - Returns -> ErrorResult + entities : typing.Sequence[~Entity] + Returns -> StringResults ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='AddBranch', + msg = dict(type='InstancePoller', + request='InstanceId', version=4, params=_params) - _params['branch'] = branch + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(BranchResults) - async def BranchInfo(self, branches=None, detailed=None): + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): ''' - BranchInfo will return details of branch identified by the input argument, - including units on the branch and the configuration disjoint with the - master generation. - An error is returned if no in-flight branch matching in input is found. + InstanceStatus returns the instance status for each given entity. + Only machine tags are accepted. - branches : typing.Sequence[str] - detailed : bool - Returns -> BranchResults + entities : typing.Sequence[~Entity] + Returns -> StatusResults ''' - if branches is not None and not isinstance(branches, (bytes, str, list)): - raise Exception("Expected branches to be a Sequence, received: {}".format(type(branches))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - if detailed is not None and not isinstance(detailed, bool): - raise Exception("Expected detailed to be a bool, received: {}".format(type(detailed))) + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='InstanceStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='BranchInfo', + msg = dict(type='InstancePoller', + request='Life', version=4, params=_params) - _params['branches'] = branches - _params['detailed'] = detailed + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='ModelConfig', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineAddressesResults) + async def ProviderAddresses(self, entities=None): + ''' + ProviderAddresses returns the list of all known provider addresses + for each given entity. Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> MachineAddressesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='ProviderAddresses', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + SetInstanceStatus updates the instance status for each given entity. + Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='SetInstanceStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderAddresses(self, machine_addresses=None): + ''' + SetProviderAddresses updates the list of known provider addresses + for each given entity. Only machine tags are accepted. + + machine_addresses : typing.Sequence[~MachineAddresses] + Returns -> ErrorResults + ''' + if machine_addresses is not None and not isinstance(machine_addresses, (bytes, str, list)): + raise Exception("Expected machine_addresses to be a Sequence, received: {}".format(type(machine_addresses))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='SetProviderAddresses', + version=4, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SetProviderNetworkConfigResults) + async def SetProviderNetworkConfig(self, args=None): + ''' + SetProviderNetworkConfig updates the provider addresses for one or more + machines. + + What's more, if the client request includes provider-specific IDs (e.g. + network, subnet or address IDs), this method will also iterate any present + link layer devices (and their addresses) and merge in any missing + provider-specific information. + + args : typing.Sequence[~ProviderNetworkConfig] + Returns -> SetProviderNetworkConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='SetProviderNetworkConfig', + version=4, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + Status returns the status of each given entity. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='Status', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchForModelConfigChanges', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachineStartTimes(self): + ''' + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchModelMachineStartTimes', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchModelMachines', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class ModelGenerationFacade(Type): + name = 'ModelGeneration' + version = 4 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BranchArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}}, + 'required': ['branch'], + 'type': 'object'}, + 'BranchInfoArgs': {'additionalProperties': False, + 'properties': {'branches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'detailed': {'type': 'boolean'}}, + 'required': ['branches', 'detailed'], + 'type': 'object'}, + 'BranchResults': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generations': {'items': {'$ref': '#/definitions/Generation'}, + 'type': 'array'}}, + 'required': ['generations'], + 'type': 'object'}, + 'BranchTrackArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}, + 'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'num-units': {'type': 'integer'}}, + 'required': ['branch', 'entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Generation': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'}, + 'type': 'array'}, + 'branch': {'type': 'string'}, + 'completed': {'type': 'integer'}, + 'completed-by': {'type': 'string'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}, + 'generation-id': {'type': 'integer'}}, + 'required': ['branch', + 'created', + 'created-by', + 'applications'], + 'type': 'object'}, + 'GenerationApplication': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'pending': {'items': {'type': 'string'}, + 'type': 'array'}, + 'progress': {'type': 'string'}, + 'tracking': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'progress', + 'config'], + 'type': 'object'}, + 'GenerationId': {'additionalProperties': False, + 'properties': {'generation-id': {'type': 'integer'}}, + 'required': ['generation-id'], + 'type': 'object'}, + 'GenerationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generation': {'$ref': '#/definitions/Generation'}}, + 'required': ['generation'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'AbortBranch': {'description': 'AbortBranch aborts the input ' + 'branch, marking it complete. ' + 'However no\n' + 'changes are made applicable to ' + 'the whole model. No units may ' + 'be assigned\n' + 'to the branch when aborting.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'AddBranch': {'description': 'AddBranch adds a new branch with ' + 'the input name to the model.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'BranchInfo': {'description': 'BranchInfo will return details ' + 'of branch identified by the ' + 'input argument,\n' + 'including units on the branch ' + 'and the configuration disjoint ' + 'with the\n' + 'master generation.\n' + 'An error is returned if no ' + 'in-flight branch matching in ' + 'input is found.', + 'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'}, + 'Result': {'$ref': '#/definitions/BranchResults'}}, + 'type': 'object'}, + 'CommitBranch': {'description': 'CommitBranch commits the ' + 'input branch, making its ' + 'changes applicable to\n' + 'the whole model and marking ' + 'it complete.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/IntResult'}}, + 'type': 'object'}, + 'HasActiveBranch': {'description': 'HasActiveBranch returns a ' + 'true result if the input ' + 'model has an "in-flight"\n' + 'branch matching the input ' + 'name.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/BoolResult'}}, + 'type': 'object'}, + 'ListCommits': {'description': 'ListCommits will return the ' + 'commits, hence only branches ' + 'with generation_id higher than ' + '0', + 'properties': {'Result': {'$ref': '#/definitions/BranchResults'}}, + 'type': 'object'}, + 'ShowCommit': {'description': 'ShowCommit will return details ' + 'a commit given by its ' + 'generationId\n' + 'An error is returned if either ' + 'no branch can be found ' + 'corresponding to the generation ' + 'id.\n' + 'Or the generation id given is ' + 'below 1.', + 'properties': {'Params': {'$ref': '#/definitions/GenerationId'}, + 'Result': {'$ref': '#/definitions/GenerationResult'}}, + 'type': 'object'}, + 'TrackBranch': {'description': 'TrackBranch marks the input ' + 'units and/or applications as ' + 'tracking the input\n' + 'branch, causing them to ' + 'realise changes made under ' + 'that branch.', + 'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def AbortBranch(self, branch=None): + ''' + AbortBranch aborts the input branch, marking it complete. However no + changes are made applicable to the whole model. No units may be assigned + to the branch when aborting. + + branch : str + Returns -> ErrorResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='AbortBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def AddBranch(self, branch=None): + ''' + AddBranch adds a new branch with the input name to the model. + + branch : str + Returns -> ErrorResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='AddBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BranchResults) + async def BranchInfo(self, branches=None, detailed=None): + ''' + BranchInfo will return details of branch identified by the input argument, + including units on the branch and the configuration disjoint with the + master generation. + An error is returned if no in-flight branch matching in input is found. + + branches : typing.Sequence[str] + detailed : bool + Returns -> BranchResults + ''' + if branches is not None and not isinstance(branches, (bytes, str, list)): + raise Exception("Expected branches to be a Sequence, received: {}".format(type(branches))) + + if detailed is not None and not isinstance(detailed, bool): + raise Exception("Expected detailed to be a bool, received: {}".format(type(detailed))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='BranchInfo', + version=4, + params=_params) + _params['branches'] = branches + _params['detailed'] = detailed + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResult) + async def CommitBranch(self, branch=None): + ''' + CommitBranch commits the input branch, making its changes applicable to + the whole model and marking it complete. + + branch : str + Returns -> IntResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='CommitBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResult) + async def HasActiveBranch(self, branch=None): + ''' + HasActiveBranch returns a true result if the input model has an "in-flight" + branch matching the input name. + + branch : str + Returns -> BoolResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='HasActiveBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BranchResults) + async def ListCommits(self): + ''' + ListCommits will return the commits, hence only branches with generation_id higher than 0 + + + Returns -> BranchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='ListCommits', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GenerationResult) + async def ShowCommit(self, generation_id=None): + ''' + ShowCommit will return details a commit given by its generationId + An error is returned if either no branch can be found corresponding to the generation id. + Or the generation id given is below 1. + + generation_id : int + Returns -> GenerationResult + ''' + if generation_id is not None and not isinstance(generation_id, int): + raise Exception("Expected generation_id to be a int, received: {}".format(type(generation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='ShowCommit', + version=4, + params=_params) + _params['generation-id'] = generation_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def TrackBranch(self, branch=None, entities=None, num_units=None): + ''' + TrackBranch marks the input units and/or applications as tracking the input + branch, causing them to realise changes made under that branch. + + branch : str + entities : typing.Sequence[~Entity] + num_units : int + Returns -> ErrorResults + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='TrackBranch', + version=4, + params=_params) + _params['branch'] = branch + _params['entities'] = entities + _params['num-units'] = num_units + reply = await self.rpc(msg) + return reply + + + +class SSHClientFacade(Type): + name = 'SSHClient' + version = 4 + schema = {'definitions': {'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + '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'}, + 'SSHAddressResult': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'SSHAddressResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'SSHAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHProxyResult': {'additionalProperties': False, + 'properties': {'use-proxy': {'type': 'boolean'}}, + 'required': ['use-proxy'], + 'type': 'object'}, + 'SSHPublicKeysResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'public-keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SSHPublicKeysResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AllAddresses': {'description': 'AllAddresses reports all ' + 'addresses that might have SSH ' + 'listening for each\n' + 'entity in args. The result is ' + 'sorted with public addresses ' + 'first.\n' + 'Machines and units are ' + 'supported as entity types.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressesResults'}}, + 'type': 'object'}, + 'ModelCredentialForSSH': {'description': 'ModelCredentialForSSH ' + 'returns a cloud spec ' + 'for ssh purpose.\n' + 'This facade call is ' + 'only used for k8s ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress reports the ' + 'preferred private network ' + 'address for one or\n' + 'more entities. Machines and ' + 'units are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'Proxy': {'description': 'Proxy returns whether SSH ' + 'connections should be proxied ' + 'through the\n' + 'controller hosts for the model ' + 'associated with the API connection.', + 'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress reports the ' + 'preferred public network ' + 'address for one\n' + 'or more entities. Machines ' + 'and units are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'PublicKeys': {'description': 'PublicKeys returns the public ' + 'SSH hosts for one or more\n' + 'entities. Machines and units ' + 'are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SSHAddressesResults) + async def AllAddresses(self, entities=None): + ''' + AllAddresses reports all addresses that might have SSH listening for each + entity in args. The result is sorted with public addresses first. + Machines and units are supported as entity types. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='AllAddresses', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def ModelCredentialForSSH(self): + ''' + ModelCredentialForSSH returns a cloud spec for ssh purpose. + This facade call is only used for k8s model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='ModelCredentialForSSH', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def PrivateAddress(self, entities=None): + ''' + PrivateAddress reports the preferred private network address for one or + more entities. Machines and units are supported. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='PrivateAddress', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHProxyResult) + async def Proxy(self): + ''' + Proxy returns whether SSH connections should be proxied through the + controller hosts for the model associated with the API connection. + + + Returns -> SSHProxyResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='Proxy', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def PublicAddress(self, entities=None): + ''' + PublicAddress reports the preferred public network address for one + or more entities. Machines and units are supported. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='PublicAddress', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHPublicKeysResults) + async def PublicKeys(self, entities=None): + ''' + PublicKeys returns the public SSH hosts for one or more + entities. Machines and units are supported. + + entities : typing.Sequence[~Entity] + Returns -> SSHPublicKeysResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='PublicKeys', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class StorageProvisionerFacade(Type): + name = 'StorageProvisioner' + version = 4 + schema = {'definitions': {'BlockDevice': {'additionalProperties': False, + 'properties': {'BusAddress': {'type': 'string'}, + 'DeviceLinks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'DeviceName': {'type': 'string'}, + 'FilesystemType': {'type': 'string'}, + 'HardwareId': {'type': 'string'}, + 'InUse': {'type': 'boolean'}, + 'Label': {'type': 'string'}, + 'MountPoint': {'type': 'string'}, + 'SerialId': {'type': 'string'}, + 'Size': {'type': 'integer'}, + 'UUID': {'type': 'string'}, + 'WWN': {'type': 'string'}}, + 'required': ['DeviceName', + 'DeviceLinks', + 'Label', + 'UUID', + 'HardwareId', + 'WWN', + 'BusAddress', + 'Size', + 'FilesystemType', + 'InUse', + 'MountPoint', + 'SerialId'], + 'type': 'object'}, + 'BlockDeviceResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/BlockDevice'}}, + 'required': ['result'], + 'type': 'object'}, + 'BlockDeviceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BlockDeviceResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Filesystem': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', 'info'], + 'type': 'object'}, + 'FilesystemAttachment': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemAttachmentInfo'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'machine-tag', + 'info'], + 'type': 'object'}, + 'FilesystemAttachmentInfo': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'FilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'filesystem-tag': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['filesystem-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'FilesystemAttachmentParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemAttachmentParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemAttachmentParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemAttachments': {'additionalProperties': False, + 'properties': {'filesystem-attachments': {'items': {'$ref': '#/definitions/FilesystemAttachment'}, + 'type': 'array'}}, + 'required': ['filesystem-attachments'], + 'type': 'object'}, + 'FilesystemInfo': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'required': ['filesystem-id', + 'pool', + 'size'], + 'type': 'object'}, + 'FilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/FilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'FilesystemParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Filesystem'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Filesystems': {'additionalProperties': False, + 'properties': {'filesystems': {'items': {'$ref': '#/definitions/Filesystem'}, + 'type': 'array'}}, + 'required': ['filesystems'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'MachineStorageIdsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveFilesystemParams': {'additionalProperties': False, + 'properties': {'destroy': {'type': 'boolean'}, + 'filesystem-id': {'type': 'string'}, + 'provider': {'type': 'string'}}, + 'required': ['provider', + 'filesystem-id'], + 'type': 'object'}, + 'RemoveFilesystemParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoveFilesystemParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'RemoveFilesystemParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoveFilesystemParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoveVolumeParams': {'additionalProperties': False, + 'properties': {'destroy': {'type': 'boolean'}, + 'provider': {'type': 'string'}, + 'volume-id': {'type': 'string'}}, + 'required': ['provider', 'volume-id'], + 'type': 'object'}, + 'RemoveVolumeParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoveVolumeParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'RemoveVolumeParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoveVolumeParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachment': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeAttachmentInfo'}, + 'machine-tag': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachmentParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachmentPlan': {'additionalProperties': False, + 'properties': {'block-device': {'$ref': '#/definitions/BlockDevice'}, + 'life': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'plan-info'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeAttachmentPlanResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachmentPlan'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentPlanResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentPlanResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachmentPlans': {'additionalProperties': False, + 'properties': {'volume-plans': {'items': {'$ref': '#/definitions/VolumeAttachmentPlan'}, + 'type': 'array'}}, + 'required': ['volume-plans'], + 'type': 'object'}, + 'VolumeAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachments': {'additionalProperties': False, + 'properties': {'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachment'}, + 'type': 'array'}}, + 'required': ['volume-attachments'], + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'VolumeParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Volume'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Volumes': {'additionalProperties': False, + 'properties': {'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['volumes'], + 'type': 'object'}}, + 'properties': {'AttachmentLife': {'description': 'AttachmentLife returns the ' + 'lifecycle state of each ' + 'specified machine\n' + 'storage attachment.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'CreateVolumeAttachmentPlans': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachmentPlans'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FilesystemAttachmentParams': {'description': 'FilesystemAttachmentParams ' + 'returns the ' + 'parameters for ' + 'creating the ' + 'filesystem\n' + 'attachments ' + 'with the ' + 'specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/FilesystemAttachmentParamsResults'}}, + 'type': 'object'}, + 'FilesystemAttachments': {'description': 'FilesystemAttachments ' + 'returns details of ' + 'filesystem ' + 'attachments with the ' + 'specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/FilesystemAttachmentResults'}}, + 'type': 'object'}, + 'FilesystemParams': {'description': 'FilesystemParams returns ' + 'the parameters for ' + 'creating the filesystems\n' + 'with the specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/FilesystemParamsResults'}}, + 'type': 'object'}, + 'Filesystems': {'description': 'Filesystems returns details of ' + 'filesystems with the specified ' + 'tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/FilesystemResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes volumes and ' + 'filesystems from state.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveAttachment': {'description': 'RemoveAttachment removes ' + 'the specified machine ' + 'storage attachments\n' + 'from state.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveFilesystemParams': {'description': 'RemoveFilesystemParams ' + 'returns the ' + 'parameters for ' + 'destroying or\n' + 'releasing the ' + 'filesystems with ' + 'the specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoveFilesystemParamsResults'}}, + 'type': 'object'}, + 'RemoveVolumeAttachmentPlan': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveVolumeParams': {'description': 'RemoveVolumeParams ' + 'returns the parameters ' + 'for destroying\n' + 'or releasing the ' + 'volumes with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoveVolumeParamsResults'}}, + 'type': 'object'}, + 'SetFilesystemAttachmentInfo': {'description': 'SetFilesystemAttachmentInfo ' + 'records the ' + 'details of ' + 'newly ' + 'provisioned ' + 'filesystem\n' + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/FilesystemAttachments'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetFilesystemInfo': {'description': 'SetFilesystemInfo ' + 'records the details of ' + 'newly provisioned ' + 'filesystems.', + 'properties': {'Params': {'$ref': '#/definitions/Filesystems'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeAttachmentInfo': {'description': 'SetVolumeAttachmentInfo ' + 'records the ' + 'details of newly ' + 'provisioned ' + 'volume\n' + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/VolumeAttachments'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeAttachmentPlanBlockInfo': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachmentPlans'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeInfo': {'description': 'SetVolumeInfo records the ' + 'details of newly provisioned ' + 'volumes.', + 'properties': {'Params': {'$ref': '#/definitions/Volumes'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'description': 'VolumeAttachmentParams ' + 'returns the ' + 'parameters for ' + 'creating the ' + 'volume\n' + 'attachments with ' + 'the specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentParamsResults'}}, + 'type': 'object'}, + 'VolumeAttachmentPlans': {'description': 'VolumeAttachmentPlans ' + 'returns details of ' + 'volume attachment ' + 'plans with the ' + 'specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentPlanResults'}}, + 'type': 'object'}, + 'VolumeAttachments': {'description': 'VolumeAttachments ' + 'returns details of ' + 'volume attachments with ' + 'the specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentResults'}}, + 'type': 'object'}, + 'VolumeBlockDevices': {'description': 'VolumeBlockDevices ' + 'returns details of the ' + 'block devices ' + 'corresponding to the\n' + 'volume attachments with ' + 'the specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/BlockDeviceResults'}}, + 'type': 'object'}, + 'VolumeParams': {'description': 'VolumeParams returns the ' + 'parameters for creating or ' + 'destroying\n' + 'the volumes with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VolumeParamsResults'}}, + 'type': 'object'}, + 'Volumes': {'description': 'Volumes returns details of volumes ' + 'with the specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VolumeResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch CAAS applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchBlockDevices': {'description': 'WatchBlockDevices ' + 'watches for changes to ' + "the specified machines' " + 'block devices.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchFilesystemAttachments': {'description': 'WatchFilesystemAttachments ' + 'watches for ' + 'changes to ' + 'filesystem ' + 'attachments\n' + 'scoped to the ' + 'entity with the ' + 'tag passed to ' + 'NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchFilesystems': {'description': 'WatchFilesystems watches ' + 'for changes to ' + 'filesystems scoped\n' + 'to the entity with the ' + 'tag passed to NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchMachines': {'description': 'WatchMachines watches for ' + 'changes to the specified ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchVolumeAttachmentPlans': {'description': 'WatchVolumeAttachmentPlans ' + 'watches for ' + 'changes to ' + 'volume ' + 'attachments for ' + 'a machine for ' + 'the purpose of ' + 'allowing\n' + 'that machine to ' + 'run any ' + 'initialization ' + 'needed, for ' + 'that volume to ' + 'actually appear ' + 'as a block ' + 'device (ie: ' + 'iSCSI)', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchVolumeAttachments': {'description': 'WatchVolumeAttachments ' + 'watches for changes ' + 'to volume ' + 'attachments scoped ' + 'to\n' + 'the entity with the ' + 'tag passed to ' + 'NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchVolumes': {'description': 'WatchVolumes watches for ' + 'changes to volumes scoped to ' + 'the\n' + 'entity with the tag passed to ' + 'NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LifeResults) + async def AttachmentLife(self, ids=None): + ''' + AttachmentLife returns the lifecycle state of each specified machine + storage attachment. + + ids : typing.Sequence[~MachineStorageId] + Returns -> LifeResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='AttachmentLife', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CreateVolumeAttachmentPlans(self, volume_plans=None): + ''' + volume_plans : typing.Sequence[~VolumeAttachmentPlan] + Returns -> ErrorResults + ''' + if volume_plans is not None and not isinstance(volume_plans, (bytes, str, list)): + raise Exception("Expected volume_plans to be a Sequence, received: {}".format(type(volume_plans))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='CreateVolumeAttachmentPlans', + version=4, + params=_params) + _params['volume-plans'] = volume_plans + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='EnsureDead', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentParamsResults) + async def FilesystemAttachmentParams(self, ids=None): + ''' + FilesystemAttachmentParams returns the parameters for creating the filesystem + attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> FilesystemAttachmentParamsResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='FilesystemAttachmentParams', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentResults) + async def FilesystemAttachments(self, ids=None): + ''' + FilesystemAttachments returns details of filesystem attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> FilesystemAttachmentResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='FilesystemAttachments', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemParamsResults) + async def FilesystemParams(self, entities=None): + ''' + FilesystemParams returns the parameters for creating the filesystems + with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> FilesystemParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='FilesystemParams', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemResults) + async def Filesystems(self, entities=None): + ''' + Filesystems returns details of filesystems with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> FilesystemResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Filesystems', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='InstanceId', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Life', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + Remove removes volumes and filesystems from state. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Remove', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveAttachment(self, ids=None): + ''' + RemoveAttachment removes the specified machine storage attachments + from state. + + ids : typing.Sequence[~MachineStorageId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveAttachment', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoveFilesystemParamsResults) + async def RemoveFilesystemParams(self, entities=None): + ''' + RemoveFilesystemParams returns the parameters for destroying or + releasing the filesystems with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> RemoveFilesystemParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveFilesystemParams', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveVolumeAttachmentPlan(self, ids=None): + ''' + ids : typing.Sequence[~MachineStorageId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveVolumeAttachmentPlan', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoveVolumeParamsResults) + async def RemoveVolumeParams(self, entities=None): + ''' + RemoveVolumeParams returns the parameters for destroying + or releasing the volumes with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> RemoveVolumeParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveVolumeParams', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetFilesystemAttachmentInfo(self, filesystem_attachments=None): + ''' + SetFilesystemAttachmentInfo records the details of newly provisioned filesystem + attachments. + + filesystem_attachments : typing.Sequence[~FilesystemAttachment] + Returns -> ErrorResults + ''' + if filesystem_attachments is not None and not isinstance(filesystem_attachments, (bytes, str, list)): + raise Exception("Expected filesystem_attachments to be a Sequence, received: {}".format(type(filesystem_attachments))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetFilesystemAttachmentInfo', + version=4, + params=_params) + _params['filesystem-attachments'] = filesystem_attachments + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetFilesystemInfo(self, filesystems=None): + ''' + SetFilesystemInfo records the details of newly provisioned filesystems. + + filesystems : typing.Sequence[~Filesystem] + Returns -> ErrorResults + ''' + if filesystems is not None and not isinstance(filesystems, (bytes, str, list)): + raise Exception("Expected filesystems to be a Sequence, received: {}".format(type(filesystems))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetFilesystemInfo', + version=4, + params=_params) + _params['filesystems'] = filesystems + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetVolumeAttachmentInfo(self, volume_attachments=None): + ''' + SetVolumeAttachmentInfo records the details of newly provisioned volume + attachments. + + volume_attachments : typing.Sequence[~VolumeAttachment] + Returns -> ErrorResults + ''' + if volume_attachments is not None and not isinstance(volume_attachments, (bytes, str, list)): + raise Exception("Expected volume_attachments to be a Sequence, received: {}".format(type(volume_attachments))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeAttachmentInfo', + version=4, + params=_params) + _params['volume-attachments'] = volume_attachments + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetVolumeAttachmentPlanBlockInfo(self, volume_plans=None): + ''' + volume_plans : typing.Sequence[~VolumeAttachmentPlan] + Returns -> ErrorResults + ''' + if volume_plans is not None and not isinstance(volume_plans, (bytes, str, list)): + raise Exception("Expected volume_plans to be a Sequence, received: {}".format(type(volume_plans))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeAttachmentPlanBlockInfo', + version=4, + params=_params) + _params['volume-plans'] = volume_plans + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetVolumeInfo(self, volumes=None): + ''' + SetVolumeInfo records the details of newly provisioned volumes. + + volumes : typing.Sequence[~Volume] + Returns -> ErrorResults + ''' + if volumes is not None and not isinstance(volumes, (bytes, str, list)): + raise Exception("Expected volumes to be a Sequence, received: {}".format(type(volumes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeInfo', + version=4, + params=_params) + _params['volumes'] = volumes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentParamsResults) + async def VolumeAttachmentParams(self, ids=None): + ''' + VolumeAttachmentParams returns the parameters for creating the volume + attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentParamsResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentParams', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentPlanResults) + async def VolumeAttachmentPlans(self, ids=None): + ''' + VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentPlanResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentPlans', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentResults) + async def VolumeAttachments(self, ids=None): + ''' + VolumeAttachments returns details of volume attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachments', + version=4, + params=_params) + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(IntResult) - async def CommitBranch(self, branch=None): + @ReturnMapping(BlockDeviceResults) + async def VolumeBlockDevices(self, ids=None): ''' - CommitBranch commits the input branch, making its changes applicable to - the whole model and marking it complete. + VolumeBlockDevices returns details of the block devices corresponding to the + volume attachments with the specified IDs. - branch : str - Returns -> IntResult + ids : typing.Sequence[~MachineStorageId] + Returns -> BlockDeviceResults ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + 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='ModelGeneration', - request='CommitBranch', + msg = dict(type='StorageProvisioner', + request='VolumeBlockDevices', version=4, params=_params) - _params['branch'] = branch + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(BoolResult) - async def HasActiveBranch(self, branch=None): + @ReturnMapping(VolumeParamsResults) + async def VolumeParams(self, entities=None): ''' - HasActiveBranch returns a true result if the input model has an "in-flight" - branch matching the input name. + VolumeParams returns the parameters for creating or destroying + the volumes with the specified tags. - branch : str - Returns -> BoolResult + entities : typing.Sequence[~Entity] + Returns -> VolumeParamsResults ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='HasActiveBranch', + msg = dict(type='StorageProvisioner', + request='VolumeParams', version=4, params=_params) - _params['branch'] = branch + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(BranchResults) - async def ListCommits(self): + @ReturnMapping(VolumeResults) + async def Volumes(self, entities=None): ''' - ListCommits will return the commits, hence only branches with generation_id higher than 0 - + Volumes returns details of volumes with the specified tags. - Returns -> BranchResults + entities : typing.Sequence[~Entity] + Returns -> VolumeResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='ListCommits', + msg = dict(type='StorageProvisioner', + request='Volumes', version=4, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(GenerationResult) - async def ShowCommit(self, generation_id=None): + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): ''' - ShowCommit will return details a commit given by its generationId - An error is returned if either no branch can be found corresponding to the generation id. - Or the generation id given is below 1. + WatchApplications starts a StringsWatcher to watch CAAS applications + deployed to this model. - generation_id : int - Returns -> GenerationResult + + Returns -> StringsWatchResult ''' - if generation_id is not None and not isinstance(generation_id, int): - raise Exception("Expected generation_id to be a int, received: {}".format(type(generation_id))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='ShowCommit', + msg = dict(type='StorageProvisioner', + request='WatchApplications', version=4, params=_params) - _params['generation-id'] = generation_id + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def TrackBranch(self, branch=None, entities=None, num_units=None): + @ReturnMapping(NotifyWatchResults) + async def WatchBlockDevices(self, entities=None): ''' - TrackBranch marks the input units and/or applications as tracking the input - branch, causing them to realise changes made under that branch. + WatchBlockDevices watches for changes to the specified machines' block devices. - branch : str entities : typing.Sequence[~Entity] - num_units : int - Returns -> ErrorResults + Returns -> NotifyWatchResults ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) - if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - if num_units is not None and not isinstance(num_units, int): - raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) - # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='TrackBranch', + msg = dict(type='StorageProvisioner', + request='WatchBlockDevices', version=4, params=_params) - _params['branch'] = branch _params['entities'] = entities - _params['num-units'] = num_units reply = await self.rpc(msg) return reply -class SSHClientFacade(Type): - name = 'SSHClient' - version = 4 - schema = {'definitions': {'CloudCredential': {'additionalProperties': False, - 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'auth-type': {'type': 'string'}, - 'redacted': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['auth-type'], - 'type': 'object'}, - 'CloudSpec': {'additionalProperties': False, - 'properties': {'cacertificates': {'items': {'type': 'string'}, - 'type': 'array'}, - 'credential': {'$ref': '#/definitions/CloudCredential'}, - 'endpoint': {'type': 'string'}, - 'identity-endpoint': {'type': 'string'}, - 'is-controller-cloud': {'type': 'boolean'}, - 'name': {'type': 'string'}, - 'region': {'type': 'string'}, - 'skip-tls-verify': {'type': 'boolean'}, - 'storage-endpoint': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['type', 'name'], - 'type': 'object'}, - 'CloudSpecResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/CloudSpec'}}, - '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'}, - 'SSHAddressResult': {'additionalProperties': False, - 'properties': {'address': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'SSHAddressResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SSHAddressesResult': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'type': 'string'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['addresses'], - 'type': 'object'}, - 'SSHAddressesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SSHProxyResult': {'additionalProperties': False, - 'properties': {'use-proxy': {'type': 'boolean'}}, - 'required': ['use-proxy'], - 'type': 'object'}, - 'SSHPublicKeysResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'public-keys': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'SSHPublicKeysResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'AllAddresses': {'description': 'AllAddresses reports all ' - 'addresses that might have SSH ' - 'listening for each\n' - 'entity in args. The result is ' - 'sorted with public addresses ' - 'first.\n' - 'Machines and units are ' - 'supported as entity types.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHAddressesResults'}}, - 'type': 'object'}, - 'ModelCredentialForSSH': {'description': 'ModelCredentialForSSH ' - 'returns a cloud spec ' - 'for ssh purpose.\n' - 'This facade call is ' - 'only used for k8s ' - 'model.', - 'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, - 'type': 'object'}, - 'PrivateAddress': {'description': 'PrivateAddress reports the ' - 'preferred private network ' - 'address for one or\n' - 'more entities. Machines and ' - 'units are supported.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, - 'type': 'object'}, - 'Proxy': {'description': 'Proxy returns whether SSH ' - 'connections should be proxied ' - 'through the\n' - 'controller hosts for the model ' - 'associated with the API connection.', - 'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}}, - 'type': 'object'}, - 'PublicAddress': {'description': 'PublicAddress reports the ' - 'preferred public network ' - 'address for one\n' - 'or more entities. Machines ' - 'and units are supported.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, - 'type': 'object'}, - 'PublicKeys': {'description': 'PublicKeys returns the public ' - 'SSH hosts for one or more\n' - 'entities. Machines and units ' - 'are supported.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(SSHAddressesResults) - async def AllAddresses(self, entities=None): + @ReturnMapping(MachineStorageIdsWatchResults) + async def WatchFilesystemAttachments(self, entities=None): ''' - AllAddresses reports all addresses that might have SSH listening for each - entity in args. The result is sorted with public addresses first. - Machines and units are supported as entity types. + WatchFilesystemAttachments watches for changes to filesystem attachments + scoped to the entity with the tag passed to NewState. entities : typing.Sequence[~Entity] - Returns -> SSHAddressesResults + Returns -> MachineStorageIdsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='SSHClient', - request='AllAddresses', + msg = dict(type='StorageProvisioner', + request='WatchFilesystemAttachments', version=4, params=_params) _params['entities'] = entities @@ -1194,44 +3347,45 @@ async def AllAddresses(self, entities=None): - @ReturnMapping(CloudSpecResult) - async def ModelCredentialForSSH(self): + @ReturnMapping(StringsWatchResults) + async def WatchFilesystems(self, entities=None): ''' - ModelCredentialForSSH returns a cloud spec for ssh purpose. - This facade call is only used for k8s model. - + WatchFilesystems watches for changes to filesystems scoped + to the entity with the tag passed to NewState. - Returns -> CloudSpecResult + 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='SSHClient', - request='ModelCredentialForSSH', + msg = dict(type='StorageProvisioner', + request='WatchFilesystems', version=4, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SSHAddressResults) - async def PrivateAddress(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchMachines(self, entities=None): ''' - PrivateAddress reports the preferred private network address for one or - more entities. Machines and units are supported. + WatchMachines watches for changes to the specified machines. entities : typing.Sequence[~Entity] - Returns -> SSHAddressResults + 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='SSHClient', - request='PrivateAddress', + msg = dict(type='StorageProvisioner', + request='WatchMachines', version=4, params=_params) _params['entities'] = entities @@ -1240,44 +3394,46 @@ async def PrivateAddress(self, entities=None): - @ReturnMapping(SSHProxyResult) - async def Proxy(self): + @ReturnMapping(MachineStorageIdsWatchResults) + async def WatchVolumeAttachmentPlans(self, entities=None): ''' - Proxy returns whether SSH connections should be proxied through the - controller hosts for the model associated with the API connection. - + WatchVolumeAttachmentPlans watches for changes to volume attachments for a machine for the purpose of allowing + that machine to run any initialization needed, for that volume to actually appear as a block device (ie: iSCSI) - Returns -> SSHProxyResult + entities : typing.Sequence[~Entity] + Returns -> MachineStorageIdsWatchResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='SSHClient', - request='Proxy', + msg = dict(type='StorageProvisioner', + request='WatchVolumeAttachmentPlans', version=4, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SSHAddressResults) - async def PublicAddress(self, entities=None): + @ReturnMapping(MachineStorageIdsWatchResults) + async def WatchVolumeAttachments(self, entities=None): ''' - PublicAddress reports the preferred public network address for one - or more entities. Machines and units are supported. + WatchVolumeAttachments watches for changes to volume attachments scoped to + the entity with the tag passed to NewState. entities : typing.Sequence[~Entity] - Returns -> SSHAddressResults + Returns -> MachineStorageIdsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='SSHClient', - request='PublicAddress', + msg = dict(type='StorageProvisioner', + request='WatchVolumeAttachments', version=4, params=_params) _params['entities'] = entities @@ -1286,22 +3442,22 @@ async def PublicAddress(self, entities=None): - @ReturnMapping(SSHPublicKeysResults) - async def PublicKeys(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchVolumes(self, entities=None): ''' - PublicKeys returns the public SSH hosts for one or more - entities. Machines and units are supported. + WatchVolumes watches for changes to volumes scoped to the + entity with the tag passed to NewState. entities : typing.Sequence[~Entity] - Returns -> SSHPublicKeysResults + 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='SSHClient', - request='PublicKeys', + msg = dict(type='StorageProvisioner', + request='WatchVolumes', version=4, params=_params) _params['entities'] = entities diff --git a/juju/client/_client5.py b/juju/client/_client5.py index f434e0ac..0ea7f5cb 100644 --- a/juju/client/_client5.py +++ b/juju/client/_client5.py @@ -5,6 +5,570 @@ from juju.client._definitions import * +class MachinerFacade(Type): + name = 'Machiner' + version = 5 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'JobsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['jobs'], + 'type': 'object'}, + 'JobsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/JobsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'origin': {'type': 'string'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-network-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RecordAgentStartInformationArg': {'additionalProperties': False, + 'properties': {'hostname': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'RecordAgentStartInformationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RecordAgentStartInformationArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Jobs': {'description': 'Jobs returns the jobs assigned to the ' + 'given entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/JobsResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'RecordAgentStartInformation': {'description': 'RecordAgentStartInformation ' + 'syncs the ' + 'machine model ' + 'with ' + 'information\n' + 'reported by a ' + 'machine agent ' + 'when it ' + 'starts.', + 'properties': {'Params': {'$ref': '#/definitions/RecordAgentStartInformationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RecordAgentStartTime': {'description': 'RecordAgentStartTime ' + 'updates the agent ' + 'start time field in ' + 'the machine doc.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetMachineAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'description': 'SetObservedNetworkConfig ' + 'reads the network ' + 'config for the ' + 'machine\n' + 'identified by the ' + 'input args.\n' + 'This config is ' + 'merged with the ' + 'new network ' + 'config supplied ' + 'in the\n' + 'same args and ' + 'updated if it has ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIAddresses', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIHostPorts', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='EnsureDead', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(JobsResults) + async def Jobs(self, entities=None): + ''' + Jobs returns the jobs assigned to the given entities. + + entities : typing.Sequence[~Entity] + Returns -> JobsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Jobs', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Life', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RecordAgentStartInformation(self, args=None): + ''' + RecordAgentStartInformation syncs the machine model with information + reported by a machine agent when it starts. + + args : typing.Sequence[~RecordAgentStartInformationArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='RecordAgentStartInformation', + version=5, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RecordAgentStartTime(self, entities=None): + ''' + RecordAgentStartTime updates the agent start time field in the machine doc. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='RecordAgentStartTime', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMachineAddresses(self, machine_addresses=None): + ''' + machine_addresses : typing.Sequence[~MachineAddresses] + Returns -> ErrorResults + ''' + if machine_addresses is not None and not isinstance(machine_addresses, (bytes, str, list)): + raise Exception("Expected machine_addresses to be a Sequence, received: {}".format(type(machine_addresses))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='SetMachineAddresses', + version=5, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(self, config=None, tag=None): + ''' + SetObservedNetworkConfig reads the network config for the machine + identified by the input args. + This config is merged with the new network config supplied in the + same args and updated if it has changed. + + config : typing.Sequence[~NetworkConfig] + tag : str + Returns -> None + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='SetObservedNetworkConfig', + version=5, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='SetStatus', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Watch', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='WatchAPIHostPorts', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + class SubnetsFacade(Type): name = 'Subnets' version = 5 diff --git a/juju/client/_client7.py b/juju/client/_client7.py index 74d82d18..7b54560a 100644 --- a/juju/client/_client7.py +++ b/juju/client/_client7.py @@ -2789,3 +2789,1178 @@ async def UserCredentials(self, user_clouds=None): return reply + +class FirewallerFacade(Type): + name = 'Firewaller' + version = 7 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ExposeInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ExposeInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ExposeInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ExposedEndpoint': {'additionalProperties': False, + 'properties': {'expose-to-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'expose-to-spaces': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FanConfigEntry': {'additionalProperties': False, + 'properties': {'overlay': {'type': 'string'}, + 'underlay': {'type': 'string'}}, + 'required': ['underlay', 'overlay'], + 'type': 'object'}, + 'IngressRule': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'source-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['port-range', 'source-cidrs'], + 'type': 'object'}, + 'IngressRulesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'rules': {'items': {'$ref': '#/definitions/IngressRule'}, + 'type': 'array'}}, + 'required': ['rules'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MacaroonResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Macaroon'}}, + 'type': 'object'}, + 'MacaroonResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MacaroonResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenMachinePortRangesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-port-ranges': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/OpenUnitPortRanges'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['unit-port-ranges'], + 'type': 'object'}, + 'OpenMachinePortRangesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OpenMachinePortRangesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenUnitPortRanges': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, + 'type': 'array'}, + 'subnet-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoint', + 'port-ranges', + 'subnet-cidrs'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SpaceInfo': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/SubnetV3'}, + 'type': 'array'}}, + 'required': ['id', 'name'], + 'type': 'object'}, + 'SpaceInfos': {'additionalProperties': False, + 'properties': {'space-infos': {'items': {'$ref': '#/definitions/SpaceInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SpaceInfosParams': {'additionalProperties': False, + 'properties': {'space-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetV2': {'additionalProperties': False, + 'properties': {'Subnet': {'$ref': '#/definitions/Subnet'}, + 'cidr': {'type': 'string'}, + 'id': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet'], + 'type': 'object'}, + 'SubnetV3': {'additionalProperties': False, + 'properties': {'Subnet': {'$ref': '#/definitions/Subnet'}, + 'SubnetV2': {'$ref': '#/definitions/SubnetV2'}, + 'cidr': {'type': 'string'}, + 'fan-info': {'$ref': '#/definitions/FanConfigEntry'}, + 'id': {'type': 'string'}, + 'is-public': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet', + 'SubnetV2', + 'space-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned ' + 'returns whether ' + 'each given entity ' + 'is\n' + 'manually ' + 'provisioned or not. ' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetAssignedMachine': {'description': 'GetAssignedMachine ' + 'returns the assigned ' + 'machine tag (if any) ' + 'for\n' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetExposeInfo': {'description': 'GetExposeInfo returns the ' + 'expose flag and per-endpoint ' + 'expose settings\n' + 'for the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ExposeInfoResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MacaroonForRelations': {'description': 'MacaroonForRelations ' + 'returns the macaroon ' + 'for the specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MacaroonResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelFirewallRules': {'description': 'ModelFirewallRules ' + 'returns the firewall ' + 'rules that this model ' + 'is\n' + 'configured to open', + 'properties': {'Result': {'$ref': '#/definitions/IngressRulesResult'}}, + 'type': 'object'}, + 'OpenedMachinePortRanges': {'description': 'OpenedMachinePortRanges ' + 'returns a list of ' + 'the opened port ' + 'ranges for the\n' + 'specified machines ' + 'where each result ' + 'is broken down by ' + 'unit. The list of\n' + 'opened ports for ' + 'each unit is ' + 'further grouped by ' + 'endpoint name and ' + 'includes\n' + 'the subnet CIDRs ' + 'that belong to the ' + 'space that each ' + 'endpoint is bound ' + 'to.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OpenMachinePortRangesResults'}}, + 'type': 'object'}, + 'SetRelationsStatus': {'description': 'SetRelationsStatus sets ' + 'the status for the ' + 'specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SpaceInfos': {'description': 'SpaceInfos returns a ' + 'comprehensive representation of ' + 'either all spaces or\n' + 'a filtered subset of the known ' + 'spaces and their associated ' + 'subnet details.', + 'properties': {'Params': {'$ref': '#/definitions/SpaceInfosParams'}, + 'Result': {'$ref': '#/definitions/SpaceInfos'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchEgressAddressesForRelations': {'description': 'WatchEgressAddressesForRelations ' + 'creates a ' + 'watcher ' + 'that ' + 'notifies ' + 'when ' + 'addresses, ' + 'from ' + 'which\n' + 'connections ' + 'will ' + 'originate ' + 'for the ' + 'relation, ' + 'change.\n' + 'Each ' + 'event ' + 'contains ' + 'the ' + 'entire ' + 'set of ' + 'addresses ' + 'which are ' + 'required ' + 'for ' + 'ingress ' + 'for the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchIngressAddressesForRelations': {'description': 'WatchIngressAddressesForRelations ' + 'creates ' + 'a ' + 'watcher ' + 'that ' + 'returns ' + 'the ' + 'ingress ' + 'networks\n' + 'that ' + 'have ' + 'been ' + 'recorded ' + 'against ' + 'the ' + 'specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchModelFirewallRules': {'description': 'WatchModelFirewallRules ' + 'returns a ' + 'NotifyWatcher that ' + 'notifies of\n' + 'potential changes ' + "to a model's " + 'configured ' + 'firewall rules', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchOpenedPorts': {'description': 'WatchOpenedPorts returns ' + 'a new StringsWatcher for ' + 'each given\n' + 'model tag.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchSubnets': {'description': 'WatchSubnets returns a new ' + 'StringsWatcher that watches ' + 'the specified\n' + 'subnet tags or all tags if no ' + 'entities are specified.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch all ' + 'units belonging to\n' + 'to any entity (machine or ' + 'service) passed in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=None): + ''' + AreManuallyProvisioned returns whether each given entity is + manually provisioned or not. Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='AreManuallyProvisioned', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): + ''' + CloudSpec returns the model's cloud spec. + + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='CloudSpec', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ControllerAPIInfoForModels', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ControllerConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetAssignedMachine(self, entities=None): + ''' + GetAssignedMachine returns the assigned machine tag (if any) for + each given unit. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetAssignedMachine', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetCloudSpec', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ExposeInfoResults) + async def GetExposeInfo(self, entities=None): + ''' + GetExposeInfo returns the expose flag and per-endpoint expose settings + for the specified applications. + + entities : typing.Sequence[~Entity] + Returns -> ExposeInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetExposeInfo', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='InstanceId', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='Life', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MacaroonResults) + async def MacaroonForRelations(self, entities=None): + ''' + MacaroonForRelations returns the macaroon for the specified relations. + + entities : typing.Sequence[~Entity] + Returns -> MacaroonResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='MacaroonForRelations', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ModelConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IngressRulesResult) + async def ModelFirewallRules(self): + ''' + ModelFirewallRules returns the firewall rules that this model is + configured to open + + + Returns -> IngressRulesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ModelFirewallRules', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenMachinePortRangesResults) + async def OpenedMachinePortRanges(self, entities=None): + ''' + OpenedMachinePortRanges returns a list of the opened port ranges for the + specified machines where each result is broken down by unit. The list of + opened ports for each unit is further grouped by endpoint name and includes + the subnet CIDRs that belong to the space that each endpoint is bound to. + + entities : typing.Sequence[~Entity] + Returns -> OpenMachinePortRangesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='OpenedMachinePortRanges', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsStatus(self, entities=None): + ''' + SetRelationsStatus sets the status for the specified relations. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='SetRelationsStatus', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SpaceInfos) + async def SpaceInfos(self, space_ids=None): + ''' + SpaceInfos returns a comprehensive representation of either all spaces or + a filtered subset of the known spaces and their associated subnet details. + + space_ids : typing.Sequence[str] + Returns -> SpaceInfos + ''' + if space_ids is not None and not isinstance(space_ids, (bytes, str, list)): + raise Exception("Expected space_ids to be a Sequence, received: {}".format(type(space_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='SpaceInfos', + version=7, + params=_params) + _params['space-ids'] = space_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='Watch', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchCloudSpecsChanges', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, entities=None): + ''' + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchEgressAddressesForRelations', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchForModelConfigChanges', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchIngressAddressesForRelations(self, entities=None): + ''' + WatchIngressAddressesForRelations creates a watcher that returns the ingress networks + that have been recorded against the specified relations. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchIngressAddressesForRelations', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchModelFirewallRules(self): + ''' + WatchModelFirewallRules returns a NotifyWatcher that notifies of + potential changes to a model's configured firewall rules + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelFirewallRules', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachineStartTimes(self): + ''' + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelMachineStartTimes', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelMachines', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchOpenedPorts(self, entities=None): + ''' + WatchOpenedPorts returns a new StringsWatcher for each given + model tag. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchOpenedPorts', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchSubnets(self, entities=None): + ''' + WatchSubnets returns a new StringsWatcher that watches the specified + subnet tags or all tags if no entities are specified. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchSubnets', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch all units belonging to + to any entity (machine or service) passed in args. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchUnits', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/_definitions.py b/juju/client/_definitions.py index 18395bba..eb862611 100644 --- a/juju/client/_definitions.py +++ b/juju/client/_definitions.py @@ -4,6 +4,24 @@ from juju.client.facade import Type, ReturnMapping +class APIHostPortsResult(Type): + _toSchema = {'servers': 'servers'} + _toPy = {'servers': 'servers'} + def __init__(self, servers=None, **unknown_fields): + ''' + servers : typing.Sequence[~HostPort] + ''' + servers_ = [HostPort.from_json(o) for o in servers or []] + + # Validate arguments against known Juju API types. + if servers_ is not None and not isinstance(servers_, (bytes, str, list)): + raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + + self.servers = servers_ + self.unknown_fields = unknown_fields + + + class AccessInfo(Type): _toSchema = {'role': 'role', 'scope_tag': 'scope-tag', 'target_tag': 'target-tag'} _toPy = {'role': 'role', 'scope-tag': 'scope_tag', 'target-tag': 'target_tag'} @@ -82,6 +100,60 @@ def __init__(self, execution_group=None, name=None, parallel=None, parameters=No +class ActionExecutionResult(Type): + _toSchema = {'action_tag': 'action-tag', 'message': 'message', 'results': 'results', 'status': 'status'} + _toPy = {'action-tag': 'action_tag', 'message': 'message', 'results': 'results', 'status': 'status'} + def __init__(self, action_tag=None, message=None, results=None, status=None, **unknown_fields): + ''' + action_tag : str + message : str + results : typing.Mapping[str, typing.Any] + status : str + ''' + action_tag_ = action_tag + message_ = message + results_ = results + status_ = status + + # Validate arguments against known Juju API types. + if action_tag_ is not None and not isinstance(action_tag_, (bytes, str)): + raise Exception("Expected action_tag_ to be a str, received: {}".format(type(action_tag_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if results_ is not None and not isinstance(results_, dict): + raise Exception("Expected results_ to be a Mapping, received: {}".format(type(results_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.action_tag = action_tag_ + self.message = message_ + self.results = results_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class ActionExecutionResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ActionExecutionResult] + ''' + results_ = [ActionExecutionResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + class ActionMessage(Type): _toSchema = {'message': 'message', 'timestamp': 'timestamp'} _toPy = {'message': 'message', 'timestamp': 'timestamp'} @@ -106,6 +178,48 @@ def __init__(self, message=None, timestamp=None, **unknown_fields): +class ActionMessageParams(Type): + _toSchema = {'messages': 'messages'} + _toPy = {'messages': 'messages'} + def __init__(self, messages=None, **unknown_fields): + ''' + messages : typing.Sequence[~EntityString] + ''' + messages_ = [EntityString.from_json(o) for o in messages or []] + + # Validate arguments against known Juju API types. + if messages_ is not None and not isinstance(messages_, (bytes, str, list)): + raise Exception("Expected messages_ to be a Sequence, received: {}".format(type(messages_))) + + self.messages = messages_ + self.unknown_fields = unknown_fields + + + +class ActionPruneArgs(Type): + _toSchema = {'max_history_mb': 'max-history-mb', 'max_history_time': 'max-history-time'} + _toPy = {'max-history-mb': 'max_history_mb', 'max-history-time': 'max_history_time'} + def __init__(self, max_history_mb=None, max_history_time=None, **unknown_fields): + ''' + max_history_mb : int + max_history_time : int + ''' + max_history_mb_ = max_history_mb + max_history_time_ = max_history_time + + # Validate arguments against known Juju API types. + if max_history_mb_ is not None and not isinstance(max_history_mb_, int): + raise Exception("Expected max_history_mb_ to be a int, received: {}".format(type(max_history_mb_))) + + if max_history_time_ is not None and not isinstance(max_history_time_, int): + raise Exception("Expected max_history_time_ to be a int, received: {}".format(type(max_history_time_))) + + self.max_history_mb = max_history_mb_ + self.max_history_time = max_history_time_ + self.unknown_fields = unknown_fields + + + class ActionResult(Type): _toSchema = {'action': 'action', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'log': 'log', 'message': 'message', 'output': 'output', 'started': 'started', 'status': 'status'} _toPy = {'action': 'action', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'log': 'log', 'message': 'message', 'output': 'output', 'started': 'started', 'status': 'status'} @@ -232,6 +346,102 @@ def __init__(self, actions=None, **unknown_fields): +class ActionsByReceiver(Type): + _toSchema = {'actions': 'actions', 'error': 'error', 'receiver': 'receiver'} + _toPy = {'actions': 'actions', 'error': 'error', 'receiver': 'receiver'} + def __init__(self, actions=None, error=None, receiver=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionResult] + error : Error + receiver : str + ''' + actions_ = [ActionResult.from_json(o) for o in actions or []] + error_ = Error.from_json(error) if error else None + receiver_ = receiver + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if receiver_ is not None and not isinstance(receiver_, (bytes, str)): + raise Exception("Expected receiver_ to be a str, received: {}".format(type(receiver_))) + + self.actions = actions_ + self.error = error_ + self.receiver = receiver_ + self.unknown_fields = unknown_fields + + + +class ActionsByReceivers(Type): + _toSchema = {'actions': 'actions'} + _toPy = {'actions': 'actions'} + def __init__(self, actions=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionsByReceiver] + ''' + actions_ = [ActionsByReceiver.from_json(o) for o in actions or []] + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + self.actions = actions_ + self.unknown_fields = unknown_fields + + + +class ActivateModelArgs(Type): + _toSchema = {'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'cross_model_uuids': 'cross-model-uuids', 'model_tag': 'model-tag', 'source_api_addrs': 'source-api-addrs', 'source_ca_cert': 'source-ca-cert'} + _toPy = {'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'cross-model-uuids': 'cross_model_uuids', 'model-tag': 'model_tag', 'source-api-addrs': 'source_api_addrs', 'source-ca-cert': 'source_ca_cert'} + def __init__(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None, **unknown_fields): + ''' + controller_alias : str + controller_tag : str + cross_model_uuids : typing.Sequence[str] + model_tag : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + ''' + controller_alias_ = controller_alias + controller_tag_ = controller_tag + cross_model_uuids_ = cross_model_uuids + model_tag_ = model_tag + source_api_addrs_ = source_api_addrs + source_ca_cert_ = source_ca_cert + + # Validate arguments against known Juju API types. + if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): + raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) + + if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): + raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) + + if cross_model_uuids_ is not None and not isinstance(cross_model_uuids_, (bytes, str, list)): + raise Exception("Expected cross_model_uuids_ to be a Sequence, received: {}".format(type(cross_model_uuids_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if source_api_addrs_ is not None and not isinstance(source_api_addrs_, (bytes, str, list)): + raise Exception("Expected source_api_addrs_ to be a Sequence, received: {}".format(type(source_api_addrs_))) + + if source_ca_cert_ is not None and not isinstance(source_ca_cert_, (bytes, str)): + raise Exception("Expected source_ca_cert_ to be a str, received: {}".format(type(source_ca_cert_))) + + self.controller_alias = controller_alias_ + self.controller_tag = controller_tag_ + self.cross_model_uuids = cross_model_uuids_ + self.model_tag = model_tag_ + self.source_api_addrs = source_api_addrs_ + self.source_ca_cert = source_ca_cert_ + self.unknown_fields = unknown_fields + + + class AddApplicationOffer(Type): _toSchema = {'application_description': 'application-description', 'application_name': 'application-name', 'endpoints': 'endpoints', 'model_tag': 'model-tag', 'offer_name': 'offer-name', 'owner_tag': 'owner-tag'} _toPy = {'application-description': 'application_description', 'application-name': 'application_name', 'endpoints': 'endpoints', 'model-tag': 'model_tag', 'offer-name': 'offer_name', 'owner-tag': 'owner_tag'} @@ -958,6 +1168,84 @@ def __init__(self, cidr=None, config_type=None, is_secondary=None, scope=None, s +class AdoptResourcesArgs(Type): + _toSchema = {'model_tag': 'model-tag', 'source_controller_version': 'source-controller-version'} + _toPy = {'model-tag': 'model_tag', 'source-controller-version': 'source_controller_version'} + def __init__(self, model_tag=None, source_controller_version=None, **unknown_fields): + ''' + model_tag : str + source_controller_version : Number + ''' + model_tag_ = model_tag + source_controller_version_ = Number.from_json(source_controller_version) if source_controller_version else None + + # Validate arguments against known Juju API types. + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if source_controller_version_ is not None and not isinstance(source_controller_version_, (dict, Number)): + raise Exception("Expected source_controller_version_ to be a Number, received: {}".format(type(source_controller_version_))) + + self.model_tag = model_tag_ + self.source_controller_version = source_controller_version_ + self.unknown_fields = unknown_fields + + + +class AgentGetEntitiesResult(Type): + _toSchema = {'container_type': 'container-type', 'error': 'error', 'jobs': 'jobs', 'life': 'life'} + _toPy = {'container-type': 'container_type', 'error': 'error', 'jobs': 'jobs', 'life': 'life'} + def __init__(self, container_type=None, error=None, jobs=None, life=None, **unknown_fields): + ''' + container_type : str + error : Error + jobs : typing.Sequence[str] + life : str + ''' + container_type_ = container_type + error_ = Error.from_json(error) if error else None + jobs_ = jobs + life_ = life + + # Validate arguments against known Juju API types. + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + self.container_type = container_type_ + self.error = error_ + self.jobs = jobs_ + self.life = life_ + self.unknown_fields = unknown_fields + + + +class AgentGetEntitiesResults(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~AgentGetEntitiesResult] + ''' + entities_ = [AgentGetEntitiesResult.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + class AllWatcherId(Type): _toSchema = {'watcher_id': 'watcher-id'} _toPy = {'watcher-id': 'watcher_id'} @@ -1060,6 +1348,48 @@ def __init__(self, annotations=None, **unknown_fields): +class ApplicationCharm(Type): + _toSchema = {'charm_modified_version': 'charm-modified-version', 'deployment_mode': 'deployment-mode', 'force_upgrade': 'force-upgrade', 'sha256': 'sha256', 'url': 'url'} + _toPy = {'charm-modified-version': 'charm_modified_version', 'deployment-mode': 'deployment_mode', 'force-upgrade': 'force_upgrade', 'sha256': 'sha256', 'url': 'url'} + def __init__(self, charm_modified_version=None, deployment_mode=None, force_upgrade=None, sha256=None, url=None, **unknown_fields): + ''' + charm_modified_version : int + deployment_mode : str + force_upgrade : bool + sha256 : str + url : str + ''' + charm_modified_version_ = charm_modified_version + deployment_mode_ = deployment_mode + force_upgrade_ = force_upgrade + sha256_ = sha256 + url_ = url + + # Validate arguments against known Juju API types. + if charm_modified_version_ is not None and not isinstance(charm_modified_version_, int): + raise Exception("Expected charm_modified_version_ to be a int, received: {}".format(type(charm_modified_version_))) + + if deployment_mode_ is not None and not isinstance(deployment_mode_, (bytes, str)): + raise Exception("Expected deployment_mode_ to be a str, received: {}".format(type(deployment_mode_))) + + if force_upgrade_ is not None and not isinstance(force_upgrade_, bool): + raise Exception("Expected force_upgrade_ to be a bool, received: {}".format(type(force_upgrade_))) + + if sha256_ is not None and not isinstance(sha256_, (bytes, str)): + raise Exception("Expected sha256_ to be a str, received: {}".format(type(sha256_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_modified_version = charm_modified_version_ + self.deployment_mode = deployment_mode_ + self.force_upgrade = force_upgrade_ + self.sha256 = sha256_ + self.url = url_ + self.unknown_fields = unknown_fields + + + class ApplicationCharmActionsResult(Type): _toSchema = {'actions': 'actions', 'application_tag': 'application-tag', 'error': 'error'} _toPy = {'actions': 'actions', 'application-tag': 'application_tag', 'error': 'error'} @@ -1168,34 +1498,76 @@ def __init__(self, charm_relations=None, **unknown_fields): -class ApplicationConfigUnsetArgs(Type): - _toSchema = {'args': 'Args'} - _toPy = {'Args': 'args'} - def __init__(self, args=None, **unknown_fields): +class ApplicationCharmResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - args : typing.Sequence[~ApplicationUnset] + error : Error + result : ApplicationCharm ''' - args_ = [ApplicationUnset.from_json(o) for o in args or []] + error_ = Error.from_json(error) if error else None + result_ = ApplicationCharm.from_json(result) if result else None # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.args = args_ + if result_ is not None and not isinstance(result_, (dict, ApplicationCharm)): + raise Exception("Expected result_ to be a ApplicationCharm, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class ApplicationConstraint(Type): - _toSchema = {'constraints': 'constraints', 'error': 'error'} - _toPy = {'constraints': 'constraints', 'error': 'error'} - def __init__(self, constraints=None, error=None, **unknown_fields): +class ApplicationCharmResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - constraints : Value - error : Error + results : typing.Sequence[~ApplicationCharmResult] ''' - constraints_ = Value.from_json(constraints) if constraints else None - error_ = Error.from_json(error) if error else None + results_ = [ApplicationCharmResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ApplicationConfigUnsetArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ApplicationUnset] + ''' + args_ = [ApplicationUnset.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class ApplicationConstraint(Type): + _toSchema = {'constraints': 'constraints', 'error': 'error'} + _toPy = {'constraints': 'constraints', 'error': 'error'} + def __init__(self, constraints=None, error=None, **unknown_fields): + ''' + constraints : Value + error : Error + ''' + constraints_ = Value.from_json(constraints) if constraints else None + error_ = Error.from_json(error) if error else None # Validate arguments against known Juju API types. if constraints_ is not None and not isinstance(constraints_, (dict, Value)): @@ -1864,6 +2236,72 @@ def __init__(self, results=None, **unknown_fields): +class ApplicationOpenedPorts(Type): + _toSchema = {'endpoint': 'endpoint', 'port_ranges': 'port-ranges'} + _toPy = {'endpoint': 'endpoint', 'port-ranges': 'port_ranges'} + def __init__(self, endpoint=None, port_ranges=None, **unknown_fields): + ''' + endpoint : str + port_ranges : typing.Sequence[~PortRange] + ''' + endpoint_ = endpoint + port_ranges_ = [PortRange.from_json(o) for o in port_ranges or []] + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if port_ranges_ is not None and not isinstance(port_ranges_, (bytes, str, list)): + raise Exception("Expected port_ranges_ to be a Sequence, received: {}".format(type(port_ranges_))) + + self.endpoint = endpoint_ + self.port_ranges = port_ranges_ + self.unknown_fields = unknown_fields + + + +class ApplicationOpenedPortsResult(Type): + _toSchema = {'application_port_ranges': 'application-port-ranges', 'error': 'error'} + _toPy = {'application-port-ranges': 'application_port_ranges', 'error': 'error'} + def __init__(self, application_port_ranges=None, error=None, **unknown_fields): + ''' + application_port_ranges : typing.Sequence[~ApplicationOpenedPorts] + error : Error + ''' + application_port_ranges_ = [ApplicationOpenedPorts.from_json(o) for o in application_port_ranges or []] + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if application_port_ranges_ is not None and not isinstance(application_port_ranges_, (bytes, str, list)): + raise Exception("Expected application_port_ranges_ to be a Sequence, received: {}".format(type(application_port_ranges_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.application_port_ranges = application_port_ranges_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ApplicationOpenedPortsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationOpenedPortsResult] + ''' + results_ = [ApplicationOpenedPortsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + class ApplicationResult(Type): _toSchema = {'base': 'base', 'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints', 'life': 'life', 'principal': 'principal', 'remote': 'remote', 'tag': 'tag'} _toPy = {'base': 'base', 'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints', 'life': 'life', 'principal': 'principal', 'remote': 'remote', 'tag': 'tag'} @@ -2164,6 +2602,72 @@ def __init__(self, base=None, can_upgrade_to=None, charm=None, charm_channel=Non +class ApplicationStatusResult(Type): + _toSchema = {'application': 'application', 'error': 'error', 'units': 'units'} + _toPy = {'application': 'application', 'error': 'error', 'units': 'units'} + def __init__(self, application=None, error=None, units=None, **unknown_fields): + ''' + application : StatusResult + error : Error + units : typing.Mapping[str, ~StatusResult] + ''' + application_ = StatusResult.from_json(application) if application else None + error_ = Error.from_json(error) if error else None + units_ = {k: StatusResult.from_json(v) for k, v in (units or dict()).items()} + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (dict, StatusResult)): + raise Exception("Expected application_ to be a StatusResult, received: {}".format(type(application_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if units_ is not None and not isinstance(units_, dict): + raise Exception("Expected units_ to be a Mapping, received: {}".format(type(units_))) + + self.application = application_ + self.error = error_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class ApplicationStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationStatusResult] + ''' + results_ = [ApplicationStatusResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ApplicationTag(Type): + _toSchema = {'name': 'Name'} + _toPy = {'Name': 'name'} + def __init__(self, name=None, **unknown_fields): + ''' + name : str + ''' + name_ = name + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.name = name_ + self.unknown_fields = unknown_fields + + + class ApplicationUnexpose(Type): _toSchema = {'application': 'application', 'exposed_endpoints': 'exposed-endpoints'} _toPy = {'application': 'application', 'exposed-endpoints': 'exposed_endpoints'} @@ -2188,6 +2692,96 @@ def __init__(self, application=None, exposed_endpoints=None, **unknown_fields): +class ApplicationUnitInfo(Type): + _toSchema = {'provider_id': 'provider-id', 'unit_tag': 'unit-tag'} + _toPy = {'provider-id': 'provider_id', 'unit-tag': 'unit_tag'} + def __init__(self, provider_id=None, unit_tag=None, **unknown_fields): + ''' + provider_id : str + unit_tag : str + ''' + provider_id_ = provider_id + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.provider_id = provider_id_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class ApplicationUnitParams(Type): + _toSchema = {'address': 'address', 'data': 'data', 'filesystem_info': 'filesystem-info', 'info': 'info', 'ports': 'ports', 'provider_id': 'provider-id', 'stateful': 'stateful', 'status': 'status', 'unit_tag': 'unit-tag'} + _toPy = {'address': 'address', 'data': 'data', 'filesystem-info': 'filesystem_info', 'info': 'info', 'ports': 'ports', 'provider-id': 'provider_id', 'stateful': 'stateful', 'status': 'status', 'unit-tag': 'unit_tag'} + def __init__(self, address=None, data=None, filesystem_info=None, info=None, ports=None, provider_id=None, stateful=None, status=None, unit_tag=None, **unknown_fields): + ''' + address : str + data : typing.Mapping[str, typing.Any] + filesystem_info : typing.Sequence[~KubernetesFilesystemInfo] + info : str + ports : typing.Sequence[str] + provider_id : str + stateful : bool + status : str + unit_tag : str + ''' + address_ = address + data_ = data + filesystem_info_ = [KubernetesFilesystemInfo.from_json(o) for o in filesystem_info or []] + info_ = info + ports_ = ports + provider_id_ = provider_id + stateful_ = stateful + status_ = status + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if filesystem_info_ is not None and not isinstance(filesystem_info_, (bytes, str, list)): + raise Exception("Expected filesystem_info_ to be a Sequence, received: {}".format(type(filesystem_info_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if ports_ is not None and not isinstance(ports_, (bytes, str, list)): + raise Exception("Expected ports_ to be a Sequence, received: {}".format(type(ports_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if stateful_ is not None and not isinstance(stateful_, bool): + raise Exception("Expected stateful_ to be a bool, received: {}".format(type(stateful_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.address = address_ + self.data = data_ + self.filesystem_info = filesystem_info_ + self.info = info_ + self.ports = ports_ + self.provider_id = provider_id_ + self.stateful = stateful_ + self.status = status_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + class ApplicationUnset(Type): _toSchema = {'application': 'application', 'branch': 'branch', 'options': 'options'} _toPy = {'application': 'application', 'branch': 'branch', 'options': 'options'} @@ -2572,23 +3166,107 @@ def __init__(self, id_=None, message=None, tag=None, type_=None, **unknown_field -class BlockResult(Type): +class BlockDevice(Type): + _toSchema = {'busaddress': 'BusAddress', 'devicelinks': 'DeviceLinks', 'devicename': 'DeviceName', 'filesystemtype': 'FilesystemType', 'hardwareid': 'HardwareId', 'inuse': 'InUse', 'label': 'Label', 'mountpoint': 'MountPoint', 'serialid': 'SerialId', 'size': 'Size', 'uuid': 'UUID', 'wwn': 'WWN'} + _toPy = {'BusAddress': 'busaddress', 'DeviceLinks': 'devicelinks', 'DeviceName': 'devicename', 'FilesystemType': 'filesystemtype', 'HardwareId': 'hardwareid', 'InUse': 'inuse', 'Label': 'label', 'MountPoint': 'mountpoint', 'SerialId': 'serialid', 'Size': 'size', 'UUID': 'uuid', 'WWN': 'wwn'} + def __init__(self, busaddress=None, devicelinks=None, devicename=None, filesystemtype=None, hardwareid=None, inuse=None, label=None, mountpoint=None, serialid=None, size=None, uuid=None, wwn=None, **unknown_fields): + ''' + busaddress : str + devicelinks : typing.Sequence[str] + devicename : str + filesystemtype : str + hardwareid : str + inuse : bool + label : str + mountpoint : str + serialid : str + size : int + uuid : str + wwn : str + ''' + busaddress_ = busaddress + devicelinks_ = devicelinks + devicename_ = devicename + filesystemtype_ = filesystemtype + hardwareid_ = hardwareid + inuse_ = inuse + label_ = label + mountpoint_ = mountpoint + serialid_ = serialid + size_ = size + uuid_ = uuid + wwn_ = wwn + + # Validate arguments against known Juju API types. + if busaddress_ is not None and not isinstance(busaddress_, (bytes, str)): + raise Exception("Expected busaddress_ to be a str, received: {}".format(type(busaddress_))) + + if devicelinks_ is not None and not isinstance(devicelinks_, (bytes, str, list)): + raise Exception("Expected devicelinks_ to be a Sequence, received: {}".format(type(devicelinks_))) + + if devicename_ is not None and not isinstance(devicename_, (bytes, str)): + raise Exception("Expected devicename_ to be a str, received: {}".format(type(devicename_))) + + if filesystemtype_ is not None and not isinstance(filesystemtype_, (bytes, str)): + raise Exception("Expected filesystemtype_ to be a str, received: {}".format(type(filesystemtype_))) + + if hardwareid_ is not None and not isinstance(hardwareid_, (bytes, str)): + raise Exception("Expected hardwareid_ to be a str, received: {}".format(type(hardwareid_))) + + if inuse_ is not None and not isinstance(inuse_, bool): + raise Exception("Expected inuse_ to be a bool, received: {}".format(type(inuse_))) + + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if mountpoint_ is not None and not isinstance(mountpoint_, (bytes, str)): + raise Exception("Expected mountpoint_ to be a str, received: {}".format(type(mountpoint_))) + + if serialid_ is not None and not isinstance(serialid_, (bytes, str)): + raise Exception("Expected serialid_ to be a str, received: {}".format(type(serialid_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + if wwn_ is not None and not isinstance(wwn_, (bytes, str)): + raise Exception("Expected wwn_ to be a str, received: {}".format(type(wwn_))) + + self.busaddress = busaddress_ + self.devicelinks = devicelinks_ + self.devicename = devicename_ + self.filesystemtype = filesystemtype_ + self.hardwareid = hardwareid_ + self.inuse = inuse_ + self.label = label_ + self.mountpoint = mountpoint_ + self.serialid = serialid_ + self.size = size_ + self.uuid = uuid_ + self.wwn = wwn_ + self.unknown_fields = unknown_fields + + + +class BlockDeviceResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - result : Block + result : BlockDevice ''' error_ = Error.from_json(error) if error else None - result_ = Block.from_json(result) if result else None + result_ = BlockDevice.from_json(result) if result else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, Block)): - raise Exception("Expected result_ to be a Block, received: {}".format(type(result_))) + if result_ is not None and not isinstance(result_, (dict, BlockDevice)): + raise Exception("Expected result_ to be a BlockDevice, received: {}".format(type(result_))) self.error = error_ self.result = result_ @@ -2596,14 +3274,14 @@ def __init__(self, error=None, result=None, **unknown_fields): -class BlockResults(Type): +class BlockDeviceResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~BlockResult] + results : typing.Sequence[~BlockDeviceResult] ''' - results_ = [BlockResult.from_json(o) for o in results or []] + results_ = [BlockDeviceResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -2614,10 +3292,52 @@ def __init__(self, results=None, **unknown_fields): -class BlockSwitchParams(Type): - _toSchema = {'message': 'message', 'type_': 'type'} - _toPy = {'message': 'message', 'type': 'type_'} - def __init__(self, message=None, type_=None, **unknown_fields): +class BlockResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : Block + ''' + error_ = Error.from_json(error) if error else None + result_ = Block.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, Block)): + raise Exception("Expected result_ to be a Block, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class BlockResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~BlockResult] + ''' + results_ = [BlockResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class BlockSwitchParams(Type): + _toSchema = {'message': 'message', 'type_': 'type'} + _toPy = {'message': 'message', 'type': 'type_'} + def __init__(self, message=None, type_=None, **unknown_fields): ''' message : str type_ : str @@ -2662,6 +3382,24 @@ def __init__(self, error=None, result=None, **unknown_fields): +class BoolResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~BoolResult] + ''' + results_ = [BoolResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + class BranchArg(Type): _toSchema = {'branch': 'branch'} _toPy = {'branch': 'branch'} @@ -2950,1113 +3688,1189 @@ def __init__(self, changes=None, errors=None, **unknown_fields): -class CIDRParams(Type): - _toSchema = {'cidrs': 'cidrs'} - _toPy = {'cidrs': 'cidrs'} - def __init__(self, cidrs=None, **unknown_fields): +class BytesResult(Type): + _toSchema = {'result': 'result'} + _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): ''' - cidrs : typing.Sequence[str] + result : typing.Sequence[int] ''' - cidrs_ = cidrs + result_ = result # Validate arguments against known Juju API types. - if cidrs_ is not None and not isinstance(cidrs_, (bytes, str, list)): - raise Exception("Expected cidrs_ to be a Sequence, received: {}".format(type(cidrs_))) + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) - self.cidrs = cidrs_ + self.result = result_ self.unknown_fields = unknown_fields -class ChangeModelCredentialParams(Type): - _toSchema = {'credential_tag': 'credential-tag', 'model_tag': 'model-tag'} - _toPy = {'credential-tag': 'credential_tag', 'model-tag': 'model_tag'} - def __init__(self, credential_tag=None, model_tag=None, **unknown_fields): +class CAASApplicationOCIResourceResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - credential_tag : str - model_tag : str + error : Error + result : CAASApplicationOCIResources ''' - credential_tag_ = credential_tag - model_tag_ = model_tag + error_ = Error.from_json(error) if error else None + result_ = CAASApplicationOCIResources.from_json(result) if result else None # Validate arguments against known Juju API types. - if credential_tag_ is not None and not isinstance(credential_tag_, (bytes, str)): - raise Exception("Expected credential_tag_ to be a str, received: {}".format(type(credential_tag_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - 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 result_ is not None and not isinstance(result_, (dict, CAASApplicationOCIResources)): + raise Exception("Expected result_ to be a CAASApplicationOCIResources, received: {}".format(type(result_))) - self.credential_tag = credential_tag_ - self.model_tag = model_tag_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class ChangeModelCredentialsParams(Type): - _toSchema = {'model_credentials': 'model-credentials'} - _toPy = {'model-credentials': 'model_credentials'} - def __init__(self, model_credentials=None, **unknown_fields): +class CAASApplicationOCIResourceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - model_credentials : typing.Sequence[~ChangeModelCredentialParams] + results : typing.Sequence[~CAASApplicationOCIResourceResult] ''' - model_credentials_ = [ChangeModelCredentialParams.from_json(o) for o in model_credentials or []] + results_ = [CAASApplicationOCIResourceResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if model_credentials_ is not None and not isinstance(model_credentials_, (bytes, str, list)): - raise Exception("Expected model_credentials_ to be a Sequence, received: {}".format(type(model_credentials_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.model_credentials = model_credentials_ + self.results = results_ self.unknown_fields = unknown_fields -class Charm(Type): - _toSchema = {'actions': 'actions', 'config': 'config', 'lxd_profile': 'lxd-profile', 'manifest': 'manifest', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} - _toPy = {'actions': 'actions', 'config': 'config', 'lxd-profile': 'lxd_profile', 'manifest': 'manifest', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} - def __init__(self, actions=None, config=None, lxd_profile=None, manifest=None, meta=None, metrics=None, revision=None, url=None, **unknown_fields): +class CAASApplicationOCIResources(Type): + _toSchema = {'images': 'images'} + _toPy = {'images': 'images'} + def __init__(self, images=None, **unknown_fields): ''' - actions : CharmActions - config : typing.Mapping[str, ~CharmOption] - lxd_profile : CharmLXDProfile - manifest : CharmManifest - meta : CharmMeta - metrics : CharmMetrics - revision : int - url : str + images : typing.Mapping[str, ~DockerImageInfo] ''' - actions_ = CharmActions.from_json(actions) if actions else None - config_ = {k: CharmOption.from_json(v) for k, v in (config or dict()).items()} - lxd_profile_ = CharmLXDProfile.from_json(lxd_profile) if lxd_profile else None - manifest_ = CharmManifest.from_json(manifest) if manifest else None - meta_ = CharmMeta.from_json(meta) if meta else None - metrics_ = CharmMetrics.from_json(metrics) if metrics else None - revision_ = revision - url_ = url + images_ = {k: DockerImageInfo.from_json(v) for k, v in (images or dict()).items()} # Validate arguments against known Juju API types. - if actions_ is not None and not isinstance(actions_, (dict, CharmActions)): - raise Exception("Expected actions_ to be a CharmActions, received: {}".format(type(actions_))) - - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if lxd_profile_ is not None and not isinstance(lxd_profile_, (dict, CharmLXDProfile)): - raise Exception("Expected lxd_profile_ to be a CharmLXDProfile, received: {}".format(type(lxd_profile_))) - - if manifest_ is not None and not isinstance(manifest_, (dict, CharmManifest)): - raise Exception("Expected manifest_ to be a CharmManifest, received: {}".format(type(manifest_))) - - if meta_ is not None and not isinstance(meta_, (dict, CharmMeta)): - raise Exception("Expected meta_ to be a CharmMeta, received: {}".format(type(meta_))) - - if metrics_ is not None and not isinstance(metrics_, (dict, CharmMetrics)): - raise Exception("Expected metrics_ to be a CharmMetrics, received: {}".format(type(metrics_))) - - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + if images_ is not None and not isinstance(images_, dict): + raise Exception("Expected images_ to be a Mapping, received: {}".format(type(images_))) - self.actions = actions_ - self.config = config_ - self.lxd_profile = lxd_profile_ - self.manifest = manifest_ - self.meta = meta_ - self.metrics = metrics_ - self.revision = revision_ - self.url = url_ + self.images = images_ self.unknown_fields = unknown_fields -class CharmActionSpec(Type): - _toSchema = {'description': 'description', 'params': 'params'} - _toPy = {'description': 'description', 'params': 'params'} - def __init__(self, description=None, params=None, **unknown_fields): +class CAASApplicationProvisionerConfig(Type): + _toSchema = {'unmanaged_applications': 'unmanaged-applications'} + _toPy = {'unmanaged-applications': 'unmanaged_applications'} + def __init__(self, unmanaged_applications=None, **unknown_fields): ''' - description : str - params : typing.Mapping[str, typing.Any] + unmanaged_applications : Entities ''' - description_ = description - params_ = params + unmanaged_applications_ = Entities.from_json(unmanaged_applications) if unmanaged_applications else None # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if unmanaged_applications_ is not None and not isinstance(unmanaged_applications_, (dict, Entities)): + raise Exception("Expected unmanaged_applications_ to be a Entities, received: {}".format(type(unmanaged_applications_))) - if params_ is not None and not isinstance(params_, dict): - raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - - self.description = description_ - self.params = params_ + self.unmanaged_applications = unmanaged_applications_ self.unknown_fields = unknown_fields -class CharmActions(Type): - _toSchema = {'specs': 'specs'} - _toPy = {'specs': 'specs'} - def __init__(self, specs=None, **unknown_fields): +class CAASApplicationProvisionerConfigResult(Type): + _toSchema = {'error': 'error', 'provisioner_config': 'provisioner-config'} + _toPy = {'error': 'error', 'provisioner-config': 'provisioner_config'} + def __init__(self, error=None, provisioner_config=None, **unknown_fields): ''' - specs : typing.Mapping[str, ~CharmActionSpec] + error : Error + provisioner_config : CAASApplicationProvisionerConfig ''' - specs_ = {k: CharmActionSpec.from_json(v) for k, v in (specs or dict()).items()} + error_ = Error.from_json(error) if error else None + provisioner_config_ = CAASApplicationProvisionerConfig.from_json(provisioner_config) if provisioner_config else None # Validate arguments against known Juju API types. - if specs_ is not None and not isinstance(specs_, dict): - raise Exception("Expected specs_ to be a Mapping, received: {}".format(type(specs_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.specs = specs_ + if provisioner_config_ is not None and not isinstance(provisioner_config_, (dict, CAASApplicationProvisionerConfig)): + raise Exception("Expected provisioner_config_ to be a CAASApplicationProvisionerConfig, received: {}".format(type(provisioner_config_))) + + self.error = error_ + self.provisioner_config = provisioner_config_ self.unknown_fields = unknown_fields -class CharmBase(Type): - _toSchema = {'architectures': 'architectures', 'channel': 'channel', 'name': 'name'} - _toPy = {'architectures': 'architectures', 'channel': 'channel', 'name': 'name'} - def __init__(self, architectures=None, channel=None, name=None, **unknown_fields): +class CAASApplicationProvisioningInfo(Type): + _toSchema = {'api_addresses': 'api-addresses', 'base': 'base', 'ca_cert': 'ca-cert', 'charm_modified_version': 'charm-modified-version', 'charm_url': 'charm-url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image_repo': 'image-repo', 'scale': 'scale', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + _toPy = {'api-addresses': 'api_addresses', 'base': 'base', 'ca-cert': 'ca_cert', 'charm-modified-version': 'charm_modified_version', 'charm-url': 'charm_url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image-repo': 'image_repo', 'scale': 'scale', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + def __init__(self, api_addresses=None, base=None, ca_cert=None, charm_modified_version=None, charm_url=None, constraints=None, devices=None, error=None, filesystems=None, image_repo=None, scale=None, tags=None, trust=None, version=None, volumes=None, **unknown_fields): ''' - architectures : typing.Sequence[str] - channel : str - name : str + api_addresses : typing.Sequence[str] + base : Base + ca_cert : str + charm_modified_version : int + charm_url : str + constraints : Value + devices : typing.Sequence[~KubernetesDeviceParams] + error : Error + filesystems : typing.Sequence[~KubernetesFilesystemParams] + image_repo : DockerImageInfo + scale : int + tags : typing.Mapping[str, str] + trust : bool + version : Number + volumes : typing.Sequence[~KubernetesVolumeParams] ''' - architectures_ = architectures - channel_ = channel - name_ = name + api_addresses_ = api_addresses + base_ = Base.from_json(base) if base else None + ca_cert_ = ca_cert + charm_modified_version_ = charm_modified_version + charm_url_ = charm_url + constraints_ = Value.from_json(constraints) if constraints else None + devices_ = [KubernetesDeviceParams.from_json(o) for o in devices or []] + error_ = Error.from_json(error) if error else None + filesystems_ = [KubernetesFilesystemParams.from_json(o) for o in filesystems or []] + image_repo_ = DockerImageInfo.from_json(image_repo) if image_repo else None + scale_ = scale + tags_ = tags + trust_ = trust + version_ = Number.from_json(version) if version else None + volumes_ = [KubernetesVolumeParams.from_json(o) for o in volumes or []] # Validate arguments against known Juju API types. - if architectures_ is not None and not isinstance(architectures_, (bytes, str, list)): - raise Exception("Expected architectures_ to be a Sequence, received: {}".format(type(architectures_))) + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) - if channel_ is not None and not isinstance(channel_, (bytes, str)): - raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + if base_ is not None and not isinstance(base_, (dict, Base)): + raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) - self.architectures = architectures_ - self.channel = channel_ - self.name = name_ - self.unknown_fields = unknown_fields + if charm_modified_version_ is not None and not isinstance(charm_modified_version_, int): + raise Exception("Expected charm_modified_version_ to be a int, received: {}".format(type(charm_modified_version_))) + if charm_url_ is not None and not isinstance(charm_url_, (bytes, str)): + raise Exception("Expected charm_url_ to be a str, received: {}".format(type(charm_url_))) + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) -class CharmContainer(Type): - _toSchema = {'mounts': 'mounts', 'resource': 'resource'} - _toPy = {'mounts': 'mounts', 'resource': 'resource'} - def __init__(self, mounts=None, resource=None, **unknown_fields): - ''' - mounts : typing.Sequence[~CharmMount] - resource : str - ''' - mounts_ = [CharmMount.from_json(o) for o in mounts or []] - resource_ = resource + if devices_ is not None and not isinstance(devices_, (bytes, str, list)): + raise Exception("Expected devices_ to be a Sequence, received: {}".format(type(devices_))) - # Validate arguments against known Juju API types. - if mounts_ is not None and not isinstance(mounts_, (bytes, str, list)): - raise Exception("Expected mounts_ to be a Sequence, received: {}".format(type(mounts_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if resource_ is not None and not isinstance(resource_, (bytes, str)): - raise Exception("Expected resource_ to be a str, received: {}".format(type(resource_))) + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) - self.mounts = mounts_ - self.resource = resource_ + if image_repo_ is not None and not isinstance(image_repo_, (dict, DockerImageInfo)): + raise Exception("Expected image_repo_ to be a DockerImageInfo, received: {}".format(type(image_repo_))) + + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if trust_ is not None and not isinstance(trust_, bool): + raise Exception("Expected trust_ to be a bool, received: {}".format(type(trust_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.api_addresses = api_addresses_ + self.base = base_ + self.ca_cert = ca_cert_ + self.charm_modified_version = charm_modified_version_ + self.charm_url = charm_url_ + self.constraints = constraints_ + self.devices = devices_ + self.error = error_ + self.filesystems = filesystems_ + self.image_repo = image_repo_ + self.scale = scale_ + self.tags = tags_ + self.trust = trust_ + self.version = version_ + self.volumes = volumes_ self.unknown_fields = unknown_fields -class CharmDeployment(Type): - _toSchema = {'min_version': 'min-version', 'mode': 'mode', 'service': 'service', 'type_': 'type'} - _toPy = {'min-version': 'min_version', 'mode': 'mode', 'service': 'service', 'type': 'type_'} - def __init__(self, min_version=None, mode=None, service=None, type_=None, **unknown_fields): +class CAASApplicationProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - min_version : str - mode : str - service : str - type_ : str + results : typing.Sequence[~CAASApplicationProvisioningInfo] ''' - min_version_ = min_version - mode_ = mode - service_ = service - type__ = type_ + results_ = [CAASApplicationProvisioningInfo.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if min_version_ is not None and not isinstance(min_version_, (bytes, str)): - raise Exception("Expected min_version_ to be a str, received: {}".format(type(min_version_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if mode_ is not None and not isinstance(mode_, (bytes, str)): - raise Exception("Expected mode_ to be a str, received: {}".format(type(mode_))) + self.results = results_ + self.unknown_fields = unknown_fields - if service_ is not None and not isinstance(service_, (bytes, str)): - raise Exception("Expected service_ to be a str, received: {}".format(type(service_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.min_version = min_version_ - self.mode = mode_ - self.service = service_ - self.type_ = type__ +class CAASApplicationProvisioningState(Type): + _toSchema = {'scale_target': 'scale-target', 'scaling': 'scaling'} + _toPy = {'scale-target': 'scale_target', 'scaling': 'scaling'} + def __init__(self, scale_target=None, scaling=None, **unknown_fields): + ''' + scale_target : int + scaling : bool + ''' + scale_target_ = scale_target + scaling_ = scaling + + # Validate arguments against known Juju API types. + if scale_target_ is not None and not isinstance(scale_target_, int): + raise Exception("Expected scale_target_ to be a int, received: {}".format(type(scale_target_))) + + if scaling_ is not None and not isinstance(scaling_, bool): + raise Exception("Expected scaling_ to be a bool, received: {}".format(type(scaling_))) + + self.scale_target = scale_target_ + self.scaling = scaling_ self.unknown_fields = unknown_fields -class CharmDevice(Type): - _toSchema = {'countmax': 'CountMax', 'countmin': 'CountMin', 'description': 'Description', 'name': 'Name', 'type_': 'Type'} - _toPy = {'CountMax': 'countmax', 'CountMin': 'countmin', 'Description': 'description', 'Name': 'name', 'Type': 'type_'} - def __init__(self, countmax=None, countmin=None, description=None, name=None, type_=None, **unknown_fields): +class CAASApplicationProvisioningStateArg(Type): + _toSchema = {'application': 'application', 'provisioning_state': 'provisioning-state'} + _toPy = {'application': 'application', 'provisioning-state': 'provisioning_state'} + def __init__(self, application=None, provisioning_state=None, **unknown_fields): ''' - countmax : int - countmin : int - description : str - name : str - type_ : str + application : Entity + provisioning_state : CAASApplicationProvisioningState ''' - countmax_ = countmax - countmin_ = countmin - description_ = description - name_ = name - type__ = type_ + application_ = Entity.from_json(application) if application else None + provisioning_state_ = CAASApplicationProvisioningState.from_json(provisioning_state) if provisioning_state else None # Validate arguments against known Juju API types. - if countmax_ is not None and not isinstance(countmax_, int): - raise Exception("Expected countmax_ to be a int, received: {}".format(type(countmax_))) + if application_ is not None and not isinstance(application_, (dict, Entity)): + raise Exception("Expected application_ to be a Entity, received: {}".format(type(application_))) - if countmin_ is not None and not isinstance(countmin_, int): - raise Exception("Expected countmin_ to be a int, received: {}".format(type(countmin_))) + 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_))) - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + self.application = application_ + self.provisioning_state = provisioning_state_ + self.unknown_fields = unknown_fields - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.countmax = countmax_ - self.countmin = countmin_ - self.description = description_ - self.name = name_ - self.type_ = type__ +class CAASApplicationProvisioningStateResult(Type): + _toSchema = {'error': 'error', 'provisioning_state': 'provisioning-state'} + _toPy = {'error': 'error', 'provisioning-state': 'provisioning_state'} + def __init__(self, error=None, provisioning_state=None, **unknown_fields): + ''' + error : Error + provisioning_state : CAASApplicationProvisioningState + ''' + error_ = Error.from_json(error) if error else None + provisioning_state_ = CAASApplicationProvisioningState.from_json(provisioning_state) if provisioning_state else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if 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_))) + + self.error = error_ + self.provisioning_state = provisioning_state_ self.unknown_fields = unknown_fields -class CharmLXDProfile(Type): - _toSchema = {'config': 'config', 'description': 'description', 'devices': 'devices'} - _toPy = {'config': 'config', 'description': 'description', 'devices': 'devices'} - def __init__(self, config=None, description=None, devices=None, **unknown_fields): +class CAASUnitInfo(Type): + _toSchema = {'tag': 'tag', 'unit_status': 'unit-status'} + _toPy = {'tag': 'tag', 'unit-status': 'unit_status'} + def __init__(self, tag=None, unit_status=None, **unknown_fields): ''' - config : typing.Mapping[str, str] - description : str - devices : typing.Mapping[str, typing.Any] + tag : str + unit_status : UnitStatus ''' - config_ = config - description_ = description - devices_ = devices + tag_ = tag + unit_status_ = UnitStatus.from_json(unit_status) if unit_status else None # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - if devices_ is not None and not isinstance(devices_, dict): - raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + if unit_status_ is not None and not isinstance(unit_status_, (dict, UnitStatus)): + raise Exception("Expected unit_status_ to be a UnitStatus, received: {}".format(type(unit_status_))) - self.config = config_ - self.description = description_ - self.devices = devices_ + self.tag = tag_ + self.unit_status = unit_status_ self.unknown_fields = unknown_fields -class CharmManifest(Type): - _toSchema = {'bases': 'bases'} - _toPy = {'bases': 'bases'} - def __init__(self, bases=None, **unknown_fields): +class CAASUnitIntroduction(Type): + _toSchema = {'agent_conf': 'agent-conf', 'unit_name': 'unit-name'} + _toPy = {'agent-conf': 'agent_conf', 'unit-name': 'unit_name'} + def __init__(self, agent_conf=None, unit_name=None, **unknown_fields): ''' - bases : typing.Sequence[~CharmBase] + agent_conf : typing.Sequence[int] + unit_name : str ''' - bases_ = [CharmBase.from_json(o) for o in bases or []] + agent_conf_ = agent_conf + unit_name_ = unit_name # Validate arguments against known Juju API types. - if bases_ is not None and not isinstance(bases_, (bytes, str, list)): - raise Exception("Expected bases_ to be a Sequence, received: {}".format(type(bases_))) + if agent_conf_ is not None and not isinstance(agent_conf_, (bytes, str, list)): + raise Exception("Expected agent_conf_ to be a Sequence, received: {}".format(type(agent_conf_))) - self.bases = bases_ + if unit_name_ is not None and not isinstance(unit_name_, (bytes, str)): + raise Exception("Expected unit_name_ to be a str, received: {}".format(type(unit_name_))) + + self.agent_conf = agent_conf_ + self.unit_name = unit_name_ self.unknown_fields = unknown_fields -class CharmMeta(Type): - _toSchema = {'assumes_expr': 'assumes-expr', 'categories': 'categories', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra_bindings': 'extra-bindings', 'min_juju_version': 'min-juju-version', 'name': 'name', 'payload_classes': 'payload-classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} - _toPy = {'assumes-expr': 'assumes_expr', 'categories': 'categories', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra-bindings': 'extra_bindings', 'min-juju-version': 'min_juju_version', 'name': 'name', 'payload-classes': 'payload_classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} - def __init__(self, assumes_expr=None, categories=None, containers=None, deployment=None, description=None, devices=None, extra_bindings=None, min_juju_version=None, name=None, payload_classes=None, peers=None, provides=None, requires=None, resources=None, series=None, storage=None, subordinate=None, summary=None, tags=None, terms=None, **unknown_fields): +class CAASUnitIntroductionArgs(Type): + _toSchema = {'pod_name': 'pod-name', 'pod_uuid': 'pod-uuid'} + _toPy = {'pod-name': 'pod_name', 'pod-uuid': 'pod_uuid'} + def __init__(self, pod_name=None, pod_uuid=None, **unknown_fields): ''' - assumes_expr : ExpressionTree - categories : typing.Sequence[str] - containers : typing.Mapping[str, ~CharmContainer] - deployment : CharmDeployment - description : str - devices : typing.Mapping[str, ~CharmDevice] - extra_bindings : typing.Mapping[str, str] - min_juju_version : str - name : str - payload_classes : typing.Mapping[str, ~CharmPayloadClass] - peers : typing.Mapping[str, ~CharmRelation] - provides : typing.Mapping[str, ~CharmRelation] - requires : typing.Mapping[str, ~CharmRelation] - resources : typing.Mapping[str, ~CharmResourceMeta] - series : typing.Sequence[str] - storage : typing.Mapping[str, ~CharmStorage] - subordinate : bool - summary : str - tags : typing.Sequence[str] - terms : typing.Sequence[str] + pod_name : str + pod_uuid : str ''' - assumes_expr_ = ExpressionTree.from_json(assumes_expr) if assumes_expr else None - categories_ = categories - containers_ = {k: CharmContainer.from_json(v) for k, v in (containers or dict()).items()} - deployment_ = CharmDeployment.from_json(deployment) if deployment else None - description_ = description - devices_ = {k: CharmDevice.from_json(v) for k, v in (devices or dict()).items()} - extra_bindings_ = extra_bindings - min_juju_version_ = min_juju_version - name_ = name - payload_classes_ = {k: CharmPayloadClass.from_json(v) for k, v in (payload_classes or dict()).items()} - peers_ = {k: CharmRelation.from_json(v) for k, v in (peers or dict()).items()} - provides_ = {k: CharmRelation.from_json(v) for k, v in (provides or dict()).items()} - requires_ = {k: CharmRelation.from_json(v) for k, v in (requires or dict()).items()} - resources_ = {k: CharmResourceMeta.from_json(v) for k, v in (resources or dict()).items()} - series_ = series - storage_ = {k: CharmStorage.from_json(v) for k, v in (storage or dict()).items()} - subordinate_ = subordinate - summary_ = summary - tags_ = tags - terms_ = terms + pod_name_ = pod_name + pod_uuid_ = pod_uuid # Validate arguments against known Juju API types. - if assumes_expr_ is not None and not isinstance(assumes_expr_, (dict, ExpressionTree)): - raise Exception("Expected assumes_expr_ to be a ExpressionTree, received: {}".format(type(assumes_expr_))) + if 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 categories_ is not None and not isinstance(categories_, (bytes, str, list)): - raise Exception("Expected categories_ to be a Sequence, received: {}".format(type(categories_))) + 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_))) - if containers_ is not None and not isinstance(containers_, dict): - raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) + self.pod_name = pod_name_ + self.pod_uuid = pod_uuid_ + self.unknown_fields = unknown_fields - if deployment_ is not None and not isinstance(deployment_, (dict, CharmDeployment)): - raise Exception("Expected deployment_ to be a CharmDeployment, received: {}".format(type(deployment_))) - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if devices_ is not None and not isinstance(devices_, dict): - raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) +class CAASUnitIntroductionResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : CAASUnitIntroduction + ''' + error_ = Error.from_json(error) if error else None + result_ = CAASUnitIntroduction.from_json(result) if result else None - if extra_bindings_ is not None and not isinstance(extra_bindings_, dict): - raise Exception("Expected extra_bindings_ to be a Mapping, received: {}".format(type(extra_bindings_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if min_juju_version_ is not None and not isinstance(min_juju_version_, (bytes, str)): - raise Exception("Expected min_juju_version_ to be a str, received: {}".format(type(min_juju_version_))) + if result_ is not None and not isinstance(result_, (dict, CAASUnitIntroduction)): + raise Exception("Expected result_ to be a CAASUnitIntroduction, received: {}".format(type(result_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields - if payload_classes_ is not None and not isinstance(payload_classes_, dict): - raise Exception("Expected payload_classes_ to be a Mapping, received: {}".format(type(payload_classes_))) - if peers_ is not None and not isinstance(peers_, dict): - raise Exception("Expected peers_ to be a Mapping, received: {}".format(type(peers_))) - if provides_ is not None and not isinstance(provides_, dict): - raise Exception("Expected provides_ to be a Mapping, received: {}".format(type(provides_))) +class CAASUnitTerminationResult(Type): + _toSchema = {'error': 'Error', 'willrestart': 'WillRestart'} + _toPy = {'Error': 'error', 'WillRestart': 'willrestart'} + def __init__(self, error=None, willrestart=None, **unknown_fields): + ''' + error : Error + willrestart : bool + ''' + error_ = Error.from_json(error) if error else None + willrestart_ = willrestart - if requires_ is not None and not isinstance(requires_, dict): - raise Exception("Expected requires_ to be a Mapping, received: {}".format(type(requires_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if resources_ is not None and not isinstance(resources_, dict): - raise Exception("Expected resources_ to be a Mapping, received: {}".format(type(resources_))) + if willrestart_ is not None and not isinstance(willrestart_, bool): + raise Exception("Expected willrestart_ to be a bool, received: {}".format(type(willrestart_))) - if series_ is not None and not isinstance(series_, (bytes, str, list)): - raise Exception("Expected series_ to be a Sequence, received: {}".format(type(series_))) + self.error = error_ + self.willrestart = willrestart_ + self.unknown_fields = unknown_fields - if storage_ is not None and not isinstance(storage_, dict): - raise Exception("Expected storage_ to be a Mapping, received: {}".format(type(storage_))) - if subordinate_ is not None and not isinstance(subordinate_, bool): - raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) - if summary_ is not None and not isinstance(summary_, (bytes, str)): - raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) +class CAASUnitsResult(Type): + _toSchema = {'error': 'error', 'units': 'units'} + _toPy = {'error': 'error', 'units': 'units'} + def __init__(self, error=None, units=None, **unknown_fields): + ''' + error : Error + units : typing.Sequence[~CAASUnitInfo] + ''' + error_ = Error.from_json(error) if error else None + units_ = [CAASUnitInfo.from_json(o) for o in units or []] - if tags_ is not None and not isinstance(tags_, (bytes, str, list)): - raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if terms_ is not None and not isinstance(terms_, (bytes, str, list)): - raise Exception("Expected terms_ to be a Sequence, received: {}".format(type(terms_))) + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) - self.assumes_expr = assumes_expr_ - self.categories = categories_ - self.containers = containers_ - self.deployment = deployment_ - self.description = description_ - self.devices = devices_ - self.extra_bindings = extra_bindings_ - self.min_juju_version = min_juju_version_ - self.name = name_ - self.payload_classes = payload_classes_ - self.peers = peers_ - self.provides = provides_ - self.requires = requires_ - self.resources = resources_ - self.series = series_ - self.storage = storage_ - self.subordinate = subordinate_ - self.summary = summary_ - self.tags = tags_ - self.terms = terms_ + self.error = error_ + self.units = units_ self.unknown_fields = unknown_fields -class CharmMetric(Type): - _toSchema = {'description': 'description', 'type_': 'type'} - _toPy = {'description': 'description', 'type': 'type_'} - def __init__(self, description=None, type_=None, **unknown_fields): +class CAASUnitsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - description : str - type_ : str + results : typing.Sequence[~CAASUnitsResult] ''' - description_ = description - type__ = type_ + results_ = [CAASUnitsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.description = description_ - self.type_ = type__ + self.results = results_ self.unknown_fields = unknown_fields -class CharmMetrics(Type): - _toSchema = {'metrics': 'metrics', 'plan': 'plan'} - _toPy = {'metrics': 'metrics', 'plan': 'plan'} - def __init__(self, metrics=None, plan=None, **unknown_fields): +class CIDRParams(Type): + _toSchema = {'cidrs': 'cidrs'} + _toPy = {'cidrs': 'cidrs'} + def __init__(self, cidrs=None, **unknown_fields): ''' - metrics : typing.Mapping[str, ~CharmMetric] - plan : CharmPlan + cidrs : typing.Sequence[str] ''' - metrics_ = {k: CharmMetric.from_json(v) for k, v in (metrics or dict()).items()} - plan_ = CharmPlan.from_json(plan) if plan else None + cidrs_ = cidrs # Validate arguments against known Juju API types. - if metrics_ is not None and not isinstance(metrics_, dict): - raise Exception("Expected metrics_ to be a Mapping, received: {}".format(type(metrics_))) - - if plan_ is not None and not isinstance(plan_, (dict, CharmPlan)): - raise Exception("Expected plan_ to be a CharmPlan, received: {}".format(type(plan_))) + if cidrs_ is not None and not isinstance(cidrs_, (bytes, str, list)): + raise Exception("Expected cidrs_ to be a Sequence, received: {}".format(type(cidrs_))) - self.metrics = metrics_ - self.plan = plan_ + self.cidrs = cidrs_ self.unknown_fields = unknown_fields -class CharmMount(Type): - _toSchema = {'location': 'location', 'storage': 'storage'} - _toPy = {'location': 'location', 'storage': 'storage'} - def __init__(self, location=None, storage=None, **unknown_fields): +class ChangeModelCredentialParams(Type): + _toSchema = {'credential_tag': 'credential-tag', 'model_tag': 'model-tag'} + _toPy = {'credential-tag': 'credential_tag', 'model-tag': 'model_tag'} + def __init__(self, credential_tag=None, model_tag=None, **unknown_fields): ''' - location : str - storage : str + credential_tag : str + model_tag : str ''' - location_ = location - storage_ = storage + credential_tag_ = credential_tag + model_tag_ = model_tag # Validate arguments against known Juju API types. - if location_ is not None and not isinstance(location_, (bytes, str)): - raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + if credential_tag_ is not None and not isinstance(credential_tag_, (bytes, str)): + raise Exception("Expected credential_tag_ to be a str, received: {}".format(type(credential_tag_))) - if storage_ is not None and not isinstance(storage_, (bytes, str)): - raise Exception("Expected storage_ to be a str, received: {}".format(type(storage_))) + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) - self.location = location_ - self.storage = storage_ + self.credential_tag = credential_tag_ + self.model_tag = model_tag_ self.unknown_fields = unknown_fields -class CharmOption(Type): - _toSchema = {'default': 'default', 'description': 'description', 'type_': 'type'} - _toPy = {'default': 'default', 'description': 'description', 'type': 'type_'} - def __init__(self, default=None, description=None, type_=None, **unknown_fields): +class ChangeModelCredentialsParams(Type): + _toSchema = {'model_credentials': 'model-credentials'} + _toPy = {'model-credentials': 'model_credentials'} + def __init__(self, model_credentials=None, **unknown_fields): ''' - default : Any - description : str - type_ : str + model_credentials : typing.Sequence[~ChangeModelCredentialParams] ''' - default_ = default - description_ = description - type__ = type_ + model_credentials_ = [ChangeModelCredentialParams.from_json(o) for o in model_credentials or []] # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if model_credentials_ is not None and not isinstance(model_credentials_, (bytes, str, list)): + raise Exception("Expected model_credentials_ to be a Sequence, received: {}".format(type(model_credentials_))) - self.default = default_ - self.description = description_ - self.type_ = type__ + self.model_credentials = model_credentials_ self.unknown_fields = unknown_fields -class CharmOrigin(Type): - _toSchema = {'architecture': 'architecture', 'base': 'base', 'branch': 'branch', 'hash_': 'hash', 'id_': 'id', 'instance_key': 'instance-key', 'revision': 'revision', 'risk': 'risk', 'source': 'source', 'track': 'track', 'type_': 'type'} - _toPy = {'architecture': 'architecture', 'base': 'base', 'branch': 'branch', 'hash': 'hash_', 'id': 'id_', 'instance-key': 'instance_key', 'revision': 'revision', 'risk': 'risk', 'source': 'source', 'track': 'track', 'type': 'type_'} - def __init__(self, architecture=None, base=None, branch=None, hash_=None, id_=None, instance_key=None, revision=None, risk=None, source=None, track=None, type_=None, **unknown_fields): +class ChangeSecretBackendArg(Type): + _toSchema = {'content': 'content', 'revision': 'revision', 'uri': 'uri'} + _toPy = {'content': 'content', 'revision': 'revision', 'uri': 'uri'} + def __init__(self, content=None, revision=None, uri=None, **unknown_fields): ''' - architecture : str - base : Base - branch : str - hash_ : str - id_ : str - instance_key : str + content : SecretContentParams revision : int - risk : str - source : str - track : str - type_ : str + uri : str ''' - architecture_ = architecture - base_ = Base.from_json(base) if base else None - branch_ = branch - hash__ = hash_ - id__ = id_ - instance_key_ = instance_key + content_ = SecretContentParams.from_json(content) if content else None revision_ = revision - risk_ = risk - source_ = source - track_ = track - type__ = type_ + uri_ = uri # Validate arguments against known Juju API types. - if architecture_ is not None and not isinstance(architecture_, (bytes, str)): - raise Exception("Expected architecture_ to be a str, received: {}".format(type(architecture_))) - - if base_ is not None and not isinstance(base_, (dict, Base)): - raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) - - if branch_ is not None and not isinstance(branch_, (bytes, str)): - raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) - - if hash__ is not None and not isinstance(hash__, (bytes, str)): - raise Exception("Expected hash__ to be a str, received: {}".format(type(hash__))) - - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - - if instance_key_ is not None and not isinstance(instance_key_, (bytes, str)): - raise Exception("Expected instance_key_ to be a str, received: {}".format(type(instance_key_))) + if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): + raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) if revision_ is not None and not isinstance(revision_, int): raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - if risk_ is not None and not isinstance(risk_, (bytes, str)): - raise Exception("Expected risk_ to be a str, received: {}".format(type(risk_))) - - if source_ is not None and not isinstance(source_, (bytes, str)): - raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) - - if track_ is not None and not isinstance(track_, (bytes, str)): - raise Exception("Expected track_ to be a str, received: {}".format(type(track_))) - - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) - self.architecture = architecture_ - self.base = base_ - self.branch = branch_ - self.hash_ = hash__ - self.id_ = id__ - self.instance_key = instance_key_ + self.content = content_ self.revision = revision_ - self.risk = risk_ - self.source = source_ - self.track = track_ - self.type_ = type__ + self.uri = uri_ self.unknown_fields = unknown_fields -class CharmOriginResult(Type): - _toSchema = {'charm_origin': 'charm-origin', 'error': 'error'} - _toPy = {'charm-origin': 'charm_origin', 'error': 'error'} - def __init__(self, charm_origin=None, error=None, **unknown_fields): +class ChangeSecretBackendArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - charm_origin : CharmOrigin - error : Error + args : typing.Sequence[~ChangeSecretBackendArg] ''' - charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None - error_ = Error.from_json(error) if error else None + args_ = [ChangeSecretBackendArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): - raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) - - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.charm_origin = charm_origin_ - self.error = error_ + self.args = args_ self.unknown_fields = unknown_fields -class CharmPayloadClass(Type): - _toSchema = {'name': 'name', 'type_': 'type'} - _toPy = {'name': 'name', 'type': 'type_'} - def __init__(self, name=None, type_=None, **unknown_fields): +class Charm(Type): + _toSchema = {'actions': 'actions', 'config': 'config', 'lxd_profile': 'lxd-profile', 'manifest': 'manifest', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} + _toPy = {'actions': 'actions', 'config': 'config', 'lxd-profile': 'lxd_profile', 'manifest': 'manifest', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} + def __init__(self, actions=None, config=None, lxd_profile=None, manifest=None, meta=None, metrics=None, revision=None, url=None, **unknown_fields): ''' - name : str - type_ : str + actions : CharmActions + config : typing.Mapping[str, ~CharmOption] + lxd_profile : CharmLXDProfile + manifest : CharmManifest + meta : CharmMeta + metrics : CharmMetrics + revision : int + url : str ''' - name_ = name - type__ = type_ + actions_ = CharmActions.from_json(actions) if actions else None + config_ = {k: CharmOption.from_json(v) for k, v in (config or dict()).items()} + lxd_profile_ = CharmLXDProfile.from_json(lxd_profile) if lxd_profile else None + manifest_ = CharmManifest.from_json(manifest) if manifest else None + meta_ = CharmMeta.from_json(meta) if meta else None + metrics_ = CharmMetrics.from_json(metrics) if metrics else None + revision_ = revision + url_ = url # Validate arguments against known Juju API types. - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if actions_ is not None and not isinstance(actions_, (dict, CharmActions)): + raise Exception("Expected actions_ to be a CharmActions, received: {}".format(type(actions_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - self.name = name_ - self.type_ = type__ - self.unknown_fields = unknown_fields + if lxd_profile_ is not None and not isinstance(lxd_profile_, (dict, CharmLXDProfile)): + raise Exception("Expected lxd_profile_ to be a CharmLXDProfile, received: {}".format(type(lxd_profile_))) + if manifest_ is not None and not isinstance(manifest_, (dict, CharmManifest)): + raise Exception("Expected manifest_ to be a CharmManifest, received: {}".format(type(manifest_))) + if meta_ is not None and not isinstance(meta_, (dict, CharmMeta)): + raise Exception("Expected meta_ to be a CharmMeta, received: {}".format(type(meta_))) -class CharmPlan(Type): - _toSchema = {'required': 'required'} - _toPy = {'required': 'required'} - def __init__(self, required=None, **unknown_fields): - ''' - required : bool - ''' - required_ = required + if metrics_ is not None and not isinstance(metrics_, (dict, CharmMetrics)): + raise Exception("Expected metrics_ to be a CharmMetrics, received: {}".format(type(metrics_))) - # Validate arguments against known Juju API types. - if required_ is not None and not isinstance(required_, bool): - raise Exception("Expected required_ to be a bool, received: {}".format(type(required_))) + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - self.required = required_ + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.actions = actions_ + self.config = config_ + self.lxd_profile = lxd_profile_ + self.manifest = manifest_ + self.meta = meta_ + self.metrics = metrics_ + self.revision = revision_ + self.url = url_ self.unknown_fields = unknown_fields -class CharmRelation(Type): - _toSchema = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'optional': 'optional', 'role': 'role', 'scope': 'scope'} - _toPy = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'optional': 'optional', 'role': 'role', 'scope': 'scope'} - def __init__(self, interface=None, limit=None, name=None, optional=None, role=None, scope=None, **unknown_fields): +class CharmActionSpec(Type): + _toSchema = {'description': 'description', 'params': 'params'} + _toPy = {'description': 'description', 'params': 'params'} + def __init__(self, description=None, params=None, **unknown_fields): ''' - interface : str - limit : int - name : str - optional : bool - role : str - scope : str + description : str + params : typing.Mapping[str, typing.Any] ''' - interface_ = interface - limit_ = limit - name_ = name - optional_ = optional - role_ = role - scope_ = scope + description_ = description + params_ = params # Validate arguments against known Juju API types. - if interface_ is not None and not isinstance(interface_, (bytes, str)): - raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if limit_ is not None and not isinstance(limit_, int): - raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + self.description = description_ + self.params = params_ + self.unknown_fields = unknown_fields - if optional_ is not None and not isinstance(optional_, bool): - raise Exception("Expected optional_ to be a bool, received: {}".format(type(optional_))) - if role_ is not None and not isinstance(role_, (bytes, str)): - raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) - if scope_ is not None and not isinstance(scope_, (bytes, str)): - raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) +class CharmActions(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Mapping[str, ~CharmActionSpec] + ''' + specs_ = {k: CharmActionSpec.from_json(v) for k, v in (specs or dict()).items()} - self.interface = interface_ - self.limit = limit_ - self.name = name_ - self.optional = optional_ - self.role = role_ - self.scope = scope_ + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, dict): + raise Exception("Expected specs_ to be a Mapping, received: {}".format(type(specs_))) + + self.specs = specs_ self.unknown_fields = unknown_fields -class CharmResource(Type): - _toSchema = {'description': 'description', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type_': 'type'} - _toPy = {'description': 'description', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type': 'type_'} - def __init__(self, description=None, fingerprint=None, name=None, origin=None, path=None, revision=None, size=None, type_=None, **unknown_fields): +class CharmBase(Type): + _toSchema = {'architectures': 'architectures', 'channel': 'channel', 'name': 'name'} + _toPy = {'architectures': 'architectures', 'channel': 'channel', 'name': 'name'} + def __init__(self, architectures=None, channel=None, name=None, **unknown_fields): ''' - description : str - fingerprint : typing.Sequence[int] + architectures : typing.Sequence[str] + channel : str name : str - origin : str - path : str - revision : int - size : int - type_ : str ''' - description_ = description - fingerprint_ = fingerprint + architectures_ = architectures + channel_ = channel name_ = name - origin_ = origin - path_ = path - revision_ = revision - size_ = size - type__ = type_ # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if architectures_ is not None and not isinstance(architectures_, (bytes, str, list)): + raise Exception("Expected architectures_ to be a Sequence, received: {}".format(type(architectures_))) - if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): - raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if origin_ is not None and not isinstance(origin_, (bytes, str)): - raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + self.architectures = architectures_ + self.channel = channel_ + self.name = name_ + self.unknown_fields = unknown_fields - if path_ is not None and not isinstance(path_, (bytes, str)): - raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) +class CharmContainer(Type): + _toSchema = {'mounts': 'mounts', 'resource': 'resource'} + _toPy = {'mounts': 'mounts', 'resource': 'resource'} + def __init__(self, mounts=None, resource=None, **unknown_fields): + ''' + mounts : typing.Sequence[~CharmMount] + resource : str + ''' + mounts_ = [CharmMount.from_json(o) for o in mounts or []] + resource_ = resource - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + # Validate arguments against known Juju API types. + if mounts_ is not None and not isinstance(mounts_, (bytes, str, list)): + raise Exception("Expected mounts_ to be a Sequence, received: {}".format(type(mounts_))) - self.description = description_ - self.fingerprint = fingerprint_ - self.name = name_ - self.origin = origin_ - self.path = path_ - self.revision = revision_ - self.size = size_ - self.type_ = type__ + if resource_ is not None and not isinstance(resource_, (bytes, str)): + raise Exception("Expected resource_ to be a str, received: {}".format(type(resource_))) + + self.mounts = mounts_ + self.resource = resource_ self.unknown_fields = unknown_fields -class CharmResourceMeta(Type): - _toSchema = {'description': 'description', 'name': 'name', 'path': 'path', 'type_': 'type'} - _toPy = {'description': 'description', 'name': 'name', 'path': 'path', 'type': 'type_'} - def __init__(self, description=None, name=None, path=None, type_=None, **unknown_fields): +class CharmDeployment(Type): + _toSchema = {'min_version': 'min-version', 'mode': 'mode', 'service': 'service', 'type_': 'type'} + _toPy = {'min-version': 'min_version', 'mode': 'mode', 'service': 'service', 'type': 'type_'} + def __init__(self, min_version=None, mode=None, service=None, type_=None, **unknown_fields): ''' - description : str - name : str - path : str + min_version : str + mode : str + service : str type_ : str ''' - description_ = description - name_ = name - path_ = path + min_version_ = min_version + mode_ = mode + service_ = service type__ = type_ # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if min_version_ is not None and not isinstance(min_version_, (bytes, str)): + raise Exception("Expected min_version_ to be a str, received: {}".format(type(min_version_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if mode_ is not None and not isinstance(mode_, (bytes, str)): + raise Exception("Expected mode_ to be a str, received: {}".format(type(mode_))) - if path_ is not None and not isinstance(path_, (bytes, str)): - raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + if service_ is not None and not isinstance(service_, (bytes, str)): + raise Exception("Expected service_ to be a str, received: {}".format(type(service_))) if type__ is not None and not isinstance(type__, (bytes, str)): raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.description = description_ - self.name = name_ - self.path = path_ + self.min_version = min_version_ + self.mode = mode_ + self.service = service_ self.type_ = type__ self.unknown_fields = unknown_fields -class CharmResourceResult(Type): - _toSchema = {'charmresource': 'CharmResource', 'description': 'description', 'error': 'error', 'errorresult': 'ErrorResult', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type_': 'type'} - _toPy = {'CharmResource': 'charmresource', 'ErrorResult': 'errorresult', 'description': 'description', 'error': 'error', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type': 'type_'} - def __init__(self, charmresource=None, errorresult=None, description=None, error=None, fingerprint=None, name=None, origin=None, path=None, revision=None, size=None, type_=None, **unknown_fields): +class CharmDevice(Type): + _toSchema = {'countmax': 'CountMax', 'countmin': 'CountMin', 'description': 'Description', 'name': 'Name', 'type_': 'Type'} + _toPy = {'CountMax': 'countmax', 'CountMin': 'countmin', 'Description': 'description', 'Name': 'name', 'Type': 'type_'} + def __init__(self, countmax=None, countmin=None, description=None, name=None, type_=None, **unknown_fields): ''' - charmresource : CharmResource - errorresult : ErrorResult + countmax : int + countmin : int description : str - error : Error - fingerprint : typing.Sequence[int] name : str - origin : str - path : str - revision : int - size : int type_ : str ''' - charmresource_ = CharmResource.from_json(charmresource) if charmresource else None - errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + countmax_ = countmax + countmin_ = countmin description_ = description - error_ = Error.from_json(error) if error else None - fingerprint_ = fingerprint name_ = name - origin_ = origin - path_ = path - revision_ = revision - size_ = size type__ = type_ # Validate arguments against known Juju API types. - if charmresource_ is not None and not isinstance(charmresource_, (dict, CharmResource)): - raise Exception("Expected charmresource_ to be a CharmResource, received: {}".format(type(charmresource_))) + if countmax_ is not None and not isinstance(countmax_, int): + raise Exception("Expected countmax_ to be a int, received: {}".format(type(countmax_))) - if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): - raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + if countmin_ is not None and not isinstance(countmin_, int): + raise Exception("Expected countmin_ to be a int, received: {}".format(type(countmin_))) if description_ is not None and not isinstance(description_, (bytes, str)): raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): - raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) - if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if origin_ is not None and not isinstance(origin_, (bytes, str)): - raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) - - if path_ is not None and not isinstance(path_, (bytes, str)): - raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + self.countmax = countmax_ + self.countmin = countmin_ + self.description = description_ + self.name = name_ + self.type_ = type__ + self.unknown_fields = unknown_fields - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.charmresource = charmresource_ - self.errorresult = errorresult_ +class CharmLXDProfile(Type): + _toSchema = {'config': 'config', 'description': 'description', 'devices': 'devices'} + _toPy = {'config': 'config', 'description': 'description', 'devices': 'devices'} + def __init__(self, config=None, description=None, devices=None, **unknown_fields): + ''' + config : typing.Mapping[str, str] + description : str + devices : typing.Mapping[str, typing.Any] + ''' + config_ = config + description_ = description + devices_ = devices + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + + self.config = config_ self.description = description_ - self.error = error_ - self.fingerprint = fingerprint_ - self.name = name_ - self.origin = origin_ - self.path = path_ - self.revision = revision_ - self.size = size_ - self.type_ = type__ + self.devices = devices_ self.unknown_fields = unknown_fields -class CharmResourcesResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class CharmManifest(Type): + _toSchema = {'bases': 'bases'} + _toPy = {'bases': 'bases'} + def __init__(self, bases=None, **unknown_fields): ''' - results : typing.Sequence[~CharmResourceResult] + bases : typing.Sequence[~CharmBase] ''' - results_ = [CharmResourceResult.from_json(o) for o in results or []] + bases_ = [CharmBase.from_json(o) for o in bases or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if bases_ is not None and not isinstance(bases_, (bytes, str, list)): + raise Exception("Expected bases_ to be a Sequence, received: {}".format(type(bases_))) - self.results = results_ + self.bases = bases_ self.unknown_fields = unknown_fields -class CharmStorage(Type): - _toSchema = {'count_max': 'count-max', 'count_min': 'count-min', 'description': 'description', 'location': 'location', 'minimum_size': 'minimum-size', 'name': 'name', 'properties': 'properties', 'read_only': 'read-only', 'shared': 'shared', 'type_': 'type'} - _toPy = {'count-max': 'count_max', 'count-min': 'count_min', 'description': 'description', 'location': 'location', 'minimum-size': 'minimum_size', 'name': 'name', 'properties': 'properties', 'read-only': 'read_only', 'shared': 'shared', 'type': 'type_'} - def __init__(self, count_max=None, count_min=None, description=None, location=None, minimum_size=None, name=None, properties=None, read_only=None, shared=None, type_=None, **unknown_fields): +class CharmMeta(Type): + _toSchema = {'assumes_expr': 'assumes-expr', 'categories': 'categories', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra_bindings': 'extra-bindings', 'min_juju_version': 'min-juju-version', 'name': 'name', 'payload_classes': 'payload-classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} + _toPy = {'assumes-expr': 'assumes_expr', 'categories': 'categories', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra-bindings': 'extra_bindings', 'min-juju-version': 'min_juju_version', 'name': 'name', 'payload-classes': 'payload_classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} + def __init__(self, assumes_expr=None, categories=None, containers=None, deployment=None, description=None, devices=None, extra_bindings=None, min_juju_version=None, name=None, payload_classes=None, peers=None, provides=None, requires=None, resources=None, series=None, storage=None, subordinate=None, summary=None, tags=None, terms=None, **unknown_fields): ''' - count_max : int - count_min : int + assumes_expr : ExpressionTree + categories : typing.Sequence[str] + containers : typing.Mapping[str, ~CharmContainer] + deployment : CharmDeployment description : str - location : str - minimum_size : int + devices : typing.Mapping[str, ~CharmDevice] + extra_bindings : typing.Mapping[str, str] + min_juju_version : str name : str - properties : typing.Sequence[str] - read_only : bool - shared : bool - type_ : str + payload_classes : typing.Mapping[str, ~CharmPayloadClass] + peers : typing.Mapping[str, ~CharmRelation] + provides : typing.Mapping[str, ~CharmRelation] + requires : typing.Mapping[str, ~CharmRelation] + resources : typing.Mapping[str, ~CharmResourceMeta] + series : typing.Sequence[str] + storage : typing.Mapping[str, ~CharmStorage] + subordinate : bool + summary : str + tags : typing.Sequence[str] + terms : typing.Sequence[str] ''' - count_max_ = count_max - count_min_ = count_min + assumes_expr_ = ExpressionTree.from_json(assumes_expr) if assumes_expr else None + categories_ = categories + containers_ = {k: CharmContainer.from_json(v) for k, v in (containers or dict()).items()} + deployment_ = CharmDeployment.from_json(deployment) if deployment else None description_ = description - location_ = location - minimum_size_ = minimum_size + devices_ = {k: CharmDevice.from_json(v) for k, v in (devices or dict()).items()} + extra_bindings_ = extra_bindings + min_juju_version_ = min_juju_version name_ = name - properties_ = properties - read_only_ = read_only - shared_ = shared - type__ = type_ + payload_classes_ = {k: CharmPayloadClass.from_json(v) for k, v in (payload_classes or dict()).items()} + peers_ = {k: CharmRelation.from_json(v) for k, v in (peers or dict()).items()} + provides_ = {k: CharmRelation.from_json(v) for k, v in (provides or dict()).items()} + requires_ = {k: CharmRelation.from_json(v) for k, v in (requires or dict()).items()} + resources_ = {k: CharmResourceMeta.from_json(v) for k, v in (resources or dict()).items()} + series_ = series + storage_ = {k: CharmStorage.from_json(v) for k, v in (storage or dict()).items()} + subordinate_ = subordinate + summary_ = summary + tags_ = tags + terms_ = terms # Validate arguments against known Juju API types. - if count_max_ is not None and not isinstance(count_max_, int): - raise Exception("Expected count_max_ to be a int, received: {}".format(type(count_max_))) + if assumes_expr_ is not None and not isinstance(assumes_expr_, (dict, ExpressionTree)): + raise Exception("Expected assumes_expr_ to be a ExpressionTree, received: {}".format(type(assumes_expr_))) - if count_min_ is not None and not isinstance(count_min_, int): - raise Exception("Expected count_min_ to be a int, received: {}".format(type(count_min_))) + if categories_ is not None and not isinstance(categories_, (bytes, str, list)): + raise Exception("Expected categories_ to be a Sequence, received: {}".format(type(categories_))) + + if containers_ is not None and not isinstance(containers_, dict): + raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) + + if deployment_ is not None and not isinstance(deployment_, (dict, CharmDeployment)): + raise Exception("Expected deployment_ to be a CharmDeployment, received: {}".format(type(deployment_))) if description_ is not None and not isinstance(description_, (bytes, str)): raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if location_ is not None and not isinstance(location_, (bytes, str)): - raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) - if minimum_size_ is not None and not isinstance(minimum_size_, int): - raise Exception("Expected minimum_size_ to be a int, received: {}".format(type(minimum_size_))) + if extra_bindings_ is not None and not isinstance(extra_bindings_, dict): + raise Exception("Expected extra_bindings_ to be a Mapping, received: {}".format(type(extra_bindings_))) + + if min_juju_version_ is not None and not isinstance(min_juju_version_, (bytes, str)): + raise Exception("Expected min_juju_version_ to be a str, received: {}".format(type(min_juju_version_))) if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if properties_ is not None and not isinstance(properties_, (bytes, str, list)): - raise Exception("Expected properties_ to be a Sequence, received: {}".format(type(properties_))) + if payload_classes_ is not None and not isinstance(payload_classes_, dict): + raise Exception("Expected payload_classes_ to be a Mapping, received: {}".format(type(payload_classes_))) - if read_only_ is not None and not isinstance(read_only_, bool): - raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + if peers_ is not None and not isinstance(peers_, dict): + raise Exception("Expected peers_ to be a Mapping, received: {}".format(type(peers_))) - if shared_ is not None and not isinstance(shared_, bool): - raise Exception("Expected shared_ to be a bool, received: {}".format(type(shared_))) + if provides_ is not None and not isinstance(provides_, dict): + raise Exception("Expected provides_ to be a Mapping, received: {}".format(type(provides_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if requires_ is not None and not isinstance(requires_, dict): + raise Exception("Expected requires_ to be a Mapping, received: {}".format(type(requires_))) - self.count_max = count_max_ - self.count_min = count_min_ + if resources_ is not None and not isinstance(resources_, dict): + raise Exception("Expected resources_ to be a Mapping, received: {}".format(type(resources_))) + + if series_ is not None and not isinstance(series_, (bytes, str, list)): + raise Exception("Expected series_ to be a Sequence, received: {}".format(type(series_))) + + if storage_ is not None and not isinstance(storage_, dict): + raise Exception("Expected storage_ to be a Mapping, received: {}".format(type(storage_))) + + if subordinate_ is not None and not isinstance(subordinate_, bool): + raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + + if summary_ is not None and not isinstance(summary_, (bytes, str)): + raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + if terms_ is not None and not isinstance(terms_, (bytes, str, list)): + raise Exception("Expected terms_ to be a Sequence, received: {}".format(type(terms_))) + + self.assumes_expr = assumes_expr_ + self.categories = categories_ + self.containers = containers_ + self.deployment = deployment_ self.description = description_ - self.location = location_ - self.minimum_size = minimum_size_ + self.devices = devices_ + self.extra_bindings = extra_bindings_ + self.min_juju_version = min_juju_version_ self.name = name_ - self.properties = properties_ - self.read_only = read_only_ - self.shared = shared_ - self.type_ = type__ + self.payload_classes = payload_classes_ + self.peers = peers_ + self.provides = provides_ + self.requires = requires_ + self.resources = resources_ + self.series = series_ + self.storage = storage_ + self.subordinate = subordinate_ + self.summary = summary_ + self.tags = tags_ + self.terms = terms_ self.unknown_fields = unknown_fields -class CharmURL(Type): - _toSchema = {'url': 'url'} - _toPy = {'url': 'url'} - def __init__(self, url=None, **unknown_fields): +class CharmMetric(Type): + _toSchema = {'description': 'description', 'type_': 'type'} + _toPy = {'description': 'description', 'type': 'type_'} + def __init__(self, description=None, type_=None, **unknown_fields): ''' - url : str + description : str + type_ : str ''' - url_ = url + description_ = description + type__ = type_ # Validate arguments against known Juju API types. - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - self.url = url_ + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.description = description_ + self.type_ = type__ self.unknown_fields = unknown_fields -class CharmURLAndOrigin(Type): - _toSchema = {'charm_origin': 'charm-origin', 'charm_url': 'charm-url', 'macaroon': 'macaroon'} - _toPy = {'charm-origin': 'charm_origin', 'charm-url': 'charm_url', 'macaroon': 'macaroon'} - def __init__(self, charm_origin=None, charm_url=None, macaroon=None, **unknown_fields): +class CharmMetrics(Type): + _toSchema = {'metrics': 'metrics', 'plan': 'plan'} + _toPy = {'metrics': 'metrics', 'plan': 'plan'} + def __init__(self, metrics=None, plan=None, **unknown_fields): ''' - charm_origin : CharmOrigin - charm_url : str - macaroon : Macaroon + metrics : typing.Mapping[str, ~CharmMetric] + plan : CharmPlan ''' - charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None - charm_url_ = charm_url - macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + metrics_ = {k: CharmMetric.from_json(v) for k, v in (metrics or dict()).items()} + plan_ = CharmPlan.from_json(plan) if plan else None # Validate arguments against known Juju API types. - if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): - raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) + if metrics_ is not None and not isinstance(metrics_, dict): + raise Exception("Expected metrics_ to be a Mapping, received: {}".format(type(metrics_))) - if charm_url_ is not None and not isinstance(charm_url_, (bytes, str)): - raise Exception("Expected charm_url_ to be a str, received: {}".format(type(charm_url_))) + if plan_ is not None and not isinstance(plan_, (dict, CharmPlan)): + raise Exception("Expected plan_ to be a CharmPlan, received: {}".format(type(plan_))) - if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): - raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + self.metrics = metrics_ + self.plan = plan_ + self.unknown_fields = unknown_fields - self.charm_origin = charm_origin_ - self.charm_url = charm_url_ - self.macaroon = macaroon_ + + +class CharmMount(Type): + _toSchema = {'location': 'location', 'storage': 'storage'} + _toPy = {'location': 'location', 'storage': 'storage'} + def __init__(self, location=None, storage=None, **unknown_fields): + ''' + location : str + storage : str + ''' + location_ = location + storage_ = storage + + # Validate arguments against known Juju API types. + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + + if storage_ is not None and not isinstance(storage_, (bytes, str)): + raise Exception("Expected storage_ to be a str, received: {}".format(type(storage_))) + + self.location = location_ + self.storage = storage_ self.unknown_fields = unknown_fields -class CharmURLAndOrigins(Type): - _toSchema = {'entities': 'entities'} - _toPy = {'entities': 'entities'} - def __init__(self, entities=None, **unknown_fields): +class CharmOption(Type): + _toSchema = {'default': 'default', 'description': 'description', 'type_': 'type'} + _toPy = {'default': 'default', 'description': 'description', 'type': 'type_'} + def __init__(self, default=None, description=None, type_=None, **unknown_fields): ''' - entities : typing.Sequence[~CharmURLAndOrigin] + default : Any + description : str + type_ : str ''' - entities_ = [CharmURLAndOrigin.from_json(o) for o in entities or []] + default_ = default + description_ = description + type__ = type_ # Validate arguments against known Juju API types. - if entities_ is not None and not isinstance(entities_, (bytes, str, list)): - raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - self.entities = entities_ + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.default = default_ + self.description = description_ + self.type_ = type__ self.unknown_fields = unknown_fields -class CharmURLOriginResult(Type): - _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'url': 'url'} - _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'url': 'url'} - def __init__(self, charm_origin=None, error=None, url=None, **unknown_fields): +class CharmOrigin(Type): + _toSchema = {'architecture': 'architecture', 'base': 'base', 'branch': 'branch', 'hash_': 'hash', 'id_': 'id', 'instance_key': 'instance-key', 'revision': 'revision', 'risk': 'risk', 'source': 'source', 'track': 'track', 'type_': 'type'} + _toPy = {'architecture': 'architecture', 'base': 'base', 'branch': 'branch', 'hash': 'hash_', 'id': 'id_', 'instance-key': 'instance_key', 'revision': 'revision', 'risk': 'risk', 'source': 'source', 'track': 'track', 'type': 'type_'} + def __init__(self, architecture=None, base=None, branch=None, hash_=None, id_=None, instance_key=None, revision=None, risk=None, source=None, track=None, type_=None, **unknown_fields): + ''' + architecture : str + base : Base + branch : str + hash_ : str + id_ : str + instance_key : str + revision : int + risk : str + source : str + track : str + type_ : str + ''' + architecture_ = architecture + base_ = Base.from_json(base) if base else None + branch_ = branch + hash__ = hash_ + id__ = id_ + instance_key_ = instance_key + revision_ = revision + risk_ = risk + source_ = source + track_ = track + type__ = type_ + + # Validate arguments against known Juju API types. + if architecture_ is not None and not isinstance(architecture_, (bytes, str)): + raise Exception("Expected architecture_ to be a str, received: {}".format(type(architecture_))) + + if base_ is not None and not isinstance(base_, (dict, Base)): + raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) + + if branch_ is not None and not isinstance(branch_, (bytes, str)): + raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) + + if hash__ is not None and not isinstance(hash__, (bytes, str)): + raise Exception("Expected hash__ to be a str, received: {}".format(type(hash__))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if instance_key_ is not None and not isinstance(instance_key_, (bytes, str)): + raise Exception("Expected instance_key_ to be a str, received: {}".format(type(instance_key_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if risk_ is not None and not isinstance(risk_, (bytes, str)): + raise Exception("Expected risk_ to be a str, received: {}".format(type(risk_))) + + if source_ is not None and not isinstance(source_, (bytes, str)): + raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) + + if track_ is not None and not isinstance(track_, (bytes, str)): + raise Exception("Expected track_ to be a str, received: {}".format(type(track_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.architecture = architecture_ + self.base = base_ + self.branch = branch_ + self.hash_ = hash__ + self.id_ = id__ + self.instance_key = instance_key_ + self.revision = revision_ + self.risk = risk_ + self.source = source_ + self.track = track_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CharmOriginResult(Type): + _toSchema = {'charm_origin': 'charm-origin', 'error': 'error'} + _toPy = {'charm-origin': 'charm_origin', 'error': 'error'} + def __init__(self, charm_origin=None, error=None, **unknown_fields): ''' charm_origin : CharmOrigin error : Error - url : str ''' charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None error_ = Error.from_json(error) if error else None - url_ = url # Validate arguments against known Juju API types. if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): @@ -4065,576 +4879,584 @@ def __init__(self, charm_origin=None, error=None, url=None, **unknown_fields): if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) - self.charm_origin = charm_origin_ self.error = error_ - self.url = url_ self.unknown_fields = unknown_fields -class CharmsList(Type): - _toSchema = {'names': 'names'} - _toPy = {'names': 'names'} - def __init__(self, names=None, **unknown_fields): +class CharmPayloadClass(Type): + _toSchema = {'name': 'name', 'type_': 'type'} + _toPy = {'name': 'name', 'type': 'type_'} + def __init__(self, name=None, type_=None, **unknown_fields): ''' - names : typing.Sequence[str] + name : str + type_ : str ''' - names_ = names + name_ = name + type__ = type_ # Validate arguments against known Juju API types. - if names_ is not None and not isinstance(names_, (bytes, str, list)): - raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - self.names = names_ + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.name = name_ + self.type_ = type__ self.unknown_fields = unknown_fields -class CharmsListResult(Type): - _toSchema = {'charm_urls': 'charm-urls'} - _toPy = {'charm-urls': 'charm_urls'} - def __init__(self, charm_urls=None, **unknown_fields): +class CharmPlan(Type): + _toSchema = {'required': 'required'} + _toPy = {'required': 'required'} + def __init__(self, required=None, **unknown_fields): ''' - charm_urls : typing.Sequence[str] + required : bool ''' - charm_urls_ = charm_urls + required_ = required # Validate arguments against known Juju API types. - if charm_urls_ is not None and not isinstance(charm_urls_, (bytes, str, list)): - raise Exception("Expected charm_urls_ to be a Sequence, received: {}".format(type(charm_urls_))) + if required_ is not None and not isinstance(required_, bool): + raise Exception("Expected required_ to be a bool, received: {}".format(type(required_))) - self.charm_urls = charm_urls_ + self.required = required_ self.unknown_fields = unknown_fields -class Cloud(Type): - _toSchema = {'auth_types': 'auth-types', 'ca_certificates': 'ca-certificates', 'config': 'config', 'endpoint': 'endpoint', 'host_cloud_region': 'host-cloud-region', 'identity_endpoint': 'identity-endpoint', 'is_controller_cloud': 'is-controller-cloud', 'region_config': 'region-config', 'regions': 'regions', 'skip_tls_verify': 'skip-tls-verify', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} - _toPy = {'auth-types': 'auth_types', 'ca-certificates': 'ca_certificates', 'config': 'config', 'endpoint': 'endpoint', 'host-cloud-region': 'host_cloud_region', 'identity-endpoint': 'identity_endpoint', 'is-controller-cloud': 'is_controller_cloud', 'region-config': 'region_config', 'regions': 'regions', 'skip-tls-verify': 'skip_tls_verify', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} - def __init__(self, auth_types=None, ca_certificates=None, config=None, endpoint=None, host_cloud_region=None, identity_endpoint=None, is_controller_cloud=None, region_config=None, regions=None, skip_tls_verify=None, storage_endpoint=None, type_=None, **unknown_fields): +class CharmProfilingInfoResult(Type): + _toSchema = {'current_profiles': 'current-profiles', 'error': 'error', 'instance_id': 'instance-id', 'model_name': 'model-name', 'profile_changes': 'profile-changes'} + _toPy = {'current-profiles': 'current_profiles', 'error': 'error', 'instance-id': 'instance_id', 'model-name': 'model_name', 'profile-changes': 'profile_changes'} + def __init__(self, current_profiles=None, error=None, instance_id=None, model_name=None, profile_changes=None, **unknown_fields): ''' - auth_types : typing.Sequence[str] - ca_certificates : typing.Sequence[str] - config : typing.Mapping[str, typing.Any] - endpoint : str - host_cloud_region : str - identity_endpoint : str - is_controller_cloud : bool - region_config : typing.Mapping[str, typing.Any] - regions : typing.Sequence[~CloudRegion] - skip_tls_verify : bool - storage_endpoint : str - type_ : str + current_profiles : typing.Sequence[str] + error : Error + instance_id : str + model_name : str + profile_changes : typing.Sequence[~ProfileInfoResult] ''' - auth_types_ = auth_types - ca_certificates_ = ca_certificates - config_ = config - endpoint_ = endpoint - host_cloud_region_ = host_cloud_region - identity_endpoint_ = identity_endpoint - is_controller_cloud_ = is_controller_cloud - region_config_ = region_config - regions_ = [CloudRegion.from_json(o) for o in regions or []] - skip_tls_verify_ = skip_tls_verify - storage_endpoint_ = storage_endpoint - type__ = type_ + current_profiles_ = current_profiles + error_ = Error.from_json(error) if error else None + instance_id_ = instance_id + model_name_ = model_name + profile_changes_ = [ProfileInfoResult.from_json(o) for o in profile_changes or []] # Validate arguments against known Juju API types. - if auth_types_ is not None and not isinstance(auth_types_, (bytes, str, list)): - raise Exception("Expected auth_types_ to be a Sequence, received: {}".format(type(auth_types_))) + if current_profiles_ is not None and not isinstance(current_profiles_, (bytes, str, list)): + raise Exception("Expected current_profiles_ to be a Sequence, received: {}".format(type(current_profiles_))) - if ca_certificates_ is not None and not isinstance(ca_certificates_, (bytes, str, list)): - raise Exception("Expected ca_certificates_ to be a Sequence, received: {}".format(type(ca_certificates_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) - if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): - raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + if model_name_ is not None and not isinstance(model_name_, (bytes, str)): + raise Exception("Expected model_name_ to be a str, received: {}".format(type(model_name_))) - if host_cloud_region_ is not None and not isinstance(host_cloud_region_, (bytes, str)): - raise Exception("Expected host_cloud_region_ to be a str, received: {}".format(type(host_cloud_region_))) + if profile_changes_ is not None and not isinstance(profile_changes_, (bytes, str, list)): + raise Exception("Expected profile_changes_ to be a Sequence, received: {}".format(type(profile_changes_))) - if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): - raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) + self.current_profiles = current_profiles_ + self.error = error_ + self.instance_id = instance_id_ + self.model_name = model_name_ + self.profile_changes = profile_changes_ + self.unknown_fields = unknown_fields - if is_controller_cloud_ is not None and not isinstance(is_controller_cloud_, bool): - raise Exception("Expected is_controller_cloud_ to be a bool, received: {}".format(type(is_controller_cloud_))) - if region_config_ is not None and not isinstance(region_config_, dict): - raise Exception("Expected region_config_ to be a Mapping, received: {}".format(type(region_config_))) - if regions_ is not None and not isinstance(regions_, (bytes, str, list)): - raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) +class CharmRelation(Type): + _toSchema = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'optional': 'optional', 'role': 'role', 'scope': 'scope'} + _toPy = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'optional': 'optional', 'role': 'role', 'scope': 'scope'} + def __init__(self, interface=None, limit=None, name=None, optional=None, role=None, scope=None, **unknown_fields): + ''' + interface : str + limit : int + name : str + optional : bool + role : str + scope : str + ''' + interface_ = interface + limit_ = limit + name_ = name + optional_ = optional + role_ = role + scope_ = scope - if skip_tls_verify_ is not None and not isinstance(skip_tls_verify_, bool): - raise Exception("Expected skip_tls_verify_ to be a bool, received: {}".format(type(skip_tls_verify_))) + # Validate arguments against known Juju API types. + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) - if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): - raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + if limit_ is not None and not isinstance(limit_, int): + raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - self.auth_types = auth_types_ - self.ca_certificates = ca_certificates_ - self.config = config_ - self.endpoint = endpoint_ - self.host_cloud_region = host_cloud_region_ - self.identity_endpoint = identity_endpoint_ - self.is_controller_cloud = is_controller_cloud_ - self.region_config = region_config_ - self.regions = regions_ - self.skip_tls_verify = skip_tls_verify_ - self.storage_endpoint = storage_endpoint_ - self.type_ = type__ + if optional_ is not None and not isinstance(optional_, bool): + raise Exception("Expected optional_ to be a bool, received: {}".format(type(optional_))) + + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + self.interface = interface_ + self.limit = limit_ + self.name = name_ + self.optional = optional_ + self.role = role_ + self.scope = scope_ self.unknown_fields = unknown_fields -class CloudCredential(Type): - _toSchema = {'attrs': 'attrs', 'auth_type': 'auth-type', 'redacted': 'redacted'} - _toPy = {'attrs': 'attrs', 'auth-type': 'auth_type', 'redacted': 'redacted'} - def __init__(self, attrs=None, auth_type=None, redacted=None, **unknown_fields): +class CharmResource(Type): + _toSchema = {'description': 'description', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type_': 'type'} + _toPy = {'description': 'description', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type': 'type_'} + def __init__(self, description=None, fingerprint=None, name=None, origin=None, path=None, revision=None, size=None, type_=None, **unknown_fields): ''' - attrs : typing.Mapping[str, str] - auth_type : str - redacted : typing.Sequence[str] + description : str + fingerprint : typing.Sequence[int] + name : str + origin : str + path : str + revision : int + size : int + type_ : str ''' - attrs_ = attrs - auth_type_ = auth_type - redacted_ = redacted + description_ = description + fingerprint_ = fingerprint + name_ = name + origin_ = origin + path_ = path + revision_ = revision + size_ = size + type__ = type_ # Validate arguments against known Juju API types. - if attrs_ is not None and not isinstance(attrs_, dict): - raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) - - if auth_type_ is not None and not isinstance(auth_type_, (bytes, str)): - raise Exception("Expected auth_type_ to be a str, received: {}".format(type(auth_type_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if redacted_ is not None and not isinstance(redacted_, (bytes, str, list)): - raise Exception("Expected redacted_ to be a Sequence, received: {}".format(type(redacted_))) + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): + raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) - self.attrs = attrs_ - self.auth_type = auth_type_ - self.redacted = redacted_ - self.unknown_fields = unknown_fields + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) -class CloudCredentialArg(Type): - _toSchema = {'cloud_name': 'cloud-name', 'credential_name': 'credential-name'} - _toPy = {'cloud-name': 'cloud_name', 'credential-name': 'credential_name'} - def __init__(self, cloud_name=None, credential_name=None, **unknown_fields): - ''' - cloud_name : str - credential_name : str - ''' - cloud_name_ = cloud_name - credential_name_ = credential_name + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - # Validate arguments against known Juju API types. - if cloud_name_ is not None and not isinstance(cloud_name_, (bytes, str)): - raise Exception("Expected cloud_name_ to be a str, received: {}".format(type(cloud_name_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - if credential_name_ is not None and not isinstance(credential_name_, (bytes, str)): - raise Exception("Expected credential_name_ to be a str, received: {}".format(type(credential_name_))) + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.cloud_name = cloud_name_ - self.credential_name = credential_name_ + self.description = description_ + self.fingerprint = fingerprint_ + self.name = name_ + self.origin = origin_ + self.path = path_ + self.revision = revision_ + self.size = size_ + self.type_ = type__ self.unknown_fields = unknown_fields -class CloudCredentialArgs(Type): - _toSchema = {'credentials': 'credentials', 'include_secrets': 'include-secrets'} - _toPy = {'credentials': 'credentials', 'include-secrets': 'include_secrets'} - def __init__(self, credentials=None, include_secrets=None, **unknown_fields): +class CharmResourceMeta(Type): + _toSchema = {'description': 'description', 'name': 'name', 'path': 'path', 'type_': 'type'} + _toPy = {'description': 'description', 'name': 'name', 'path': 'path', 'type': 'type_'} + def __init__(self, description=None, name=None, path=None, type_=None, **unknown_fields): ''' - credentials : typing.Sequence[~CloudCredentialArg] - include_secrets : bool + description : str + name : str + path : str + type_ : str ''' - credentials_ = [CloudCredentialArg.from_json(o) for o in credentials or []] - include_secrets_ = include_secrets + description_ = description + name_ = name + path_ = path + type__ = type_ # Validate arguments against known Juju API types. - if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): - raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if include_secrets_ is not None and not isinstance(include_secrets_, bool): - raise Exception("Expected include_secrets_ to be a bool, received: {}".format(type(include_secrets_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - self.credentials = credentials_ - self.include_secrets = include_secrets_ + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.description = description_ + self.name = name_ + self.path = path_ + self.type_ = type__ self.unknown_fields = unknown_fields -class CloudCredentialResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class CharmResourceResult(Type): + _toSchema = {'charmresource': 'CharmResource', 'description': 'description', 'error': 'error', 'errorresult': 'ErrorResult', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type_': 'type'} + _toPy = {'CharmResource': 'charmresource', 'ErrorResult': 'errorresult', 'description': 'description', 'error': 'error', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type': 'type_'} + def __init__(self, charmresource=None, errorresult=None, description=None, error=None, fingerprint=None, name=None, origin=None, path=None, revision=None, size=None, type_=None, **unknown_fields): ''' + charmresource : CharmResource + errorresult : ErrorResult + description : str error : Error - result : CloudCredential + fingerprint : typing.Sequence[int] + name : str + origin : str + path : str + revision : int + size : int + type_ : str ''' + charmresource_ = CharmResource.from_json(charmresource) if charmresource else None + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + description_ = description error_ = Error.from_json(error) if error else None - result_ = CloudCredential.from_json(result) if result else None + fingerprint_ = fingerprint + name_ = name + origin_ = origin + path_ = path + revision_ = revision + size_ = size + type__ = type_ # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if charmresource_ is not None and not isinstance(charmresource_, (dict, CharmResource)): + raise Exception("Expected charmresource_ to be a CharmResource, received: {}".format(type(charmresource_))) - if result_ is not None and not isinstance(result_, (dict, CloudCredential)): - raise Exception("Expected result_ to be a CloudCredential, received: {}".format(type(result_))) + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) - self.error = error_ - self.result = result_ - self.unknown_fields = unknown_fields + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): + raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) -class CloudCredentialResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): - ''' - results : typing.Sequence[~CloudCredentialResult] - ''' - results_ = [CloudCredentialResult.from_json(o) for o in results or []] + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) - self.results = results_ - self.unknown_fields = unknown_fields + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) -class CloudDetails(Type): - _toSchema = {'auth_types': 'auth-types', 'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'regions': 'regions', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} - _toPy = {'auth-types': 'auth_types', 'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'regions': 'regions', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} - def __init__(self, auth_types=None, endpoint=None, identity_endpoint=None, regions=None, storage_endpoint=None, type_=None, **unknown_fields): - ''' - auth_types : typing.Sequence[str] - endpoint : str - identity_endpoint : str - regions : typing.Sequence[~CloudRegion] - storage_endpoint : str - type_ : str - ''' - auth_types_ = auth_types - endpoint_ = endpoint - identity_endpoint_ = identity_endpoint - regions_ = [CloudRegion.from_json(o) for o in regions or []] - storage_endpoint_ = storage_endpoint - type__ = type_ - - # Validate arguments against known Juju API types. - if auth_types_ is not None and not isinstance(auth_types_, (bytes, str, list)): - raise Exception("Expected auth_types_ to be a Sequence, received: {}".format(type(auth_types_))) + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): - raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + self.charmresource = charmresource_ + self.errorresult = errorresult_ + self.description = description_ + self.error = error_ + self.fingerprint = fingerprint_ + self.name = name_ + self.origin = origin_ + self.path = path_ + self.revision = revision_ + self.size = size_ + self.type_ = type__ + self.unknown_fields = unknown_fields - if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): - raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) - if regions_ is not None and not isinstance(regions_, (bytes, str, list)): - raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) - if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): - raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) +class CharmResourcesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CharmResourceResult] + ''' + results_ = [CharmResourceResult.from_json(o) for o in results or []] - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.auth_types = auth_types_ - self.endpoint = endpoint_ - self.identity_endpoint = identity_endpoint_ - self.regions = regions_ - self.storage_endpoint = storage_endpoint_ - self.type_ = type__ + self.results = results_ self.unknown_fields = unknown_fields -class CloudImageMetadata(Type): - _toSchema = {'arch': 'arch', 'image_id': 'image-id', 'priority': 'priority', 'region': 'region', 'root_storage_size': 'root-storage-size', 'root_storage_type': 'root-storage-type', 'source': 'source', 'stream': 'stream', 'version': 'version', 'virt_type': 'virt-type'} - _toPy = {'arch': 'arch', 'image-id': 'image_id', 'priority': 'priority', 'region': 'region', 'root-storage-size': 'root_storage_size', 'root-storage-type': 'root_storage_type', 'source': 'source', 'stream': 'stream', 'version': 'version', 'virt-type': 'virt_type'} - def __init__(self, arch=None, image_id=None, priority=None, region=None, root_storage_size=None, root_storage_type=None, source=None, stream=None, version=None, virt_type=None, **unknown_fields): +class CharmStorage(Type): + _toSchema = {'count_max': 'count-max', 'count_min': 'count-min', 'description': 'description', 'location': 'location', 'minimum_size': 'minimum-size', 'name': 'name', 'properties': 'properties', 'read_only': 'read-only', 'shared': 'shared', 'type_': 'type'} + _toPy = {'count-max': 'count_max', 'count-min': 'count_min', 'description': 'description', 'location': 'location', 'minimum-size': 'minimum_size', 'name': 'name', 'properties': 'properties', 'read-only': 'read_only', 'shared': 'shared', 'type': 'type_'} + def __init__(self, count_max=None, count_min=None, description=None, location=None, minimum_size=None, name=None, properties=None, read_only=None, shared=None, type_=None, **unknown_fields): ''' - arch : str - image_id : str - priority : int - region : str - root_storage_size : int - root_storage_type : str - source : str - stream : str - version : str - virt_type : str + count_max : int + count_min : int + description : str + location : str + minimum_size : int + name : str + properties : typing.Sequence[str] + read_only : bool + shared : bool + type_ : str ''' - arch_ = arch - image_id_ = image_id - priority_ = priority - region_ = region - root_storage_size_ = root_storage_size - root_storage_type_ = root_storage_type - source_ = source - stream_ = stream - version_ = version - virt_type_ = virt_type + count_max_ = count_max + count_min_ = count_min + description_ = description + location_ = location + minimum_size_ = minimum_size + name_ = name + properties_ = properties + read_only_ = read_only + shared_ = shared + type__ = type_ # Validate arguments against known Juju API types. - if arch_ is not None and not isinstance(arch_, (bytes, str)): - raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + if count_max_ is not None and not isinstance(count_max_, int): + raise Exception("Expected count_max_ to be a int, received: {}".format(type(count_max_))) - if image_id_ is not None and not isinstance(image_id_, (bytes, str)): - raise Exception("Expected image_id_ to be a str, received: {}".format(type(image_id_))) + if count_min_ is not None and not isinstance(count_min_, int): + raise Exception("Expected count_min_ to be a int, received: {}".format(type(count_min_))) - if priority_ is not None and not isinstance(priority_, int): - raise Exception("Expected priority_ to be a int, received: {}".format(type(priority_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if region_ is not None and not isinstance(region_, (bytes, str)): - raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) - if root_storage_size_ is not None and not isinstance(root_storage_size_, int): - raise Exception("Expected root_storage_size_ to be a int, received: {}".format(type(root_storage_size_))) + if minimum_size_ is not None and not isinstance(minimum_size_, int): + raise Exception("Expected minimum_size_ to be a int, received: {}".format(type(minimum_size_))) - if 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 name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if source_ is not None and not isinstance(source_, (bytes, str)): - raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) + if properties_ is not None and not isinstance(properties_, (bytes, str, list)): + raise Exception("Expected properties_ to be a Sequence, received: {}".format(type(properties_))) - if stream_ is not None and not isinstance(stream_, (bytes, str)): - raise Exception("Expected stream_ to be a str, received: {}".format(type(stream_))) + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) - if version_ is not None and not isinstance(version_, (bytes, str)): - raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + if shared_ is not None and not isinstance(shared_, bool): + raise Exception("Expected shared_ to be a bool, received: {}".format(type(shared_))) - if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): - raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.arch = arch_ - self.image_id = image_id_ - self.priority = priority_ - self.region = region_ - self.root_storage_size = root_storage_size_ - self.root_storage_type = root_storage_type_ - self.source = source_ - self.stream = stream_ - self.version = version_ - self.virt_type = virt_type_ + self.count_max = count_max_ + self.count_min = count_min_ + self.description = description_ + self.location = location_ + self.minimum_size = minimum_size_ + self.name = name_ + self.properties = properties_ + self.read_only = read_only_ + self.shared = shared_ + self.type_ = type__ self.unknown_fields = unknown_fields -class CloudImageMetadataList(Type): - _toSchema = {'metadata': 'metadata'} - _toPy = {'metadata': 'metadata'} - def __init__(self, metadata=None, **unknown_fields): +class CharmURL(Type): + _toSchema = {'url': 'url'} + _toPy = {'url': 'url'} + def __init__(self, url=None, **unknown_fields): ''' - metadata : typing.Sequence[~CloudImageMetadata] + url : str ''' - metadata_ = [CloudImageMetadata.from_json(o) for o in metadata or []] + url_ = url # Validate arguments against known Juju API types. - if metadata_ is not None and not isinstance(metadata_, (bytes, str, list)): - raise Exception("Expected metadata_ to be a Sequence, received: {}".format(type(metadata_))) + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) - self.metadata = metadata_ + self.url = url_ self.unknown_fields = unknown_fields -class CloudInfo(Type): - _toSchema = {'clouddetails': 'CloudDetails', 'users': 'users'} - _toPy = {'CloudDetails': 'clouddetails', 'users': 'users'} - def __init__(self, clouddetails=None, users=None, **unknown_fields): +class CharmURLAndOrigin(Type): + _toSchema = {'charm_origin': 'charm-origin', 'charm_url': 'charm-url', 'macaroon': 'macaroon'} + _toPy = {'charm-origin': 'charm_origin', 'charm-url': 'charm_url', 'macaroon': 'macaroon'} + def __init__(self, charm_origin=None, charm_url=None, macaroon=None, **unknown_fields): ''' - clouddetails : CloudDetails - users : typing.Sequence[~CloudUserInfo] + charm_origin : CharmOrigin + charm_url : str + macaroon : Macaroon ''' - clouddetails_ = CloudDetails.from_json(clouddetails) if clouddetails else None - users_ = [CloudUserInfo.from_json(o) for o in users or []] + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + charm_url_ = charm_url + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None # Validate arguments against known Juju API types. - if clouddetails_ is not None and not isinstance(clouddetails_, (dict, CloudDetails)): - raise Exception("Expected clouddetails_ to be a CloudDetails, received: {}".format(type(clouddetails_))) + if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): + raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) - if users_ is not None and not isinstance(users_, (bytes, str, list)): - raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + if charm_url_ is not None and not isinstance(charm_url_, (bytes, str)): + raise Exception("Expected charm_url_ to be a str, received: {}".format(type(charm_url_))) - self.clouddetails = clouddetails_ - self.users = users_ + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + self.charm_origin = charm_origin_ + self.charm_url = charm_url_ + self.macaroon = macaroon_ self.unknown_fields = unknown_fields -class CloudInfoResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class CharmURLAndOrigins(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' - error : Error - result : CloudInfo + entities : typing.Sequence[~CharmURLAndOrigin] ''' - error_ = Error.from_json(error) if error else None - result_ = CloudInfo.from_json(result) if result else None + entities_ = [CharmURLAndOrigin.from_json(o) for o in entities or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if result_ is not None and not isinstance(result_, (dict, CloudInfo)): - raise Exception("Expected result_ to be a CloudInfo, received: {}".format(type(result_))) + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - self.error = error_ - self.result = result_ + self.entities = entities_ self.unknown_fields = unknown_fields -class CloudInfoResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): - ''' - results : typing.Sequence[~CloudInfoResult] +class CharmURLOriginResult(Type): + _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'url': 'url'} + _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'url': 'url'} + def __init__(self, charm_origin=None, error=None, url=None, **unknown_fields): ''' - results_ = [CloudInfoResult.from_json(o) for o in results or []] + charm_origin : CharmOrigin + error : Error + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + error_ = Error.from_json(error) if error else None + url_ = url # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): + raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) - self.results = results_ + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.error = error_ + self.url = url_ self.unknown_fields = unknown_fields -class CloudInstanceTypesConstraint(Type): - _toSchema = {'cloud_tag': 'cloud-tag', 'constraints': 'constraints', 'region': 'region'} - _toPy = {'cloud-tag': 'cloud_tag', 'constraints': 'constraints', 'region': 'region'} - def __init__(self, cloud_tag=None, constraints=None, region=None, **unknown_fields): +class CharmURLs(Type): + _toSchema = {'urls': 'urls'} + _toPy = {'urls': 'urls'} + def __init__(self, urls=None, **unknown_fields): ''' - cloud_tag : str - constraints : Value - region : str + urls : typing.Sequence[~CharmURL] ''' - cloud_tag_ = cloud_tag - constraints_ = Value.from_json(constraints) if constraints else None - region_ = region + urls_ = [CharmURL.from_json(o) for o in urls or []] # Validate arguments against known Juju API types. - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) - - if constraints_ is not None and not isinstance(constraints_, (dict, Value)): - raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) - - if region_ is not None and not isinstance(region_, (bytes, str)): - raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + if urls_ is not None and not isinstance(urls_, (bytes, str, list)): + raise Exception("Expected urls_ to be a Sequence, received: {}".format(type(urls_))) - self.cloud_tag = cloud_tag_ - self.constraints = constraints_ - self.region = region_ + self.urls = urls_ self.unknown_fields = unknown_fields -class CloudInstanceTypesConstraints(Type): - _toSchema = {'constraints': 'constraints'} - _toPy = {'constraints': 'constraints'} - def __init__(self, constraints=None, **unknown_fields): +class CharmsList(Type): + _toSchema = {'names': 'names'} + _toPy = {'names': 'names'} + def __init__(self, names=None, **unknown_fields): ''' - constraints : typing.Sequence[~CloudInstanceTypesConstraint] + names : typing.Sequence[str] ''' - constraints_ = [CloudInstanceTypesConstraint.from_json(o) for o in constraints or []] + names_ = names # Validate arguments against known Juju API types. - if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): - raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + if names_ is not None and not isinstance(names_, (bytes, str, list)): + raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) - self.constraints = constraints_ + self.names = names_ self.unknown_fields = unknown_fields -class CloudRegion(Type): - _toSchema = {'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'name': 'name', 'storage_endpoint': 'storage-endpoint'} - _toPy = {'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'name': 'name', 'storage-endpoint': 'storage_endpoint'} - def __init__(self, endpoint=None, identity_endpoint=None, name=None, storage_endpoint=None, **unknown_fields): +class CharmsListResult(Type): + _toSchema = {'charm_urls': 'charm-urls'} + _toPy = {'charm-urls': 'charm_urls'} + def __init__(self, charm_urls=None, **unknown_fields): ''' - endpoint : str - identity_endpoint : str - name : str - storage_endpoint : str + charm_urls : typing.Sequence[str] ''' - endpoint_ = endpoint - identity_endpoint_ = identity_endpoint - name_ = name - storage_endpoint_ = storage_endpoint + charm_urls_ = charm_urls # Validate arguments against known Juju API types. - if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): - raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) - - if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): - raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): - raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + if charm_urls_ is not None and not isinstance(charm_urls_, (bytes, str, list)): + raise Exception("Expected charm_urls_ to be a Sequence, received: {}".format(type(charm_urls_))) - self.endpoint = endpoint_ - self.identity_endpoint = identity_endpoint_ - self.name = name_ - self.storage_endpoint = storage_endpoint_ + self.charm_urls = charm_urls_ self.unknown_fields = unknown_fields -class CloudResult(Type): - _toSchema = {'cloud': 'cloud', 'error': 'error'} - _toPy = {'cloud': 'cloud', 'error': 'error'} - def __init__(self, cloud=None, error=None, **unknown_fields): +class ClaimLeadershipBulkParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' - cloud : Cloud - error : Error + params : typing.Sequence[~ClaimLeadershipParams] ''' - cloud_ = Cloud.from_json(cloud) if cloud else None - error_ = Error.from_json(error) if error else None + params_ = [ClaimLeadershipParams.from_json(o) for o in params or []] # Validate arguments against known Juju API types. - if cloud_ is not None and not isinstance(cloud_, (dict, Cloud)): - raise Exception("Expected cloud_ to be a Cloud, received: {}".format(type(cloud_))) - - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) - self.cloud = cloud_ - self.error = error_ + self.params = params_ self.unknown_fields = unknown_fields -class CloudResults(Type): +class ClaimLeadershipBulkResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~CloudResult] + results : typing.Sequence[~ErrorResult] ''' - results_ = [CloudResult.from_json(o) for o in results or []] + results_ = [ErrorResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -4645,54 +5467,94 @@ def __init__(self, results=None, **unknown_fields): -class CloudSpec(Type): - _toSchema = {'cacertificates': 'cacertificates', 'credential': 'credential', 'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'is_controller_cloud': 'is-controller-cloud', 'name': 'name', 'region': 'region', 'skip_tls_verify': 'skip-tls-verify', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} - _toPy = {'cacertificates': 'cacertificates', 'credential': 'credential', 'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'is-controller-cloud': 'is_controller_cloud', 'name': 'name', 'region': 'region', 'skip-tls-verify': 'skip_tls_verify', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} - def __init__(self, cacertificates=None, credential=None, endpoint=None, identity_endpoint=None, is_controller_cloud=None, name=None, region=None, skip_tls_verify=None, storage_endpoint=None, type_=None, **unknown_fields): +class ClaimLeadershipParams(Type): + _toSchema = {'application_tag': 'application-tag', 'duration': 'duration', 'unit_tag': 'unit-tag'} + _toPy = {'application-tag': 'application_tag', 'duration': 'duration', 'unit-tag': 'unit_tag'} + def __init__(self, application_tag=None, duration=None, unit_tag=None, **unknown_fields): ''' - cacertificates : typing.Sequence[str] - credential : CloudCredential + application_tag : str + duration : float + unit_tag : str + ''' + application_tag_ = application_tag + duration_ = duration + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if duration_ is not None and not isinstance(duration_, float): + raise Exception("Expected duration_ to be a float, received: {}".format(type(duration_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.application_tag = application_tag_ + self.duration = duration_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class Cloud(Type): + _toSchema = {'auth_types': 'auth-types', 'ca_certificates': 'ca-certificates', 'config': 'config', 'endpoint': 'endpoint', 'host_cloud_region': 'host-cloud-region', 'identity_endpoint': 'identity-endpoint', 'is_controller_cloud': 'is-controller-cloud', 'region_config': 'region-config', 'regions': 'regions', 'skip_tls_verify': 'skip-tls-verify', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} + _toPy = {'auth-types': 'auth_types', 'ca-certificates': 'ca_certificates', 'config': 'config', 'endpoint': 'endpoint', 'host-cloud-region': 'host_cloud_region', 'identity-endpoint': 'identity_endpoint', 'is-controller-cloud': 'is_controller_cloud', 'region-config': 'region_config', 'regions': 'regions', 'skip-tls-verify': 'skip_tls_verify', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} + def __init__(self, auth_types=None, ca_certificates=None, config=None, endpoint=None, host_cloud_region=None, identity_endpoint=None, is_controller_cloud=None, region_config=None, regions=None, skip_tls_verify=None, storage_endpoint=None, type_=None, **unknown_fields): + ''' + auth_types : typing.Sequence[str] + ca_certificates : typing.Sequence[str] + config : typing.Mapping[str, typing.Any] endpoint : str + host_cloud_region : str identity_endpoint : str is_controller_cloud : bool - name : str - region : str + region_config : typing.Mapping[str, typing.Any] + regions : typing.Sequence[~CloudRegion] skip_tls_verify : bool storage_endpoint : str type_ : str ''' - cacertificates_ = cacertificates - credential_ = CloudCredential.from_json(credential) if credential else None + auth_types_ = auth_types + ca_certificates_ = ca_certificates + config_ = config endpoint_ = endpoint + host_cloud_region_ = host_cloud_region identity_endpoint_ = identity_endpoint is_controller_cloud_ = is_controller_cloud - name_ = name - region_ = region + region_config_ = region_config + regions_ = [CloudRegion.from_json(o) for o in regions or []] skip_tls_verify_ = skip_tls_verify storage_endpoint_ = storage_endpoint type__ = type_ # Validate arguments against known Juju API types. - if cacertificates_ is not None and not isinstance(cacertificates_, (bytes, str, list)): - raise Exception("Expected cacertificates_ to be a Sequence, received: {}".format(type(cacertificates_))) + if auth_types_ is not None and not isinstance(auth_types_, (bytes, str, list)): + raise Exception("Expected auth_types_ to be a Sequence, received: {}".format(type(auth_types_))) - if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): - raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) + if ca_certificates_ is not None and not isinstance(ca_certificates_, (bytes, str, list)): + raise Exception("Expected ca_certificates_ to be a Sequence, received: {}".format(type(ca_certificates_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + if host_cloud_region_ is not None and not isinstance(host_cloud_region_, (bytes, str)): + raise Exception("Expected host_cloud_region_ to be a str, received: {}".format(type(host_cloud_region_))) + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) if is_controller_cloud_ is not None and not isinstance(is_controller_cloud_, bool): raise Exception("Expected is_controller_cloud_ to be a bool, received: {}".format(type(is_controller_cloud_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if region_config_ is not None and not isinstance(region_config_, dict): + raise Exception("Expected region_config_ to be a Mapping, received: {}".format(type(region_config_))) - if region_ is not None and not isinstance(region_, (bytes, str)): - raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + if regions_ is not None and not isinstance(regions_, (bytes, str, list)): + raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) if skip_tls_verify_ is not None and not isinstance(skip_tls_verify_, bool): raise Exception("Expected skip_tls_verify_ to be a bool, received: {}".format(type(skip_tls_verify_))) @@ -4703,13 +5565,15 @@ def __init__(self, cacertificates=None, credential=None, endpoint=None, identity if type__ is not None and not isinstance(type__, (bytes, str)): raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.cacertificates = cacertificates_ - self.credential = credential_ + self.auth_types = auth_types_ + self.ca_certificates = ca_certificates_ + self.config = config_ self.endpoint = endpoint_ + self.host_cloud_region = host_cloud_region_ self.identity_endpoint = identity_endpoint_ self.is_controller_cloud = is_controller_cloud_ - self.name = name_ - self.region = region_ + self.region_config = region_config_ + self.regions = regions_ self.skip_tls_verify = skip_tls_verify_ self.storage_endpoint = storage_endpoint_ self.type_ = type__ @@ -4717,437 +5581,446 @@ def __init__(self, cacertificates=None, credential=None, endpoint=None, identity -class CloudSpecResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class CloudCredential(Type): + _toSchema = {'attrs': 'attrs', 'auth_type': 'auth-type', 'redacted': 'redacted'} + _toPy = {'attrs': 'attrs', 'auth-type': 'auth_type', 'redacted': 'redacted'} + def __init__(self, attrs=None, auth_type=None, redacted=None, **unknown_fields): ''' - error : Error - result : CloudSpec + attrs : typing.Mapping[str, str] + auth_type : str + redacted : typing.Sequence[str] ''' - error_ = Error.from_json(error) if error else None - result_ = CloudSpec.from_json(result) if result else None + attrs_ = attrs + auth_type_ = auth_type + redacted_ = redacted # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if attrs_ is not None and not isinstance(attrs_, dict): + raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) - if result_ is not None and not isinstance(result_, (dict, CloudSpec)): - raise Exception("Expected result_ to be a CloudSpec, received: {}".format(type(result_))) + if auth_type_ is not None and not isinstance(auth_type_, (bytes, str)): + raise Exception("Expected auth_type_ to be a str, received: {}".format(type(auth_type_))) - self.error = error_ - self.result = result_ + if redacted_ is not None and not isinstance(redacted_, (bytes, str, list)): + raise Exception("Expected redacted_ to be a Sequence, received: {}".format(type(redacted_))) + + self.attrs = attrs_ + self.auth_type = auth_type_ + self.redacted = redacted_ self.unknown_fields = unknown_fields -class CloudSpecResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class CloudCredentialArg(Type): + _toSchema = {'cloud_name': 'cloud-name', 'credential_name': 'credential-name'} + _toPy = {'cloud-name': 'cloud_name', 'credential-name': 'credential_name'} + def __init__(self, cloud_name=None, credential_name=None, **unknown_fields): ''' - results : typing.Sequence[~CloudSpecResult] + cloud_name : str + credential_name : str ''' - results_ = [CloudSpecResult.from_json(o) for o in results or []] + cloud_name_ = cloud_name + credential_name_ = credential_name # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if cloud_name_ is not None and not isinstance(cloud_name_, (bytes, str)): + raise Exception("Expected cloud_name_ to be a str, received: {}".format(type(cloud_name_))) - self.results = results_ + if credential_name_ is not None and not isinstance(credential_name_, (bytes, str)): + raise Exception("Expected credential_name_ to be a str, received: {}".format(type(credential_name_))) + + self.cloud_name = cloud_name_ + self.credential_name = credential_name_ self.unknown_fields = unknown_fields -class CloudUserInfo(Type): - _toSchema = {'access': 'access', 'display_name': 'display-name', 'user': 'user'} - _toPy = {'access': 'access', 'display-name': 'display_name', 'user': 'user'} - def __init__(self, access=None, display_name=None, user=None, **unknown_fields): +class CloudCredentialArgs(Type): + _toSchema = {'credentials': 'credentials', 'include_secrets': 'include-secrets'} + _toPy = {'credentials': 'credentials', 'include-secrets': 'include_secrets'} + def __init__(self, credentials=None, include_secrets=None, **unknown_fields): ''' - access : str - display_name : str - user : str + credentials : typing.Sequence[~CloudCredentialArg] + include_secrets : bool ''' - access_ = access - display_name_ = display_name - user_ = user + credentials_ = [CloudCredentialArg.from_json(o) for o in credentials or []] + include_secrets_ = include_secrets # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if display_name_ is not None and not isinstance(display_name_, (bytes, str)): - raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) - if user_ is not None and not isinstance(user_, (bytes, str)): - raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + if include_secrets_ is not None and not isinstance(include_secrets_, bool): + raise Exception("Expected include_secrets_ to be a bool, received: {}".format(type(include_secrets_))) - self.access = access_ - self.display_name = display_name_ - self.user = user_ + self.credentials = credentials_ + self.include_secrets = include_secrets_ self.unknown_fields = unknown_fields -class CloudsResult(Type): - _toSchema = {'clouds': 'clouds'} - _toPy = {'clouds': 'clouds'} - def __init__(self, clouds=None, **unknown_fields): +class CloudCredentialResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - clouds : typing.Mapping[str, ~Cloud] + error : Error + result : CloudCredential ''' - clouds_ = {k: Cloud.from_json(v) for k, v in (clouds or dict()).items()} + error_ = Error.from_json(error) if error else None + result_ = CloudCredential.from_json(result) if result else None # Validate arguments against known Juju API types. - if clouds_ is not None and not isinstance(clouds_, dict): - raise Exception("Expected clouds_ to be a Mapping, received: {}".format(type(clouds_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.clouds = clouds_ + if result_ is not None and not isinstance(result_, (dict, CloudCredential)): + raise Exception("Expected result_ to be a CloudCredential, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class ConfigResult(Type): - _toSchema = {'config': 'config', 'error': 'error'} - _toPy = {'config': 'config', 'error': 'error'} - def __init__(self, config=None, error=None, **unknown_fields): +class CloudCredentialResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - config : typing.Mapping[str, typing.Any] - error : Error + results : typing.Sequence[~CloudCredentialResult] ''' - config_ = config - error_ = Error.from_json(error) if error else None + results_ = [CloudCredentialResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.config = config_ - self.error = error_ + self.results = results_ self.unknown_fields = unknown_fields -class ConfigSet(Type): - _toSchema = {'application': 'application', 'config': 'config', 'config_yaml': 'config-yaml', 'generation': 'generation'} - _toPy = {'application': 'application', 'config': 'config', 'config-yaml': 'config_yaml', 'generation': 'generation'} - def __init__(self, application=None, config=None, config_yaml=None, generation=None, **unknown_fields): +class CloudDetails(Type): + _toSchema = {'auth_types': 'auth-types', 'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'regions': 'regions', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} + _toPy = {'auth-types': 'auth_types', 'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'regions': 'regions', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} + def __init__(self, auth_types=None, endpoint=None, identity_endpoint=None, regions=None, storage_endpoint=None, type_=None, **unknown_fields): ''' - application : str - config : typing.Mapping[str, str] - config_yaml : str - generation : str + auth_types : typing.Sequence[str] + endpoint : str + identity_endpoint : str + regions : typing.Sequence[~CloudRegion] + storage_endpoint : str + type_ : str ''' - application_ = application - config_ = config - config_yaml_ = config_yaml - generation_ = generation + auth_types_ = auth_types + endpoint_ = endpoint + identity_endpoint_ = identity_endpoint + regions_ = [CloudRegion.from_json(o) for o in regions or []] + storage_endpoint_ = storage_endpoint + type__ = type_ # Validate arguments against known Juju API types. - if application_ is not None and not isinstance(application_, (bytes, str)): - raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + if auth_types_ is not None and not isinstance(auth_types_, (bytes, str, list)): + raise Exception("Expected auth_types_ to be a Sequence, received: {}".format(type(auth_types_))) - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) - if config_yaml_ is not None and not isinstance(config_yaml_, (bytes, str)): - raise Exception("Expected config_yaml_ to be a str, received: {}".format(type(config_yaml_))) + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) - if generation_ is not None and not isinstance(generation_, (bytes, str)): - raise Exception("Expected generation_ to be a str, received: {}".format(type(generation_))) + if regions_ is not None and not isinstance(regions_, (bytes, str, list)): + raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) - self.application = application_ - self.config = config_ - self.config_yaml = config_yaml_ - self.generation = generation_ + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.auth_types = auth_types_ + self.endpoint = endpoint_ + self.identity_endpoint = identity_endpoint_ + self.regions = regions_ + self.storage_endpoint = storage_endpoint_ + self.type_ = type__ self.unknown_fields = unknown_fields -class ConfigSetArgs(Type): - _toSchema = {'args': 'Args'} - _toPy = {'Args': 'args'} - def __init__(self, args=None, **unknown_fields): +class CloudImageMetadata(Type): + _toSchema = {'arch': 'arch', 'image_id': 'image-id', 'priority': 'priority', 'region': 'region', 'root_storage_size': 'root-storage-size', 'root_storage_type': 'root-storage-type', 'source': 'source', 'stream': 'stream', 'version': 'version', 'virt_type': 'virt-type'} + _toPy = {'arch': 'arch', 'image-id': 'image_id', 'priority': 'priority', 'region': 'region', 'root-storage-size': 'root_storage_size', 'root-storage-type': 'root_storage_type', 'source': 'source', 'stream': 'stream', 'version': 'version', 'virt-type': 'virt_type'} + def __init__(self, arch=None, image_id=None, priority=None, region=None, root_storage_size=None, root_storage_type=None, source=None, stream=None, version=None, virt_type=None, **unknown_fields): ''' - args : typing.Sequence[~ConfigSet] + arch : str + image_id : str + priority : int + region : str + root_storage_size : int + root_storage_type : str + source : str + stream : str + version : str + virt_type : str ''' - args_ = [ConfigSet.from_json(o) for o in args or []] + arch_ = arch + image_id_ = image_id + priority_ = priority + region_ = region + root_storage_size_ = root_storage_size + root_storage_type_ = root_storage_type + source_ = source + stream_ = stream + version_ = version + virt_type_ = virt_type # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) - self.args = args_ - self.unknown_fields = unknown_fields + if image_id_ is not None and not isinstance(image_id_, (bytes, str)): + raise Exception("Expected image_id_ to be a str, received: {}".format(type(image_id_))) + if priority_ is not None and not isinstance(priority_, int): + raise Exception("Expected priority_ to be a int, received: {}".format(type(priority_))) + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) -class ConfigValue(Type): - _toSchema = {'source': 'source', 'value': 'value'} - _toPy = {'source': 'source', 'value': 'value'} - def __init__(self, source=None, value=None, **unknown_fields): - ''' - source : str - value : Any - ''' - source_ = source - value_ = value + if root_storage_size_ is not None and not isinstance(root_storage_size_, int): + raise Exception("Expected root_storage_size_ to be a int, received: {}".format(type(root_storage_size_))) + + if root_storage_type_ is not None and not isinstance(root_storage_type_, (bytes, str)): + raise Exception("Expected root_storage_type_ to be a str, received: {}".format(type(root_storage_type_))) - # Validate arguments against known Juju API types. if source_ is not None and not isinstance(source_, (bytes, str)): raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) + if stream_ is not None and not isinstance(stream_, (bytes, str)): + raise Exception("Expected stream_ to be a str, received: {}".format(type(stream_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): + raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + + self.arch = arch_ + self.image_id = image_id_ + self.priority = priority_ + self.region = region_ + self.root_storage_size = root_storage_size_ + self.root_storage_type = root_storage_type_ self.source = source_ - self.value = value_ + self.stream = stream_ + self.version = version_ + self.virt_type = virt_type_ self.unknown_fields = unknown_fields -class Constraints(Type): - _toSchema = {'count': 'Count', 'pool': 'Pool', 'size': 'Size'} - _toPy = {'Count': 'count', 'Pool': 'pool', 'Size': 'size'} - def __init__(self, count=None, pool=None, size=None, **unknown_fields): +class CloudImageMetadataList(Type): + _toSchema = {'metadata': 'metadata'} + _toPy = {'metadata': 'metadata'} + def __init__(self, metadata=None, **unknown_fields): ''' - count : int - pool : str - size : int + metadata : typing.Sequence[~CloudImageMetadata] ''' - count_ = count - pool_ = pool - size_ = size + metadata_ = [CloudImageMetadata.from_json(o) for o in metadata or []] # Validate arguments against known Juju API types. - if count_ is not None and not isinstance(count_, int): - raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) - - if pool_ is not None and not isinstance(pool_, (bytes, str)): - raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) - - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + if metadata_ is not None and not isinstance(metadata_, (bytes, str, list)): + raise Exception("Expected metadata_ to be a Sequence, received: {}".format(type(metadata_))) - self.count = count_ - self.pool = pool_ - self.size = size_ + self.metadata = metadata_ self.unknown_fields = unknown_fields -class ConsumeApplicationArg(Type): - _toSchema = {'application_alias': 'application-alias', 'application_description': 'application-description', 'applicationofferdetails': 'ApplicationOfferDetails', 'bindings': 'bindings', 'endpoints': 'endpoints', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces', 'users': 'users'} - _toPy = {'ApplicationOfferDetails': 'applicationofferdetails', 'application-alias': 'application_alias', 'application-description': 'application_description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces', 'users': 'users'} - def __init__(self, applicationofferdetails=None, application_alias=None, application_description=None, bindings=None, endpoints=None, external_controller=None, macaroon=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, spaces=None, users=None, **unknown_fields): +class CloudInfo(Type): + _toSchema = {'clouddetails': 'CloudDetails', 'users': 'users'} + _toPy = {'CloudDetails': 'clouddetails', 'users': 'users'} + def __init__(self, clouddetails=None, users=None, **unknown_fields): ''' - applicationofferdetails : ApplicationOfferDetails - application_alias : str - application_description : str - bindings : typing.Mapping[str, str] - endpoints : typing.Sequence[~RemoteEndpoint] - external_controller : ExternalControllerInfo - macaroon : Macaroon - offer_name : str - offer_url : str - offer_uuid : str - source_model_tag : str - spaces : typing.Sequence[~RemoteSpace] - users : typing.Sequence[~OfferUserDetails] + clouddetails : CloudDetails + users : typing.Sequence[~CloudUserInfo] ''' - applicationofferdetails_ = ApplicationOfferDetails.from_json(applicationofferdetails) if applicationofferdetails else None - application_alias_ = application_alias - application_description_ = application_description - bindings_ = bindings - endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] - external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None - macaroon_ = Macaroon.from_json(macaroon) if macaroon else None - offer_name_ = offer_name - offer_url_ = offer_url - offer_uuid_ = offer_uuid - source_model_tag_ = source_model_tag - spaces_ = [RemoteSpace.from_json(o) for o in spaces or []] - users_ = [OfferUserDetails.from_json(o) for o in users or []] + clouddetails_ = CloudDetails.from_json(clouddetails) if clouddetails else None + users_ = [CloudUserInfo.from_json(o) for o in users or []] # Validate arguments against known Juju API types. - if applicationofferdetails_ is not None and not isinstance(applicationofferdetails_, (dict, ApplicationOfferDetails)): - raise Exception("Expected applicationofferdetails_ to be a ApplicationOfferDetails, received: {}".format(type(applicationofferdetails_))) + if clouddetails_ is not None and not isinstance(clouddetails_, (dict, CloudDetails)): + raise Exception("Expected clouddetails_ to be a CloudDetails, received: {}".format(type(clouddetails_))) - if application_alias_ is not None and not isinstance(application_alias_, (bytes, str)): - raise Exception("Expected application_alias_ to be a str, received: {}".format(type(application_alias_))) + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) - if application_description_ is not None and not isinstance(application_description_, (bytes, str)): - raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) + self.clouddetails = clouddetails_ + self.users = users_ + self.unknown_fields = unknown_fields - if bindings_ is not None and not isinstance(bindings_, dict): - raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) - if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): - raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) - if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): - raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) +class CloudInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : CloudInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = CloudInfo.from_json(result) if result else None - if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): - raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): - raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + if result_ is not None and not isinstance(result_, (dict, CloudInfo)): + raise Exception("Expected result_ to be a CloudInfo, received: {}".format(type(result_))) - if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): - raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields - if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): - raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) - if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): - raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) - if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): - raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) +class CloudInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CloudInfoResult] + ''' + results_ = [CloudInfoResult.from_json(o) for o in results or []] - if users_ is not None and not isinstance(users_, (bytes, str, list)): - raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.applicationofferdetails = applicationofferdetails_ - self.application_alias = application_alias_ - self.application_description = application_description_ - self.bindings = bindings_ - self.endpoints = endpoints_ - self.external_controller = external_controller_ - self.macaroon = macaroon_ - self.offer_name = offer_name_ - self.offer_url = offer_url_ - self.offer_uuid = offer_uuid_ - self.source_model_tag = source_model_tag_ - self.spaces = spaces_ - self.users = users_ + self.results = results_ self.unknown_fields = unknown_fields -class ConsumeApplicationArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class CloudInstanceTypesConstraint(Type): + _toSchema = {'cloud_tag': 'cloud-tag', 'constraints': 'constraints', 'region': 'region'} + _toPy = {'cloud-tag': 'cloud_tag', 'constraints': 'constraints', 'region': 'region'} + def __init__(self, cloud_tag=None, constraints=None, region=None, **unknown_fields): ''' - args : typing.Sequence[~ConsumeApplicationArg] + cloud_tag : str + constraints : Value + region : str ''' - args_ = [ConsumeApplicationArg.from_json(o) for o in args or []] + cloud_tag_ = cloud_tag + constraints_ = Value.from_json(constraints) if constraints else None + region_ = region # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) - self.args = args_ + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + self.cloud_tag = cloud_tag_ + self.constraints = constraints_ + self.region = region_ self.unknown_fields = unknown_fields -class ConsumeOfferDetails(Type): - _toSchema = {'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} - _toPy = {'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} - def __init__(self, external_controller=None, macaroon=None, offer=None, **unknown_fields): +class CloudInstanceTypesConstraints(Type): + _toSchema = {'constraints': 'constraints'} + _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): ''' - external_controller : ExternalControllerInfo - macaroon : Macaroon - offer : ApplicationOfferDetails + constraints : typing.Sequence[~CloudInstanceTypesConstraint] ''' - external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None - macaroon_ = Macaroon.from_json(macaroon) if macaroon else None - offer_ = ApplicationOfferDetails.from_json(offer) if offer else None + constraints_ = [CloudInstanceTypesConstraint.from_json(o) for o in constraints or []] # Validate arguments against known Juju API types. - if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): - raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) - - if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): - raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) - - if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): - raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) + if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): + raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) - self.external_controller = external_controller_ - self.macaroon = macaroon_ - self.offer = offer_ + self.constraints = constraints_ self.unknown_fields = unknown_fields -class ConsumeOfferDetailsArg(Type): - _toSchema = {'offer_urls': 'offer-urls', 'user_tag': 'user-tag'} - _toPy = {'offer-urls': 'offer_urls', 'user-tag': 'user_tag'} - def __init__(self, offer_urls=None, user_tag=None, **unknown_fields): +class CloudRegion(Type): + _toSchema = {'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'name': 'name', 'storage_endpoint': 'storage-endpoint'} + _toPy = {'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'name': 'name', 'storage-endpoint': 'storage_endpoint'} + def __init__(self, endpoint=None, identity_endpoint=None, name=None, storage_endpoint=None, **unknown_fields): ''' - offer_urls : OfferURLs - user_tag : str + endpoint : str + identity_endpoint : str + name : str + storage_endpoint : str ''' - offer_urls_ = OfferURLs.from_json(offer_urls) if offer_urls else None - user_tag_ = user_tag + endpoint_ = endpoint + identity_endpoint_ = identity_endpoint + name_ = name + storage_endpoint_ = storage_endpoint # Validate arguments against known Juju API types. - if offer_urls_ is not None and not isinstance(offer_urls_, (dict, OfferURLs)): - raise Exception("Expected offer_urls_ to be a OfferURLs, received: {}".format(type(offer_urls_))) + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) - self.offer_urls = offer_urls_ - self.user_tag = user_tag_ + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + self.endpoint = endpoint_ + self.identity_endpoint = identity_endpoint_ + self.name = name_ + self.storage_endpoint = storage_endpoint_ self.unknown_fields = unknown_fields -class ConsumeOfferDetailsResult(Type): - _toSchema = {'consumeofferdetails': 'ConsumeOfferDetails', 'error': 'error', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} - _toPy = {'ConsumeOfferDetails': 'consumeofferdetails', 'error': 'error', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} - def __init__(self, consumeofferdetails=None, error=None, external_controller=None, macaroon=None, offer=None, **unknown_fields): +class CloudResult(Type): + _toSchema = {'cloud': 'cloud', 'error': 'error'} + _toPy = {'cloud': 'cloud', 'error': 'error'} + def __init__(self, cloud=None, error=None, **unknown_fields): ''' - consumeofferdetails : ConsumeOfferDetails + cloud : Cloud error : Error - external_controller : ExternalControllerInfo - macaroon : Macaroon - offer : ApplicationOfferDetails ''' - consumeofferdetails_ = ConsumeOfferDetails.from_json(consumeofferdetails) if consumeofferdetails else None + cloud_ = Cloud.from_json(cloud) if cloud else None error_ = Error.from_json(error) if error else None - external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None - macaroon_ = Macaroon.from_json(macaroon) if macaroon else None - offer_ = ApplicationOfferDetails.from_json(offer) if offer else None # Validate arguments against known Juju API types. - if consumeofferdetails_ is not None and not isinstance(consumeofferdetails_, (dict, ConsumeOfferDetails)): - raise Exception("Expected consumeofferdetails_ to be a ConsumeOfferDetails, received: {}".format(type(consumeofferdetails_))) + if cloud_ is not None and not isinstance(cloud_, (dict, Cloud)): + raise Exception("Expected cloud_ to be a Cloud, received: {}".format(type(cloud_))) if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): - raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) - - if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): - raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) - - if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): - raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) - - self.consumeofferdetails = consumeofferdetails_ + self.cloud = cloud_ self.error = error_ - self.external_controller = external_controller_ - self.macaroon = macaroon_ - self.offer = offer_ self.unknown_fields = unknown_fields -class ConsumeOfferDetailsResults(Type): +class CloudResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ConsumeOfferDetailsResult] + results : typing.Sequence[~CloudResult] ''' - results_ = [ConsumeOfferDetailsResult.from_json(o) for o in results or []] + results_ = [CloudResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -5158,44 +6031,110 @@ def __init__(self, results=None, **unknown_fields): -class ControllerAPIInfoResult(Type): - _toSchema = {'addresses': 'addresses', 'cacert': 'cacert', 'error': 'error'} - _toPy = {'addresses': 'addresses', 'cacert': 'cacert', 'error': 'error'} - def __init__(self, addresses=None, cacert=None, error=None, **unknown_fields): +class CloudSpec(Type): + _toSchema = {'cacertificates': 'cacertificates', 'credential': 'credential', 'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'is_controller_cloud': 'is-controller-cloud', 'name': 'name', 'region': 'region', 'skip_tls_verify': 'skip-tls-verify', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} + _toPy = {'cacertificates': 'cacertificates', 'credential': 'credential', 'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'is-controller-cloud': 'is_controller_cloud', 'name': 'name', 'region': 'region', 'skip-tls-verify': 'skip_tls_verify', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} + def __init__(self, cacertificates=None, credential=None, endpoint=None, identity_endpoint=None, is_controller_cloud=None, name=None, region=None, skip_tls_verify=None, storage_endpoint=None, type_=None, **unknown_fields): ''' - addresses : typing.Sequence[str] - cacert : str - error : Error + cacertificates : typing.Sequence[str] + credential : CloudCredential + endpoint : str + identity_endpoint : str + is_controller_cloud : bool + name : str + region : str + skip_tls_verify : bool + storage_endpoint : str + type_ : str ''' - addresses_ = addresses - cacert_ = cacert - error_ = Error.from_json(error) if error else None + cacertificates_ = cacertificates + credential_ = CloudCredential.from_json(credential) if credential else None + endpoint_ = endpoint + identity_endpoint_ = identity_endpoint + is_controller_cloud_ = is_controller_cloud + name_ = name + region_ = region + skip_tls_verify_ = skip_tls_verify + storage_endpoint_ = storage_endpoint + type__ = type_ # Validate arguments against known Juju API types. - if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): - raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + if cacertificates_ is not None and not isinstance(cacertificates_, (bytes, str, list)): + raise Exception("Expected cacertificates_ to be a Sequence, received: {}".format(type(cacertificates_))) - if cacert_ is not None and not isinstance(cacert_, (bytes, str)): - raise Exception("Expected cacert_ to be a str, received: {}".format(type(cacert_))) + if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): + raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) + + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) + + if is_controller_cloud_ is not None and not isinstance(is_controller_cloud_, bool): + raise Exception("Expected is_controller_cloud_ to be a bool, received: {}".format(type(is_controller_cloud_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if skip_tls_verify_ is not None and not isinstance(skip_tls_verify_, bool): + raise Exception("Expected skip_tls_verify_ to be a bool, received: {}".format(type(skip_tls_verify_))) + + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.cacertificates = cacertificates_ + self.credential = credential_ + self.endpoint = endpoint_ + self.identity_endpoint = identity_endpoint_ + self.is_controller_cloud = is_controller_cloud_ + self.name = name_ + self.region = region_ + self.skip_tls_verify = skip_tls_verify_ + self.storage_endpoint = storage_endpoint_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CloudSpecResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : CloudSpec + ''' + error_ = Error.from_json(error) if error else None + result_ = CloudSpec.from_json(result) if result else None + # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.addresses = addresses_ - self.cacert = cacert_ + if result_ is not None and not isinstance(result_, (dict, CloudSpec)): + raise Exception("Expected result_ to be a CloudSpec, received: {}".format(type(result_))) + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class ControllerAPIInfoResults(Type): +class CloudSpecResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ControllerAPIInfoResult] + results : typing.Sequence[~CloudSpecResult] ''' - results_ = [ControllerAPIInfoResult.from_json(o) for o in results or []] + results_ = [CloudSpecResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -5206,791 +6145,797 @@ def __init__(self, results=None, **unknown_fields): -class ControllerConfigResult(Type): - _toSchema = {'config': 'config'} - _toPy = {'config': 'config'} - def __init__(self, config=None, **unknown_fields): +class CloudUserInfo(Type): + _toSchema = {'access': 'access', 'display_name': 'display-name', 'user': 'user'} + _toPy = {'access': 'access', 'display-name': 'display_name', 'user': 'user'} + def __init__(self, access=None, display_name=None, user=None, **unknown_fields): ''' - config : typing.Mapping[str, typing.Any] + access : str + display_name : str + user : str ''' - config_ = config + access_ = access + display_name_ = display_name + user_ = user # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - self.config = config_ + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.access = access_ + self.display_name = display_name_ + self.user = user_ self.unknown_fields = unknown_fields -class ControllerConfigSet(Type): - _toSchema = {'config': 'config'} - _toPy = {'config': 'config'} - def __init__(self, config=None, **unknown_fields): +class CloudsResult(Type): + _toSchema = {'clouds': 'clouds'} + _toPy = {'clouds': 'clouds'} + def __init__(self, clouds=None, **unknown_fields): ''' - config : typing.Mapping[str, typing.Any] + clouds : typing.Mapping[str, ~Cloud] ''' - config_ = config + clouds_ = {k: Cloud.from_json(v) for k, v in (clouds or dict()).items()} # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if clouds_ is not None and not isinstance(clouds_, dict): + raise Exception("Expected clouds_ to be a Mapping, received: {}".format(type(clouds_))) - self.config = config_ + self.clouds = clouds_ self.unknown_fields = unknown_fields -class ControllerCredentialInfo(Type): - _toSchema = {'content': 'content', 'models': 'models'} - _toPy = {'content': 'content', 'models': 'models'} - def __init__(self, content=None, models=None, **unknown_fields): - ''' - content : CredentialContent - models : typing.Sequence[~ModelAccess] +class CommitHookChangesArg(Type): + _toSchema = {'add_storage': 'add-storage', 'close_ports': 'close-ports', 'open_ports': 'open-ports', 'pod_spec': 'pod-spec', 'relation_unit_settings': 'relation-unit-settings', 'secret_creates': 'secret-creates', 'secret_deletes': 'secret-deletes', 'secret_grants': 'secret-grants', 'secret_revokes': 'secret-revokes', 'secret_track_latest': 'secret-track-latest', 'secret_updates': 'secret-updates', 'set_raw_k8s_spec': 'set-raw-k8s-spec', 'tag': 'tag', 'unit_state': 'unit-state', 'update_network_info': 'update-network-info'} + _toPy = {'add-storage': 'add_storage', 'close-ports': 'close_ports', 'open-ports': 'open_ports', 'pod-spec': 'pod_spec', 'relation-unit-settings': 'relation_unit_settings', 'secret-creates': 'secret_creates', 'secret-deletes': 'secret_deletes', 'secret-grants': 'secret_grants', 'secret-revokes': 'secret_revokes', 'secret-track-latest': 'secret_track_latest', 'secret-updates': 'secret_updates', 'set-raw-k8s-spec': 'set_raw_k8s_spec', 'tag': 'tag', 'unit-state': 'unit_state', 'update-network-info': 'update_network_info'} + def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec=None, relation_unit_settings=None, secret_creates=None, secret_deletes=None, secret_grants=None, secret_revokes=None, secret_track_latest=None, secret_updates=None, set_raw_k8s_spec=None, tag=None, unit_state=None, update_network_info=None, **unknown_fields): ''' - content_ = CredentialContent.from_json(content) if content else None - models_ = [ModelAccess.from_json(o) for o in models or []] + add_storage : typing.Sequence[~StorageAddParams] + close_ports : typing.Sequence[~EntityPortRange] + open_ports : typing.Sequence[~EntityPortRange] + pod_spec : PodSpec + relation_unit_settings : typing.Sequence[~RelationUnitSettings] + secret_creates : typing.Sequence[~CreateSecretArg] + secret_deletes : typing.Sequence[~DeleteSecretArg] + secret_grants : typing.Sequence[~GrantRevokeSecretArg] + secret_revokes : typing.Sequence[~GrantRevokeSecretArg] + secret_track_latest : typing.Sequence[str] + secret_updates : typing.Sequence[~UpdateSecretArg] + set_raw_k8s_spec : PodSpec + tag : str + unit_state : SetUnitStateArg + update_network_info : bool + ''' + add_storage_ = [StorageAddParams.from_json(o) for o in add_storage or []] + close_ports_ = [EntityPortRange.from_json(o) for o in close_ports or []] + open_ports_ = [EntityPortRange.from_json(o) for o in open_ports or []] + pod_spec_ = PodSpec.from_json(pod_spec) if pod_spec else None + relation_unit_settings_ = [RelationUnitSettings.from_json(o) for o in relation_unit_settings or []] + secret_creates_ = [CreateSecretArg.from_json(o) for o in secret_creates or []] + secret_deletes_ = [DeleteSecretArg.from_json(o) for o in secret_deletes or []] + secret_grants_ = [GrantRevokeSecretArg.from_json(o) for o in secret_grants or []] + secret_revokes_ = [GrantRevokeSecretArg.from_json(o) for o in secret_revokes or []] + secret_track_latest_ = secret_track_latest + secret_updates_ = [UpdateSecretArg.from_json(o) for o in secret_updates or []] + set_raw_k8s_spec_ = PodSpec.from_json(set_raw_k8s_spec) if set_raw_k8s_spec else None + tag_ = tag + unit_state_ = SetUnitStateArg.from_json(unit_state) if unit_state else None + update_network_info_ = update_network_info # Validate arguments against known Juju API types. - if content_ is not None and not isinstance(content_, (dict, CredentialContent)): - raise Exception("Expected content_ to be a CredentialContent, received: {}".format(type(content_))) + if add_storage_ is not None and not isinstance(add_storage_, (bytes, str, list)): + raise Exception("Expected add_storage_ to be a Sequence, received: {}".format(type(add_storage_))) - if models_ is not None and not isinstance(models_, (bytes, str, list)): - raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + if close_ports_ is not None and not isinstance(close_ports_, (bytes, str, list)): + raise Exception("Expected close_ports_ to be a Sequence, received: {}".format(type(close_ports_))) - self.content = content_ - self.models = models_ + if open_ports_ is not None and not isinstance(open_ports_, (bytes, str, list)): + raise Exception("Expected open_ports_ to be a Sequence, received: {}".format(type(open_ports_))) + + if pod_spec_ is not None and not isinstance(pod_spec_, (dict, PodSpec)): + raise Exception("Expected pod_spec_ to be a PodSpec, received: {}".format(type(pod_spec_))) + + if relation_unit_settings_ is not None and not isinstance(relation_unit_settings_, (bytes, str, list)): + raise Exception("Expected relation_unit_settings_ to be a Sequence, received: {}".format(type(relation_unit_settings_))) + + if secret_creates_ is not None and not isinstance(secret_creates_, (bytes, str, list)): + raise Exception("Expected secret_creates_ to be a Sequence, received: {}".format(type(secret_creates_))) + + if secret_deletes_ is not None and not isinstance(secret_deletes_, (bytes, str, list)): + raise Exception("Expected secret_deletes_ to be a Sequence, received: {}".format(type(secret_deletes_))) + + if secret_grants_ is not None and not isinstance(secret_grants_, (bytes, str, list)): + raise Exception("Expected secret_grants_ to be a Sequence, received: {}".format(type(secret_grants_))) + + if secret_revokes_ is not None and not isinstance(secret_revokes_, (bytes, str, list)): + raise Exception("Expected secret_revokes_ to be a Sequence, received: {}".format(type(secret_revokes_))) + + if secret_track_latest_ is not None and not isinstance(secret_track_latest_, (bytes, str, list)): + raise Exception("Expected secret_track_latest_ to be a Sequence, received: {}".format(type(secret_track_latest_))) + + if secret_updates_ is not None and not isinstance(secret_updates_, (bytes, str, list)): + raise Exception("Expected secret_updates_ to be a Sequence, received: {}".format(type(secret_updates_))) + + if set_raw_k8s_spec_ is not None and not isinstance(set_raw_k8s_spec_, (dict, PodSpec)): + raise Exception("Expected set_raw_k8s_spec_ to be a PodSpec, received: {}".format(type(set_raw_k8s_spec_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if unit_state_ is not None and not isinstance(unit_state_, (dict, SetUnitStateArg)): + raise Exception("Expected unit_state_ to be a SetUnitStateArg, received: {}".format(type(unit_state_))) + + if update_network_info_ is not None and not isinstance(update_network_info_, bool): + raise Exception("Expected update_network_info_ to be a bool, received: {}".format(type(update_network_info_))) + + self.add_storage = add_storage_ + self.close_ports = close_ports_ + self.open_ports = open_ports_ + self.pod_spec = pod_spec_ + self.relation_unit_settings = relation_unit_settings_ + self.secret_creates = secret_creates_ + self.secret_deletes = secret_deletes_ + self.secret_grants = secret_grants_ + self.secret_revokes = secret_revokes_ + self.secret_track_latest = secret_track_latest_ + self.secret_updates = secret_updates_ + self.set_raw_k8s_spec = set_raw_k8s_spec_ + self.tag = tag_ + self.unit_state = unit_state_ + self.update_network_info = update_network_info_ self.unknown_fields = unknown_fields -class ControllerVersionResults(Type): - _toSchema = {'git_commit': 'git-commit', 'version': 'version'} - _toPy = {'git-commit': 'git_commit', 'version': 'version'} - def __init__(self, git_commit=None, version=None, **unknown_fields): +class CommitHookChangesArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - git_commit : str - version : str + args : typing.Sequence[~CommitHookChangesArg] ''' - git_commit_ = git_commit - version_ = version + args_ = [CommitHookChangesArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if git_commit_ is not None and not isinstance(git_commit_, (bytes, str)): - raise Exception("Expected git_commit_ to be a str, received: {}".format(type(git_commit_))) - - if version_ is not None and not isinstance(version_, (bytes, str)): - raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.git_commit = git_commit_ - self.version = version_ + self.args = args_ self.unknown_fields = unknown_fields -class ControllersChangeResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class ConfigResult(Type): + _toSchema = {'config': 'config', 'error': 'error'} + _toPy = {'config': 'config', 'error': 'error'} + def __init__(self, config=None, error=None, **unknown_fields): ''' + config : typing.Mapping[str, typing.Any] error : Error - result : ControllersChanges ''' + config_ = config error_ = Error.from_json(error) if error else None - result_ = ControllersChanges.from_json(result) if result else None # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, ControllersChanges)): - raise Exception("Expected result_ to be a ControllersChanges, received: {}".format(type(result_))) - + self.config = config_ self.error = error_ - self.result = result_ self.unknown_fields = unknown_fields -class ControllersChangeResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class ConfigSet(Type): + _toSchema = {'application': 'application', 'config': 'config', 'config_yaml': 'config-yaml', 'generation': 'generation'} + _toPy = {'application': 'application', 'config': 'config', 'config-yaml': 'config_yaml', 'generation': 'generation'} + def __init__(self, application=None, config=None, config_yaml=None, generation=None, **unknown_fields): ''' - results : typing.Sequence[~ControllersChangeResult] + application : str + config : typing.Mapping[str, str] + config_yaml : str + generation : str ''' - results_ = [ControllersChangeResult.from_json(o) for o in results or []] + application_ = application + config_ = config + config_yaml_ = config_yaml + generation_ = generation # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) - self.results = results_ - self.unknown_fields = unknown_fields + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if config_yaml_ is not None and not isinstance(config_yaml_, (bytes, str)): + raise Exception("Expected config_yaml_ to be a str, received: {}".format(type(config_yaml_))) + if generation_ is not None and not isinstance(generation_, (bytes, str)): + raise Exception("Expected generation_ to be a str, received: {}".format(type(generation_))) -class ControllersChanges(Type): - _toSchema = {'added': 'added', 'converted': 'converted', 'maintained': 'maintained', 'removed': 'removed'} - _toPy = {'added': 'added', 'converted': 'converted', 'maintained': 'maintained', 'removed': 'removed'} - def __init__(self, added=None, converted=None, maintained=None, removed=None, **unknown_fields): - ''' - added : typing.Sequence[str] - converted : typing.Sequence[str] - maintained : typing.Sequence[str] - removed : typing.Sequence[str] - ''' - added_ = added - converted_ = converted - maintained_ = maintained - removed_ = removed - - # Validate arguments against known Juju API types. - if added_ is not None and not isinstance(added_, (bytes, str, list)): - raise Exception("Expected added_ to be a Sequence, received: {}".format(type(added_))) - - if converted_ is not None and not isinstance(converted_, (bytes, str, list)): - raise Exception("Expected converted_ to be a Sequence, received: {}".format(type(converted_))) - - if maintained_ is not None and not isinstance(maintained_, (bytes, str, list)): - raise Exception("Expected maintained_ to be a Sequence, received: {}".format(type(maintained_))) - - if removed_ is not None and not isinstance(removed_, (bytes, str, list)): - raise Exception("Expected removed_ to be a Sequence, received: {}".format(type(removed_))) - - self.added = added_ - self.converted = converted_ - self.maintained = maintained_ - self.removed = removed_ + self.application = application_ + self.config = config_ + self.config_yaml = config_yaml_ + self.generation = generation_ self.unknown_fields = unknown_fields -class ControllersSpec(Type): - _toSchema = {'constraints': 'constraints', 'num_controllers': 'num-controllers', 'placement': 'placement'} - _toPy = {'constraints': 'constraints', 'num-controllers': 'num_controllers', 'placement': 'placement'} - def __init__(self, constraints=None, num_controllers=None, placement=None, **unknown_fields): +class ConfigSetArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - constraints : Value - num_controllers : int - placement : typing.Sequence[str] + args : typing.Sequence[~ConfigSet] ''' - constraints_ = Value.from_json(constraints) if constraints else None - num_controllers_ = num_controllers - placement_ = placement + args_ = [ConfigSet.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if constraints_ is not None and not isinstance(constraints_, (dict, Value)): - raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) - - if num_controllers_ is not None and not isinstance(num_controllers_, int): - raise Exception("Expected num_controllers_ to be a int, received: {}".format(type(num_controllers_))) - - if placement_ is not None and not isinstance(placement_, (bytes, str, list)): - raise Exception("Expected placement_ to be a Sequence, received: {}".format(type(placement_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.constraints = constraints_ - self.num_controllers = num_controllers_ - self.placement = placement_ + self.args = args_ self.unknown_fields = unknown_fields -class ControllersSpecs(Type): - _toSchema = {'specs': 'specs'} - _toPy = {'specs': 'specs'} - def __init__(self, specs=None, **unknown_fields): +class ConfigSettingsResult(Type): + _toSchema = {'error': 'error', 'settings': 'settings'} + _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): ''' - specs : typing.Sequence[~ControllersSpec] + error : Error + settings : typing.Mapping[str, typing.Any] ''' - specs_ = [ControllersSpec.from_json(o) for o in specs or []] + error_ = Error.from_json(error) if error else None + settings_ = settings # Validate arguments against known Juju API types. - if specs_ is not None and not isinstance(specs_, (bytes, str, list)): - raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.specs = specs_ + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + self.error = error_ + self.settings = settings_ self.unknown_fields = unknown_fields -class CreateSecretArg(Type): - _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'owner_tag': 'owner-tag', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} - _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'owner-tag': 'owner_tag', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} - def __init__(self, upsertsecretarg=None, content=None, description=None, expire_time=None, label=None, owner_tag=None, params=None, rotate_policy=None, uri=None, **unknown_fields): +class ConfigSettingsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - upsertsecretarg : UpsertSecretArg - content : SecretContentParams - description : str - expire_time : str - label : str - owner_tag : str - params : typing.Mapping[str, typing.Any] - rotate_policy : str - uri : str + results : typing.Sequence[~ConfigSettingsResult] ''' - upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None - content_ = SecretContentParams.from_json(content) if content else None - description_ = description - expire_time_ = expire_time - label_ = label - owner_tag_ = owner_tag - params_ = params - rotate_policy_ = rotate_policy - uri_ = uri + results_ = [ConfigSettingsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): - raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) - - if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): - raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) - - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - - if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): - raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) - - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - - if 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 params_ is not None and not isinstance(params_, dict): - raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - - if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): - raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) - - if uri_ is not None and not isinstance(uri_, (bytes, str)): - raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.upsertsecretarg = upsertsecretarg_ - self.content = content_ - self.description = description_ - self.expire_time = expire_time_ - self.label = label_ - self.owner_tag = owner_tag_ - self.params = params_ - self.rotate_policy = rotate_policy_ - self.uri = uri_ + self.results = results_ self.unknown_fields = unknown_fields -class CreateSecretArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class ConfigValue(Type): + _toSchema = {'source': 'source', 'value': 'value'} + _toPy = {'source': 'source', 'value': 'value'} + def __init__(self, source=None, value=None, **unknown_fields): ''' - args : typing.Sequence[~CreateSecretArg] + source : str + value : Any ''' - args_ = [CreateSecretArg.from_json(o) for o in args or []] + source_ = source + value_ = value # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if source_ is not None and not isinstance(source_, (bytes, str)): + raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) - self.args = args_ + self.source = source_ + self.value = value_ self.unknown_fields = unknown_fields -class CreateSpaceParams(Type): - _toSchema = {'cidrs': 'cidrs', 'provider_id': 'provider-id', 'public': 'public', 'space_tag': 'space-tag'} - _toPy = {'cidrs': 'cidrs', 'provider-id': 'provider_id', 'public': 'public', 'space-tag': 'space_tag'} - def __init__(self, cidrs=None, provider_id=None, public=None, space_tag=None, **unknown_fields): +class Constraints(Type): + _toSchema = {'count': 'Count', 'pool': 'Pool', 'size': 'Size'} + _toPy = {'Count': 'count', 'Pool': 'pool', 'Size': 'size'} + def __init__(self, count=None, pool=None, size=None, **unknown_fields): ''' - cidrs : typing.Sequence[str] - provider_id : str - public : bool - space_tag : str + count : int + pool : str + size : int ''' - cidrs_ = cidrs - provider_id_ = provider_id - public_ = public - space_tag_ = space_tag + count_ = count + pool_ = pool + size_ = size # Validate arguments against known Juju API types. - if cidrs_ is not None and not isinstance(cidrs_, (bytes, str, list)): - raise Exception("Expected cidrs_ to be a Sequence, received: {}".format(type(cidrs_))) - - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) - if public_ is not None and not isinstance(public_, bool): - raise Exception("Expected public_ to be a bool, received: {}".format(type(public_))) + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) - if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): - raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - self.cidrs = cidrs_ - self.provider_id = provider_id_ - self.public = public_ - self.space_tag = space_tag_ + self.count = count_ + self.pool = pool_ + self.size = size_ self.unknown_fields = unknown_fields -class CreateSpacesParams(Type): - _toSchema = {'spaces': 'spaces'} - _toPy = {'spaces': 'spaces'} - def __init__(self, spaces=None, **unknown_fields): +class ConstraintsResult(Type): + _toSchema = {'constraints': 'constraints', 'error': 'error'} + _toPy = {'constraints': 'constraints', 'error': 'error'} + def __init__(self, constraints=None, error=None, **unknown_fields): ''' - spaces : typing.Sequence[~CreateSpaceParams] + constraints : Value + error : Error ''' - spaces_ = [CreateSpaceParams.from_json(o) for o in spaces or []] + constraints_ = Value.from_json(constraints) if constraints else None + error_ = Error.from_json(error) if error else None # Validate arguments against known Juju API types. - if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): - raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) - self.spaces = spaces_ + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.constraints = constraints_ + self.error = error_ self.unknown_fields = unknown_fields -class CredentialContent(Type): - _toSchema = {'attrs': 'attrs', 'auth_type': 'auth-type', 'cloud': 'cloud', 'name': 'name', 'valid': 'valid'} - _toPy = {'attrs': 'attrs', 'auth-type': 'auth_type', 'cloud': 'cloud', 'name': 'name', 'valid': 'valid'} - def __init__(self, attrs=None, auth_type=None, cloud=None, name=None, valid=None, **unknown_fields): +class ConstraintsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - attrs : typing.Mapping[str, str] - auth_type : str - cloud : str - name : str - valid : bool + results : typing.Sequence[~ConstraintsResult] ''' - attrs_ = attrs - auth_type_ = auth_type - cloud_ = cloud - name_ = name - valid_ = valid + results_ = [ConstraintsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if attrs_ is not None and not isinstance(attrs_, dict): - raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if auth_type_ is not None and not isinstance(auth_type_, (bytes, str)): - raise Exception("Expected auth_type_ to be a str, received: {}".format(type(auth_type_))) + self.results = results_ + self.unknown_fields = unknown_fields - if cloud_ is not None and not isinstance(cloud_, (bytes, str)): - raise Exception("Expected cloud_ to be a str, received: {}".format(type(cloud_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if valid_ is not None and not isinstance(valid_, bool): - raise Exception("Expected valid_ to be a bool, received: {}".format(type(valid_))) - - self.attrs = attrs_ - self.auth_type = auth_type_ - self.cloud = cloud_ - self.name = name_ - self.valid = valid_ - self.unknown_fields = unknown_fields - - -class CredentialContentResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class ConsumeApplicationArg(Type): + _toSchema = {'application_alias': 'application-alias', 'application_description': 'application-description', 'applicationofferdetails': 'ApplicationOfferDetails', 'bindings': 'bindings', 'endpoints': 'endpoints', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces', 'users': 'users'} + _toPy = {'ApplicationOfferDetails': 'applicationofferdetails', 'application-alias': 'application_alias', 'application-description': 'application_description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces', 'users': 'users'} + def __init__(self, applicationofferdetails=None, application_alias=None, application_description=None, bindings=None, endpoints=None, external_controller=None, macaroon=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, spaces=None, users=None, **unknown_fields): ''' - error : Error - result : ControllerCredentialInfo + applicationofferdetails : ApplicationOfferDetails + application_alias : str + application_description : str + bindings : typing.Mapping[str, str] + endpoints : typing.Sequence[~RemoteEndpoint] + external_controller : ExternalControllerInfo + macaroon : Macaroon + offer_name : str + offer_url : str + offer_uuid : str + source_model_tag : str + spaces : typing.Sequence[~RemoteSpace] + users : typing.Sequence[~OfferUserDetails] ''' - error_ = Error.from_json(error) if error else None - result_ = ControllerCredentialInfo.from_json(result) if result else None + applicationofferdetails_ = ApplicationOfferDetails.from_json(applicationofferdetails) if applicationofferdetails else None + application_alias_ = application_alias + application_description_ = application_description + bindings_ = bindings + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + offer_name_ = offer_name + offer_url_ = offer_url + offer_uuid_ = offer_uuid + source_model_tag_ = source_model_tag + spaces_ = [RemoteSpace.from_json(o) for o in spaces or []] + users_ = [OfferUserDetails.from_json(o) for o in users or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if result_ is not None and not isinstance(result_, (dict, ControllerCredentialInfo)): - raise Exception("Expected result_ to be a ControllerCredentialInfo, received: {}".format(type(result_))) + if applicationofferdetails_ is not None and not isinstance(applicationofferdetails_, (dict, ApplicationOfferDetails)): + raise Exception("Expected applicationofferdetails_ to be a ApplicationOfferDetails, received: {}".format(type(applicationofferdetails_))) - self.error = error_ - self.result = result_ - self.unknown_fields = unknown_fields + if application_alias_ is not None and not isinstance(application_alias_, (bytes, str)): + raise Exception("Expected application_alias_ to be a str, received: {}".format(type(application_alias_))) + if application_description_ is not None and not isinstance(application_description_, (bytes, str)): + raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) + if bindings_ is not None and not isinstance(bindings_, dict): + raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) -class CredentialContentResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): - ''' - results : typing.Sequence[~CredentialContentResult] - ''' - results_ = [CredentialContentResult.from_json(o) for o in results or []] + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) - # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): + raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) - self.results = results_ - self.unknown_fields = unknown_fields + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) -class DashboardConnectionInfo(Type): - _toSchema = {'error': 'error', 'proxy_connection': 'proxy-connection', 'ssh_connection': 'ssh-connection'} - _toPy = {'error': 'error', 'proxy-connection': 'proxy_connection', 'ssh-connection': 'ssh_connection'} - def __init__(self, error=None, proxy_connection=None, ssh_connection=None, **unknown_fields): - ''' - error : Error - proxy_connection : Proxy - ssh_connection : DashboardConnectionSSHTunnel - ''' - error_ = Error.from_json(error) if error else None - proxy_connection_ = Proxy.from_json(proxy_connection) if proxy_connection else None - ssh_connection_ = DashboardConnectionSSHTunnel.from_json(ssh_connection) if ssh_connection else None + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) - # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): + raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) - if proxy_connection_ is not None and not isinstance(proxy_connection_, (dict, Proxy)): - raise Exception("Expected proxy_connection_ to be a Proxy, received: {}".format(type(proxy_connection_))) + if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) - if ssh_connection_ is not None and not isinstance(ssh_connection_, (dict, DashboardConnectionSSHTunnel)): - raise Exception("Expected ssh_connection_ to be a DashboardConnectionSSHTunnel, received: {}".format(type(ssh_connection_))) + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) - self.error = error_ - self.proxy_connection = proxy_connection_ - self.ssh_connection = ssh_connection_ + self.applicationofferdetails = applicationofferdetails_ + self.application_alias = application_alias_ + self.application_description = application_description_ + self.bindings = bindings_ + self.endpoints = endpoints_ + self.external_controller = external_controller_ + self.macaroon = macaroon_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.offer_uuid = offer_uuid_ + self.source_model_tag = source_model_tag_ + self.spaces = spaces_ + self.users = users_ self.unknown_fields = unknown_fields -class DashboardConnectionSSHTunnel(Type): - _toSchema = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'} - _toPy = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'} - def __init__(self, entity=None, host=None, model=None, port=None, **unknown_fields): +class ConsumeApplicationArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - entity : str - host : str - model : str - port : str + args : typing.Sequence[~ConsumeApplicationArg] ''' - entity_ = entity - host_ = host - model_ = model - port_ = port + args_ = [ConsumeApplicationArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if entity_ is not None and not isinstance(entity_, (bytes, str)): - raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) - - if host_ is not None and not isinstance(host_, (bytes, str)): - raise Exception("Expected host_ to be a str, received: {}".format(type(host_))) - - if model_ is not None and not isinstance(model_, (bytes, str)): - raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) - - if port_ is not None and not isinstance(port_, (bytes, str)): - raise Exception("Expected port_ to be a str, received: {}".format(type(port_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.entity = entity_ - self.host = host_ - self.model = model_ - self.port = port_ + self.args = args_ self.unknown_fields = unknown_fields -class DeleteSecretArg(Type): - _toSchema = {'label': 'label', 'revisions': 'revisions', 'uri': 'uri'} - _toPy = {'label': 'label', 'revisions': 'revisions', 'uri': 'uri'} - def __init__(self, label=None, revisions=None, uri=None, **unknown_fields): +class ConsumeOfferDetails(Type): + _toSchema = {'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} + _toPy = {'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} + def __init__(self, external_controller=None, macaroon=None, offer=None, **unknown_fields): ''' - label : str - revisions : typing.Sequence[int] - uri : str + external_controller : ExternalControllerInfo + macaroon : Macaroon + offer : ApplicationOfferDetails ''' - label_ = label - revisions_ = revisions - uri_ = uri + external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + offer_ = ApplicationOfferDetails.from_json(offer) if offer else None # Validate arguments against known Juju API types. - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): + raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) - if revisions_ is not None and not isinstance(revisions_, (bytes, str, list)): - raise Exception("Expected revisions_ to be a Sequence, received: {}".format(type(revisions_))) + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) - if uri_ is not None and not isinstance(uri_, (bytes, str)): - raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): + raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) - self.label = label_ - self.revisions = revisions_ - self.uri = uri_ + self.external_controller = external_controller_ + self.macaroon = macaroon_ + self.offer = offer_ self.unknown_fields = unknown_fields -class DeleteSecretArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class ConsumeOfferDetailsArg(Type): + _toSchema = {'offer_urls': 'offer-urls', 'user_tag': 'user-tag'} + _toPy = {'offer-urls': 'offer_urls', 'user-tag': 'user_tag'} + def __init__(self, offer_urls=None, user_tag=None, **unknown_fields): ''' - args : typing.Sequence[~DeleteSecretArg] + offer_urls : OfferURLs + user_tag : str ''' - args_ = [DeleteSecretArg.from_json(o) for o in args or []] + offer_urls_ = OfferURLs.from_json(offer_urls) if offer_urls else None + user_tag_ = user_tag # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if offer_urls_ is not None and not isinstance(offer_urls_, (dict, OfferURLs)): + raise Exception("Expected offer_urls_ to be a OfferURLs, received: {}".format(type(offer_urls_))) - self.args = args_ + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.offer_urls = offer_urls_ + self.user_tag = user_tag_ self.unknown_fields = unknown_fields -class Delta(Type): - _toSchema = {'entity': 'entity', 'removed': 'removed'} - _toPy = {'entity': 'entity', 'removed': 'removed'} - def __init__(self, entity=None, removed=None, **unknown_fields): +class ConsumeOfferDetailsResult(Type): + _toSchema = {'consumeofferdetails': 'ConsumeOfferDetails', 'error': 'error', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} + _toPy = {'ConsumeOfferDetails': 'consumeofferdetails', 'error': 'error', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} + def __init__(self, consumeofferdetails=None, error=None, external_controller=None, macaroon=None, offer=None, **unknown_fields): ''' - entity : Any - removed : bool + consumeofferdetails : ConsumeOfferDetails + error : Error + external_controller : ExternalControllerInfo + macaroon : Macaroon + offer : ApplicationOfferDetails ''' - entity_ = entity - removed_ = removed + consumeofferdetails_ = ConsumeOfferDetails.from_json(consumeofferdetails) if consumeofferdetails else None + error_ = Error.from_json(error) if error else None + external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + offer_ = ApplicationOfferDetails.from_json(offer) if offer else None # Validate arguments against known Juju API types. - if removed_ is not None and not isinstance(removed_, bool): - raise Exception("Expected removed_ to be a bool, received: {}".format(type(removed_))) + if consumeofferdetails_ is not None and not isinstance(consumeofferdetails_, (dict, ConsumeOfferDetails)): + raise Exception("Expected consumeofferdetails_ to be a ConsumeOfferDetails, received: {}".format(type(consumeofferdetails_))) - self.entity = entity_ - self.removed = removed_ + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): + raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) + + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): + raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) + + self.consumeofferdetails = consumeofferdetails_ + self.error = error_ + self.external_controller = external_controller_ + self.macaroon = macaroon_ + self.offer = offer_ self.unknown_fields = unknown_fields -class DeployFromRepositoryArg(Type): - _toSchema = {'applicationname': 'ApplicationName', 'attachstorage': 'AttachStorage', 'base': 'base', 'channel': 'channel', 'charmname': 'CharmName', 'configyaml': 'ConfigYAML', 'cons': 'Cons', 'devices': 'Devices', 'dryrun': 'DryRun', 'endpoint_bindings': 'endpoint-bindings', 'force': 'force', 'num_units': 'num-units', 'placement': 'Placement', 'resources': 'resources', 'revision': 'revision', 'storage': 'Storage', 'trust': 'Trust'} - _toPy = {'ApplicationName': 'applicationname', 'AttachStorage': 'attachstorage', 'CharmName': 'charmname', 'ConfigYAML': 'configyaml', 'Cons': 'cons', 'Devices': 'devices', 'DryRun': 'dryrun', 'Placement': 'placement', 'Storage': 'storage', 'Trust': 'trust', 'base': 'base', 'channel': 'channel', 'endpoint-bindings': 'endpoint_bindings', 'force': 'force', 'num-units': 'num_units', 'resources': 'resources', 'revision': 'revision'} - def __init__(self, applicationname=None, attachstorage=None, charmname=None, configyaml=None, cons=None, devices=None, dryrun=None, placement=None, storage=None, trust=None, base=None, channel=None, endpoint_bindings=None, force=None, num_units=None, resources=None, revision=None, **unknown_fields): +class ConsumeOfferDetailsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - applicationname : str - attachstorage : typing.Sequence[str] - charmname : str - configyaml : str - cons : Value - devices : typing.Mapping[str, ~Constraints] - dryrun : bool - placement : typing.Sequence[~Placement] - storage : typing.Mapping[str, ~Constraints] - trust : bool - base : Base - channel : str - endpoint_bindings : typing.Mapping[str, str] - force : bool - num_units : int - resources : typing.Mapping[str, str] - revision : int + results : typing.Sequence[~ConsumeOfferDetailsResult] ''' - applicationname_ = applicationname - attachstorage_ = attachstorage - charmname_ = charmname - configyaml_ = configyaml - cons_ = Value.from_json(cons) if cons else None - devices_ = {k: Constraints.from_json(v) for k, v in (devices or dict()).items()} - dryrun_ = dryrun - placement_ = [Placement.from_json(o) for o in placement or []] - storage_ = {k: Constraints.from_json(v) for k, v in (storage or dict()).items()} - trust_ = trust - base_ = Base.from_json(base) if base else None - channel_ = channel - endpoint_bindings_ = endpoint_bindings - force_ = force - num_units_ = num_units - resources_ = resources - revision_ = revision + results_ = [ConsumeOfferDetailsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if applicationname_ is not None and not isinstance(applicationname_, (bytes, str)): - raise Exception("Expected applicationname_ to be a str, received: {}".format(type(applicationname_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if attachstorage_ is not None and not isinstance(attachstorage_, (bytes, str, list)): - raise Exception("Expected attachstorage_ to be a Sequence, received: {}".format(type(attachstorage_))) + self.results = results_ + self.unknown_fields = unknown_fields - if charmname_ is not None and not isinstance(charmname_, (bytes, str)): - raise Exception("Expected charmname_ to be a str, received: {}".format(type(charmname_))) - if configyaml_ is not None and not isinstance(configyaml_, (bytes, str)): - raise Exception("Expected configyaml_ to be a str, received: {}".format(type(configyaml_))) - if cons_ is not None and not isinstance(cons_, (dict, Value)): - raise Exception("Expected cons_ to be a Value, received: {}".format(type(cons_))) +class ContainerConfig(Type): + _toSchema = {'apt_mirror': 'apt-mirror', 'apt_proxy': 'apt-proxy', 'authorized_keys': 'authorized-keys', 'cloudinit_userdata': 'cloudinit-userdata', 'container_inherit_properties': 'container-inherit-properties', 'juju_proxy': 'juju-proxy', 'legacy_proxy': 'legacy-proxy', 'provider_type': 'provider-type', 'snap_proxy': 'snap-proxy', 'snap_store_assertions': 'snap-store-assertions', 'snap_store_proxy_id': 'snap-store-proxy-id', 'snap_store_proxy_url': 'snap-store-proxy-url', 'ssl_hostname_verification': 'ssl-hostname-verification', 'updatebehavior': 'UpdateBehavior'} + _toPy = {'UpdateBehavior': 'updatebehavior', 'apt-mirror': 'apt_mirror', 'apt-proxy': 'apt_proxy', 'authorized-keys': 'authorized_keys', 'cloudinit-userdata': 'cloudinit_userdata', 'container-inherit-properties': 'container_inherit_properties', 'juju-proxy': 'juju_proxy', 'legacy-proxy': 'legacy_proxy', 'provider-type': 'provider_type', 'snap-proxy': 'snap_proxy', 'snap-store-assertions': 'snap_store_assertions', 'snap-store-proxy-id': 'snap_store_proxy_id', 'snap-store-proxy-url': 'snap_store_proxy_url', 'ssl-hostname-verification': 'ssl_hostname_verification'} + def __init__(self, updatebehavior=None, apt_mirror=None, apt_proxy=None, authorized_keys=None, cloudinit_userdata=None, container_inherit_properties=None, juju_proxy=None, legacy_proxy=None, provider_type=None, snap_proxy=None, snap_store_assertions=None, snap_store_proxy_id=None, snap_store_proxy_url=None, ssl_hostname_verification=None, **unknown_fields): + ''' + updatebehavior : UpdateBehavior + apt_mirror : str + apt_proxy : Settings + authorized_keys : str + cloudinit_userdata : typing.Mapping[str, typing.Any] + container_inherit_properties : str + juju_proxy : Settings + legacy_proxy : Settings + provider_type : str + snap_proxy : Settings + snap_store_assertions : str + snap_store_proxy_id : str + snap_store_proxy_url : str + ssl_hostname_verification : bool + ''' + updatebehavior_ = UpdateBehavior.from_json(updatebehavior) if updatebehavior else None + apt_mirror_ = apt_mirror + apt_proxy_ = Settings.from_json(apt_proxy) if apt_proxy else None + authorized_keys_ = authorized_keys + cloudinit_userdata_ = cloudinit_userdata + container_inherit_properties_ = container_inherit_properties + juju_proxy_ = Settings.from_json(juju_proxy) if juju_proxy else None + legacy_proxy_ = Settings.from_json(legacy_proxy) if legacy_proxy else None + provider_type_ = provider_type + snap_proxy_ = Settings.from_json(snap_proxy) if snap_proxy else None + snap_store_assertions_ = snap_store_assertions + snap_store_proxy_id_ = snap_store_proxy_id + snap_store_proxy_url_ = snap_store_proxy_url + ssl_hostname_verification_ = ssl_hostname_verification - if devices_ is not None and not isinstance(devices_, dict): - raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + # Validate arguments against known Juju API types. + if updatebehavior_ is not None and not isinstance(updatebehavior_, (dict, UpdateBehavior)): + raise Exception("Expected updatebehavior_ to be a UpdateBehavior, received: {}".format(type(updatebehavior_))) - if dryrun_ is not None and not isinstance(dryrun_, bool): - raise Exception("Expected dryrun_ to be a bool, received: {}".format(type(dryrun_))) + if apt_mirror_ is not None and not isinstance(apt_mirror_, (bytes, str)): + raise Exception("Expected apt_mirror_ to be a str, received: {}".format(type(apt_mirror_))) - if placement_ is not None and not isinstance(placement_, (bytes, str, list)): - raise Exception("Expected placement_ to be a Sequence, received: {}".format(type(placement_))) + if apt_proxy_ is not None and not isinstance(apt_proxy_, (dict, Settings)): + raise Exception("Expected apt_proxy_ to be a Settings, received: {}".format(type(apt_proxy_))) - if storage_ is not None and not isinstance(storage_, dict): - raise Exception("Expected storage_ to be a Mapping, received: {}".format(type(storage_))) + if authorized_keys_ is not None and not isinstance(authorized_keys_, (bytes, str)): + raise Exception("Expected authorized_keys_ to be a str, received: {}".format(type(authorized_keys_))) - if trust_ is not None and not isinstance(trust_, bool): - raise Exception("Expected trust_ to be a bool, received: {}".format(type(trust_))) + if cloudinit_userdata_ is not None and not isinstance(cloudinit_userdata_, dict): + raise Exception("Expected cloudinit_userdata_ to be a Mapping, received: {}".format(type(cloudinit_userdata_))) - if base_ is not None and not isinstance(base_, (dict, Base)): - raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) + if container_inherit_properties_ is not None and not isinstance(container_inherit_properties_, (bytes, str)): + raise Exception("Expected container_inherit_properties_ to be a str, received: {}".format(type(container_inherit_properties_))) - if channel_ is not None and not isinstance(channel_, (bytes, str)): - raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + if juju_proxy_ is not None and not isinstance(juju_proxy_, (dict, Settings)): + raise Exception("Expected juju_proxy_ to be a Settings, received: {}".format(type(juju_proxy_))) - if endpoint_bindings_ is not None and not isinstance(endpoint_bindings_, dict): - raise Exception("Expected endpoint_bindings_ to be a Mapping, received: {}".format(type(endpoint_bindings_))) + if legacy_proxy_ is not None and not isinstance(legacy_proxy_, (dict, Settings)): + raise Exception("Expected legacy_proxy_ to be a Settings, received: {}".format(type(legacy_proxy_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): + raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) - if num_units_ is not None and not isinstance(num_units_, int): - raise Exception("Expected num_units_ to be a int, received: {}".format(type(num_units_))) + if snap_proxy_ is not None and not isinstance(snap_proxy_, (dict, Settings)): + raise Exception("Expected snap_proxy_ to be a Settings, received: {}".format(type(snap_proxy_))) - if resources_ is not None and not isinstance(resources_, dict): - raise Exception("Expected resources_ to be a Mapping, received: {}".format(type(resources_))) + if snap_store_assertions_ is not None and not isinstance(snap_store_assertions_, (bytes, str)): + raise Exception("Expected snap_store_assertions_ to be a str, received: {}".format(type(snap_store_assertions_))) - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + if snap_store_proxy_id_ is not None and not isinstance(snap_store_proxy_id_, (bytes, str)): + raise Exception("Expected snap_store_proxy_id_ to be a str, received: {}".format(type(snap_store_proxy_id_))) - self.applicationname = applicationname_ - self.attachstorage = attachstorage_ - self.charmname = charmname_ - self.configyaml = configyaml_ - self.cons = cons_ - self.devices = devices_ - self.dryrun = dryrun_ - self.placement = placement_ - self.storage = storage_ - self.trust = trust_ - self.base = base_ - self.channel = channel_ - self.endpoint_bindings = endpoint_bindings_ - self.force = force_ - self.num_units = num_units_ - self.resources = resources_ - self.revision = revision_ + if snap_store_proxy_url_ is not None and not isinstance(snap_store_proxy_url_, (bytes, str)): + raise Exception("Expected snap_store_proxy_url_ to be a str, received: {}".format(type(snap_store_proxy_url_))) + + if ssl_hostname_verification_ is not None and not isinstance(ssl_hostname_verification_, bool): + raise Exception("Expected ssl_hostname_verification_ to be a bool, received: {}".format(type(ssl_hostname_verification_))) + + self.updatebehavior = updatebehavior_ + self.apt_mirror = apt_mirror_ + self.apt_proxy = apt_proxy_ + self.authorized_keys = authorized_keys_ + self.cloudinit_userdata = cloudinit_userdata_ + self.container_inherit_properties = container_inherit_properties_ + self.juju_proxy = juju_proxy_ + self.legacy_proxy = legacy_proxy_ + self.provider_type = provider_type_ + self.snap_proxy = snap_proxy_ + self.snap_store_assertions = snap_store_assertions_ + self.snap_store_proxy_id = snap_store_proxy_id_ + self.snap_store_proxy_url = snap_store_proxy_url_ + self.ssl_hostname_verification = ssl_hostname_verification_ self.unknown_fields = unknown_fields -class DeployFromRepositoryArgs(Type): - _toSchema = {'args': 'Args'} - _toPy = {'Args': 'args'} - def __init__(self, args=None, **unknown_fields): +class ContainerLXDProfile(Type): + _toSchema = {'name': 'name', 'profile': 'profile'} + _toPy = {'name': 'name', 'profile': 'profile'} + def __init__(self, name=None, profile=None, **unknown_fields): ''' - args : typing.Sequence[~DeployFromRepositoryArg] + name : str + profile : CharmLXDProfile ''' - args_ = [DeployFromRepositoryArg.from_json(o) for o in args or []] + name_ = name + profile_ = CharmLXDProfile.from_json(profile) if profile else None # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - self.args = args_ + if profile_ is not None and not isinstance(profile_, (dict, CharmLXDProfile)): + raise Exception("Expected profile_ to be a CharmLXDProfile, received: {}".format(type(profile_))) + + self.name = name_ + self.profile = profile_ self.unknown_fields = unknown_fields -class DeployFromRepositoryInfo(Type): - _toSchema = {'architecture': 'architecture', 'base': 'base', 'channel': 'channel', 'effective_channel': 'effective-channel', 'name': 'name', 'revision': 'revision'} - _toPy = {'architecture': 'architecture', 'base': 'base', 'channel': 'channel', 'effective-channel': 'effective_channel', 'name': 'name', 'revision': 'revision'} - def __init__(self, architecture=None, base=None, channel=None, effective_channel=None, name=None, revision=None, **unknown_fields): +class ContainerManagerConfig(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' - architecture : str - base : Base - channel : str - effective_channel : str - name : str - revision : int + config : typing.Mapping[str, str] ''' - architecture_ = architecture - base_ = Base.from_json(base) if base else None - channel_ = channel - effective_channel_ = effective_channel - name_ = name - revision_ = revision + config_ = config # Validate arguments against known Juju API types. - if architecture_ is not None and not isinstance(architecture_, (bytes, str)): - raise Exception("Expected architecture_ to be a str, received: {}".format(type(architecture_))) + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - if base_ is not None and not isinstance(base_, (dict, Base)): - raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) + self.config = config_ + self.unknown_fields = unknown_fields - if channel_ is not None and not isinstance(channel_, (bytes, str)): - raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) - if effective_channel_ is not None and not isinstance(effective_channel_, (bytes, str)): - raise Exception("Expected effective_channel_ to be a str, received: {}".format(type(effective_channel_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) +class ContainerManagerConfigParams(Type): + _toSchema = {'type_': 'type'} + _toPy = {'type': 'type_'} + def __init__(self, type_=None, **unknown_fields): + ''' + type_ : str + ''' + type__ = type_ - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + # Validate arguments against known Juju API types. + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - self.architecture = architecture_ - self.base = base_ - self.channel = channel_ - self.effective_channel = effective_channel_ - self.name = name_ - self.revision = revision_ + self.type_ = type__ self.unknown_fields = unknown_fields -class DeployFromRepositoryResult(Type): - _toSchema = {'errors': 'Errors', 'info': 'Info', 'pendingresourceuploads': 'PendingResourceUploads'} - _toPy = {'Errors': 'errors', 'Info': 'info', 'PendingResourceUploads': 'pendingresourceuploads'} - def __init__(self, errors=None, info=None, pendingresourceuploads=None, **unknown_fields): +class ContainerProfileResult(Type): + _toSchema = {'error': 'error', 'lxd_profiles': 'lxd-profiles'} + _toPy = {'error': 'error', 'lxd-profiles': 'lxd_profiles'} + def __init__(self, error=None, lxd_profiles=None, **unknown_fields): ''' - errors : typing.Sequence[~Error] - info : DeployFromRepositoryInfo - pendingresourceuploads : typing.Sequence[~PendingResourceUpload] + error : Error + lxd_profiles : typing.Sequence[~ContainerLXDProfile] ''' - errors_ = [Error.from_json(o) for o in errors or []] - info_ = DeployFromRepositoryInfo.from_json(info) if info else None - pendingresourceuploads_ = [PendingResourceUpload.from_json(o) for o in pendingresourceuploads or []] + error_ = Error.from_json(error) if error else None + lxd_profiles_ = [ContainerLXDProfile.from_json(o) for o in lxd_profiles or []] # Validate arguments against known Juju API types. - if errors_ is not None and not isinstance(errors_, (bytes, str, list)): - raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) - - if info_ is not None and not isinstance(info_, (dict, DeployFromRepositoryInfo)): - raise Exception("Expected info_ to be a DeployFromRepositoryInfo, received: {}".format(type(info_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if pendingresourceuploads_ is not None and not isinstance(pendingresourceuploads_, (bytes, str, list)): - raise Exception("Expected pendingresourceuploads_ to be a Sequence, received: {}".format(type(pendingresourceuploads_))) + if lxd_profiles_ is not None and not isinstance(lxd_profiles_, (bytes, str, list)): + raise Exception("Expected lxd_profiles_ to be a Sequence, received: {}".format(type(lxd_profiles_))) - self.errors = errors_ - self.info = info_ - self.pendingresourceuploads = pendingresourceuploads_ + self.error = error_ + self.lxd_profiles = lxd_profiles_ self.unknown_fields = unknown_fields -class DeployFromRepositoryResults(Type): - _toSchema = {'results': 'Results'} - _toPy = {'Results': 'results'} +class ContainerProfileResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~DeployFromRepositoryResult] + results : typing.Sequence[~ContainerProfileResult] ''' - results_ = [DeployFromRepositoryResult.from_json(o) for o in results or []] + results_ = [ContainerProfileResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -6001,572 +6946,518 @@ def __init__(self, results=None, **unknown_fields): -class DestroyApplicationInfo(Type): - _toSchema = {'destroyed_storage': 'destroyed-storage', 'destroyed_units': 'destroyed-units', 'detached_storage': 'detached-storage'} - _toPy = {'destroyed-storage': 'destroyed_storage', 'destroyed-units': 'destroyed_units', 'detached-storage': 'detached_storage'} - def __init__(self, destroyed_storage=None, destroyed_units=None, detached_storage=None, **unknown_fields): +class ContainerTypeResult(Type): + _toSchema = {'container_type': 'container-type', 'error': 'error'} + _toPy = {'container-type': 'container_type', 'error': 'error'} + def __init__(self, container_type=None, error=None, **unknown_fields): ''' - destroyed_storage : typing.Sequence[~Entity] - destroyed_units : typing.Sequence[~Entity] - detached_storage : typing.Sequence[~Entity] + container_type : str + error : Error ''' - destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] - destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] - detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + container_type_ = container_type + error_ = Error.from_json(error) if error else None # Validate arguments against known Juju API types. - if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): - raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) - if destroyed_units_ is not None and not isinstance(destroyed_units_, (bytes, str, list)): - raise Exception("Expected destroyed_units_ to be a Sequence, received: {}".format(type(destroyed_units_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): - raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) - - self.destroyed_storage = destroyed_storage_ - self.destroyed_units = destroyed_units_ - self.detached_storage = detached_storage_ - self.unknown_fields = unknown_fields + self.container_type = container_type_ + self.error = error_ + self.unknown_fields = unknown_fields -class DestroyApplicationOffers(Type): - _toSchema = {'force': 'force', 'offer_urls': 'offer-urls'} - _toPy = {'force': 'force', 'offer-urls': 'offer_urls'} - def __init__(self, force=None, offer_urls=None, **unknown_fields): +class ControllerAPIInfoResult(Type): + _toSchema = {'addresses': 'addresses', 'cacert': 'cacert', 'error': 'error'} + _toPy = {'addresses': 'addresses', 'cacert': 'cacert', 'error': 'error'} + def __init__(self, addresses=None, cacert=None, error=None, **unknown_fields): ''' - force : bool - offer_urls : typing.Sequence[str] + addresses : typing.Sequence[str] + cacert : str + error : Error ''' - force_ = force - offer_urls_ = offer_urls + addresses_ = addresses + cacert_ = cacert + error_ = Error.from_json(error) if error else None # Validate arguments against known Juju API types. - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) - if offer_urls_ is not None and not isinstance(offer_urls_, (bytes, str, list)): - raise Exception("Expected offer_urls_ to be a Sequence, received: {}".format(type(offer_urls_))) + if cacert_ is not None and not isinstance(cacert_, (bytes, str)): + raise Exception("Expected cacert_ to be a str, received: {}".format(type(cacert_))) - self.force = force_ - self.offer_urls = offer_urls_ + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.addresses = addresses_ + self.cacert = cacert_ + self.error = error_ self.unknown_fields = unknown_fields -class DestroyApplicationParams(Type): - _toSchema = {'application_tag': 'application-tag', 'destroy_storage': 'destroy-storage', 'dry_run': 'dry-run', 'force': 'force', 'max_wait': 'max-wait'} - _toPy = {'application-tag': 'application_tag', 'destroy-storage': 'destroy_storage', 'dry-run': 'dry_run', 'force': 'force', 'max-wait': 'max_wait'} - def __init__(self, application_tag=None, destroy_storage=None, dry_run=None, force=None, max_wait=None, **unknown_fields): +class ControllerAPIInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - application_tag : str - destroy_storage : bool - dry_run : bool - force : bool - max_wait : int + results : typing.Sequence[~ControllerAPIInfoResult] ''' - application_tag_ = application_tag - destroy_storage_ = destroy_storage - dry_run_ = dry_run - force_ = force - max_wait_ = max_wait + results_ = [ControllerAPIInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): - raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): - raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + self.results = results_ + self.unknown_fields = unknown_fields - if dry_run_ is not None and not isinstance(dry_run_, bool): - raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) +class ControllerConfigResult(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config - self.application_tag = application_tag_ - self.destroy_storage = destroy_storage_ - self.dry_run = dry_run_ - self.force = force_ - self.max_wait = max_wait_ + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ self.unknown_fields = unknown_fields -class DestroyApplicationResult(Type): - _toSchema = {'error': 'error', 'info': 'info'} - _toPy = {'error': 'error', 'info': 'info'} - def __init__(self, error=None, info=None, **unknown_fields): +class ControllerConfigSet(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' - error : Error - info : DestroyApplicationInfo + config : typing.Mapping[str, typing.Any] ''' - error_ = Error.from_json(error) if error else None - info_ = DestroyApplicationInfo.from_json(info) if info else None + config_ = config # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if info_ is not None and not isinstance(info_, (dict, DestroyApplicationInfo)): - raise Exception("Expected info_ to be a DestroyApplicationInfo, received: {}".format(type(info_))) + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - self.error = error_ - self.info = info_ + self.config = config_ self.unknown_fields = unknown_fields -class DestroyApplicationResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class ControllerCredentialInfo(Type): + _toSchema = {'content': 'content', 'models': 'models'} + _toPy = {'content': 'content', 'models': 'models'} + def __init__(self, content=None, models=None, **unknown_fields): ''' - results : typing.Sequence[~DestroyApplicationResult] + content : CredentialContent + models : typing.Sequence[~ModelAccess] ''' - results_ = [DestroyApplicationResult.from_json(o) for o in results or []] + content_ = CredentialContent.from_json(content) if content else None + models_ = [ModelAccess.from_json(o) for o in models or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if content_ is not None and not isinstance(content_, (dict, CredentialContent)): + raise Exception("Expected content_ to be a CredentialContent, received: {}".format(type(content_))) - self.results = results_ + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.content = content_ + self.models = models_ self.unknown_fields = unknown_fields -class DestroyApplicationsParams(Type): - _toSchema = {'applications': 'applications'} - _toPy = {'applications': 'applications'} - def __init__(self, applications=None, **unknown_fields): +class ControllerVersionResults(Type): + _toSchema = {'git_commit': 'git-commit', 'version': 'version'} + _toPy = {'git-commit': 'git_commit', 'version': 'version'} + def __init__(self, git_commit=None, version=None, **unknown_fields): ''' - applications : typing.Sequence[~DestroyApplicationParams] + git_commit : str + version : str ''' - applications_ = [DestroyApplicationParams.from_json(o) for o in applications or []] + git_commit_ = git_commit + version_ = version # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if git_commit_ is not None and not isinstance(git_commit_, (bytes, str)): + raise Exception("Expected git_commit_ to be a str, received: {}".format(type(git_commit_))) - self.applications = applications_ + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.git_commit = git_commit_ + self.version = version_ self.unknown_fields = unknown_fields -class DestroyConsumedApplicationParams(Type): - _toSchema = {'application_tag': 'application-tag', 'force': 'force', 'max_wait': 'max-wait'} - _toPy = {'application-tag': 'application_tag', 'force': 'force', 'max-wait': 'max_wait'} - def __init__(self, application_tag=None, force=None, max_wait=None, **unknown_fields): +class ControllersChangeResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - application_tag : str - force : bool - max_wait : int + error : Error + result : ControllersChanges ''' - application_tag_ = application_tag - force_ = force - max_wait_ = max_wait + error_ = Error.from_json(error) if error else None + result_ = ControllersChanges.from_json(result) if result else None # Validate arguments against known Juju API types. - if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): - raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + if result_ is not None and not isinstance(result_, (dict, ControllersChanges)): + raise Exception("Expected result_ to be a ControllersChanges, received: {}".format(type(result_))) - self.application_tag = application_tag_ - self.force = force_ - self.max_wait = max_wait_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class DestroyConsumedApplicationsParams(Type): - _toSchema = {'applications': 'applications'} - _toPy = {'applications': 'applications'} - def __init__(self, applications=None, **unknown_fields): +class ControllersChangeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - applications : typing.Sequence[~DestroyConsumedApplicationParams] + results : typing.Sequence[~ControllersChangeResult] ''' - applications_ = [DestroyConsumedApplicationParams.from_json(o) for o in applications or []] + results_ = [ControllersChangeResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.applications = applications_ + self.results = results_ self.unknown_fields = unknown_fields -class DestroyControllerArgs(Type): - _toSchema = {'destroy_models': 'destroy-models', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'model_timeout': 'model-timeout'} - _toPy = {'destroy-models': 'destroy_models', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'model-timeout': 'model_timeout'} - def __init__(self, destroy_models=None, destroy_storage=None, force=None, max_wait=None, model_timeout=None, **unknown_fields): +class ControllersChanges(Type): + _toSchema = {'added': 'added', 'converted': 'converted', 'maintained': 'maintained', 'removed': 'removed'} + _toPy = {'added': 'added', 'converted': 'converted', 'maintained': 'maintained', 'removed': 'removed'} + def __init__(self, added=None, converted=None, maintained=None, removed=None, **unknown_fields): ''' - destroy_models : bool - destroy_storage : bool - force : bool - max_wait : int - model_timeout : int + added : typing.Sequence[str] + converted : typing.Sequence[str] + maintained : typing.Sequence[str] + removed : typing.Sequence[str] ''' - destroy_models_ = destroy_models - destroy_storage_ = destroy_storage - force_ = force - max_wait_ = max_wait - model_timeout_ = model_timeout + added_ = added + converted_ = converted + maintained_ = maintained + removed_ = removed # Validate arguments against known Juju API types. - if destroy_models_ is not None and not isinstance(destroy_models_, bool): - raise Exception("Expected destroy_models_ to be a bool, received: {}".format(type(destroy_models_))) + if added_ is not None and not isinstance(added_, (bytes, str, list)): + raise Exception("Expected added_ to be a Sequence, received: {}".format(type(added_))) - if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): - raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + if converted_ is not None and not isinstance(converted_, (bytes, str, list)): + raise Exception("Expected converted_ to be a Sequence, received: {}".format(type(converted_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if maintained_ is not None and not isinstance(maintained_, (bytes, str, list)): + raise Exception("Expected maintained_ to be a Sequence, received: {}".format(type(maintained_))) - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + if removed_ is not None and not isinstance(removed_, (bytes, str, list)): + raise Exception("Expected removed_ to be a Sequence, received: {}".format(type(removed_))) - if model_timeout_ is not None and not isinstance(model_timeout_, int): - raise Exception("Expected model_timeout_ to be a int, received: {}".format(type(model_timeout_))) - - self.destroy_models = destroy_models_ - self.destroy_storage = destroy_storage_ - self.force = force_ - self.max_wait = max_wait_ - self.model_timeout = model_timeout_ + self.added = added_ + self.converted = converted_ + self.maintained = maintained_ + self.removed = removed_ self.unknown_fields = unknown_fields -class DestroyMachineInfo(Type): - _toSchema = {'destroyed_containers': 'destroyed-containers', 'destroyed_storage': 'destroyed-storage', 'destroyed_units': 'destroyed-units', 'detached_storage': 'detached-storage', 'machine_id': 'machine-id'} - _toPy = {'destroyed-containers': 'destroyed_containers', 'destroyed-storage': 'destroyed_storage', 'destroyed-units': 'destroyed_units', 'detached-storage': 'detached_storage', 'machine-id': 'machine_id'} - def __init__(self, destroyed_containers=None, destroyed_storage=None, destroyed_units=None, detached_storage=None, machine_id=None, **unknown_fields): +class ControllersSpec(Type): + _toSchema = {'constraints': 'constraints', 'num_controllers': 'num-controllers', 'placement': 'placement'} + _toPy = {'constraints': 'constraints', 'num-controllers': 'num_controllers', 'placement': 'placement'} + def __init__(self, constraints=None, num_controllers=None, placement=None, **unknown_fields): ''' - destroyed_containers : typing.Sequence[~DestroyMachineResult] - destroyed_storage : typing.Sequence[~Entity] - destroyed_units : typing.Sequence[~Entity] - detached_storage : typing.Sequence[~Entity] - machine_id : str + constraints : Value + num_controllers : int + placement : typing.Sequence[str] ''' - destroyed_containers_ = [DestroyMachineResult.from_json(o) for o in destroyed_containers or []] - destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] - destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] - detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] - machine_id_ = machine_id + constraints_ = Value.from_json(constraints) if constraints else None + num_controllers_ = num_controllers + placement_ = placement # Validate arguments against known Juju API types. - if destroyed_containers_ is not None and not isinstance(destroyed_containers_, (bytes, str, list)): - raise Exception("Expected destroyed_containers_ to be a Sequence, received: {}".format(type(destroyed_containers_))) - - if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): - raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) - - if destroyed_units_ is not None and not isinstance(destroyed_units_, (bytes, str, list)): - raise Exception("Expected destroyed_units_ to be a Sequence, received: {}".format(type(destroyed_units_))) + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) - if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): - raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + if num_controllers_ is not None and not isinstance(num_controllers_, int): + raise Exception("Expected num_controllers_ to be a int, received: {}".format(type(num_controllers_))) - if machine_id_ is not None and not isinstance(machine_id_, (bytes, str)): - raise Exception("Expected machine_id_ to be a str, received: {}".format(type(machine_id_))) + if placement_ is not None and not isinstance(placement_, (bytes, str, list)): + raise Exception("Expected placement_ to be a Sequence, received: {}".format(type(placement_))) - self.destroyed_containers = destroyed_containers_ - self.destroyed_storage = destroyed_storage_ - self.destroyed_units = destroyed_units_ - self.detached_storage = detached_storage_ - self.machine_id = machine_id_ + self.constraints = constraints_ + self.num_controllers = num_controllers_ + self.placement = placement_ self.unknown_fields = unknown_fields -class DestroyMachineResult(Type): - _toSchema = {'error': 'error', 'info': 'info'} - _toPy = {'error': 'error', 'info': 'info'} - def __init__(self, error=None, info=None, **unknown_fields): +class ControllersSpecs(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): ''' - error : Error - info : DestroyMachineInfo + specs : typing.Sequence[~ControllersSpec] ''' - error_ = Error.from_json(error) if error else None - info_ = DestroyMachineInfo.from_json(info) if info else None + specs_ = [ControllersSpec.from_json(o) for o in specs or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if info_ is not None and not isinstance(info_, (dict, DestroyMachineInfo)): - raise Exception("Expected info_ to be a DestroyMachineInfo, received: {}".format(type(info_))) + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) - self.error = error_ - self.info = info_ + self.specs = specs_ self.unknown_fields = unknown_fields -class DestroyMachineResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class CreateSecretArg(Type): + _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'owner_tag': 'owner-tag', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} + _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'owner-tag': 'owner_tag', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, content=None, description=None, expire_time=None, label=None, owner_tag=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' - results : typing.Sequence[~DestroyMachineResult] + upsertsecretarg : UpsertSecretArg + content : SecretContentParams + description : str + expire_time : str + label : str + owner_tag : str + params : typing.Mapping[str, typing.Any] + rotate_policy : str + uri : str ''' - results_ = [DestroyMachineResult.from_json(o) for o in results or []] + upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None + content_ = SecretContentParams.from_json(content) if content else None + description_ = description + expire_time_ = expire_time + label_ = label + owner_tag_ = owner_tag + params_ = params + rotate_policy_ = rotate_policy + uri_ = uri # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - - self.results = results_ - self.unknown_fields = unknown_fields + if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): + raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) + if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): + raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) -class DestroyMachinesParams(Type): - _toSchema = {'dry_run': 'dry-run', 'force': 'force', 'keep': 'keep', 'machine_tags': 'machine-tags', 'max_wait': 'max-wait'} - _toPy = {'dry-run': 'dry_run', 'force': 'force', 'keep': 'keep', 'machine-tags': 'machine_tags', 'max-wait': 'max_wait'} - def __init__(self, dry_run=None, force=None, keep=None, machine_tags=None, max_wait=None, **unknown_fields): - ''' - dry_run : bool - force : bool - keep : bool - machine_tags : typing.Sequence[str] - max_wait : int - ''' - dry_run_ = dry_run - force_ = force - keep_ = keep - machine_tags_ = machine_tags - max_wait_ = max_wait + if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) - # Validate arguments against known Juju API types. - if dry_run_ is not None and not isinstance(dry_run_, bool): - raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + 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 keep_ is not None and not isinstance(keep_, bool): - raise Exception("Expected keep_ to be a bool, received: {}".format(type(keep_))) + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - if machine_tags_ is not None and not isinstance(machine_tags_, (bytes, str, list)): - raise Exception("Expected machine_tags_ to be a Sequence, received: {}".format(type(machine_tags_))) + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) - self.dry_run = dry_run_ - self.force = force_ - self.keep = keep_ - self.machine_tags = machine_tags_ - self.max_wait = max_wait_ + self.upsertsecretarg = upsertsecretarg_ + self.content = content_ + self.description = description_ + self.expire_time = expire_time_ + self.label = label_ + self.owner_tag = owner_tag_ + self.params = params_ + self.rotate_policy = rotate_policy_ + self.uri = uri_ self.unknown_fields = unknown_fields -class DestroyModelParams(Type): - _toSchema = {'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'model_tag': 'model-tag', 'timeout': 'timeout'} - _toPy = {'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'model-tag': 'model_tag', 'timeout': 'timeout'} - def __init__(self, destroy_storage=None, force=None, max_wait=None, model_tag=None, timeout=None, **unknown_fields): +class CreateSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - destroy_storage : bool - force : bool - max_wait : int - model_tag : str - timeout : int + args : typing.Sequence[~CreateSecretArg] ''' - destroy_storage_ = destroy_storage - force_ = force - max_wait_ = max_wait - model_tag_ = model_tag - timeout_ = timeout + args_ = [CreateSecretArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): - raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + self.args = args_ + self.unknown_fields = unknown_fields - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) - if timeout_ is not None and not isinstance(timeout_, int): - raise Exception("Expected timeout_ to be a int, received: {}".format(type(timeout_))) +class CreateSecretURIsArg(Type): + _toSchema = {'count': 'count'} + _toPy = {'count': 'count'} + def __init__(self, count=None, **unknown_fields): + ''' + count : int + ''' + count_ = count - self.destroy_storage = destroy_storage_ - self.force = force_ - self.max_wait = max_wait_ - self.model_tag = model_tag_ - self.timeout = timeout_ + # Validate arguments against known Juju API types. + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + self.count = count_ self.unknown_fields = unknown_fields -class DestroyModelsParams(Type): - _toSchema = {'models': 'models'} - _toPy = {'models': 'models'} - def __init__(self, models=None, **unknown_fields): +class CreateSpaceParams(Type): + _toSchema = {'cidrs': 'cidrs', 'provider_id': 'provider-id', 'public': 'public', 'space_tag': 'space-tag'} + _toPy = {'cidrs': 'cidrs', 'provider-id': 'provider_id', 'public': 'public', 'space-tag': 'space_tag'} + def __init__(self, cidrs=None, provider_id=None, public=None, space_tag=None, **unknown_fields): ''' - models : typing.Sequence[~DestroyModelParams] + cidrs : typing.Sequence[str] + provider_id : str + public : bool + space_tag : str ''' - models_ = [DestroyModelParams.from_json(o) for o in models or []] + cidrs_ = cidrs + provider_id_ = provider_id + public_ = public + space_tag_ = space_tag # Validate arguments against known Juju API types. - if models_ is not None and not isinstance(models_, (bytes, str, list)): - raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + if cidrs_ is not None and not isinstance(cidrs_, (bytes, str, list)): + raise Exception("Expected cidrs_ to be a Sequence, received: {}".format(type(cidrs_))) - self.models = models_ - self.unknown_fields = unknown_fields + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + if public_ is not None and not isinstance(public_, bool): + raise Exception("Expected public_ to be a bool, received: {}".format(type(public_))) + if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): + raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) -class DestroyRelation(Type): - _toSchema = {'endpoints': 'endpoints', 'force': 'force', 'max_wait': 'max-wait', 'relation_id': 'relation-id'} - _toPy = {'endpoints': 'endpoints', 'force': 'force', 'max-wait': 'max_wait', 'relation-id': 'relation_id'} - def __init__(self, endpoints=None, force=None, max_wait=None, relation_id=None, **unknown_fields): - ''' - endpoints : typing.Sequence[str] - force : bool - max_wait : int - relation_id : int - ''' - endpoints_ = endpoints - force_ = force - max_wait_ = max_wait - relation_id_ = relation_id - - # Validate arguments against known Juju API types. - if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): - raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) - - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) - - if relation_id_ is not None and not isinstance(relation_id_, int): - raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) - - self.endpoints = endpoints_ - self.force = force_ - self.max_wait = max_wait_ - self.relation_id = relation_id_ + self.cidrs = cidrs_ + self.provider_id = provider_id_ + self.public = public_ + self.space_tag = space_tag_ self.unknown_fields = unknown_fields -class DestroyUnitInfo(Type): - _toSchema = {'destroyed_storage': 'destroyed-storage', 'detached_storage': 'detached-storage'} - _toPy = {'destroyed-storage': 'destroyed_storage', 'detached-storage': 'detached_storage'} - def __init__(self, destroyed_storage=None, detached_storage=None, **unknown_fields): +class CreateSpacesParams(Type): + _toSchema = {'spaces': 'spaces'} + _toPy = {'spaces': 'spaces'} + def __init__(self, spaces=None, **unknown_fields): ''' - destroyed_storage : typing.Sequence[~Entity] - detached_storage : typing.Sequence[~Entity] + spaces : typing.Sequence[~CreateSpaceParams] ''' - destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] - detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + spaces_ = [CreateSpaceParams.from_json(o) for o in spaces or []] # Validate arguments against known Juju API types. - if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): - raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) - - if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): - raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) - self.destroyed_storage = destroyed_storage_ - self.detached_storage = detached_storage_ + self.spaces = spaces_ self.unknown_fields = unknown_fields -class DestroyUnitParams(Type): - _toSchema = {'destroy_storage': 'destroy-storage', 'dry_run': 'dry-run', 'force': 'force', 'max_wait': 'max-wait', 'unit_tag': 'unit-tag'} - _toPy = {'destroy-storage': 'destroy_storage', 'dry-run': 'dry_run', 'force': 'force', 'max-wait': 'max_wait', 'unit-tag': 'unit_tag'} - def __init__(self, destroy_storage=None, dry_run=None, force=None, max_wait=None, unit_tag=None, **unknown_fields): +class CredentialContent(Type): + _toSchema = {'attrs': 'attrs', 'auth_type': 'auth-type', 'cloud': 'cloud', 'name': 'name', 'valid': 'valid'} + _toPy = {'attrs': 'attrs', 'auth-type': 'auth_type', 'cloud': 'cloud', 'name': 'name', 'valid': 'valid'} + def __init__(self, attrs=None, auth_type=None, cloud=None, name=None, valid=None, **unknown_fields): ''' - destroy_storage : bool - dry_run : bool - force : bool - max_wait : int - unit_tag : str + attrs : typing.Mapping[str, str] + auth_type : str + cloud : str + name : str + valid : bool ''' - destroy_storage_ = destroy_storage - dry_run_ = dry_run - force_ = force - max_wait_ = max_wait - unit_tag_ = unit_tag + attrs_ = attrs + auth_type_ = auth_type + cloud_ = cloud + name_ = name + valid_ = valid # Validate arguments against known Juju API types. - if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): - raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + if attrs_ is not None and not isinstance(attrs_, dict): + raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) - 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 auth_type_ is not None and not isinstance(auth_type_, (bytes, str)): + raise Exception("Expected auth_type_ to be a str, received: {}".format(type(auth_type_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if cloud_ is not None and not isinstance(cloud_, (bytes, str)): + raise Exception("Expected cloud_ to be a str, received: {}".format(type(cloud_))) - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): - raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + if valid_ is not None and not isinstance(valid_, bool): + raise Exception("Expected valid_ to be a bool, received: {}".format(type(valid_))) - self.destroy_storage = destroy_storage_ - self.dry_run = dry_run_ - self.force = force_ - self.max_wait = max_wait_ - self.unit_tag = unit_tag_ + self.attrs = attrs_ + self.auth_type = auth_type_ + self.cloud = cloud_ + self.name = name_ + self.valid = valid_ self.unknown_fields = unknown_fields -class DestroyUnitResult(Type): - _toSchema = {'error': 'error', 'info': 'info'} - _toPy = {'error': 'error', 'info': 'info'} - def __init__(self, error=None, info=None, **unknown_fields): +class CredentialContentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - info : DestroyUnitInfo + result : ControllerCredentialInfo ''' error_ = Error.from_json(error) if error else None - info_ = DestroyUnitInfo.from_json(info) if info else None + result_ = ControllerCredentialInfo.from_json(result) if result else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if info_ is not None and not isinstance(info_, (dict, DestroyUnitInfo)): - raise Exception("Expected info_ to be a DestroyUnitInfo, received: {}".format(type(info_))) + if result_ is not None and not isinstance(result_, (dict, ControllerCredentialInfo)): + raise Exception("Expected result_ to be a ControllerCredentialInfo, received: {}".format(type(result_))) self.error = error_ - self.info = info_ + self.result = result_ self.unknown_fields = unknown_fields -class DestroyUnitResults(Type): +class CredentialContentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~DestroyUnitResult] + results : typing.Sequence[~CredentialContentResult] ''' - results_ = [DestroyUnitResult.from_json(o) for o in results or []] + results_ = [CredentialContentResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -6577,2051 +7468,2039 @@ def __init__(self, results=None, **unknown_fields): -class DestroyUnitsParams(Type): - _toSchema = {'units': 'units'} - _toPy = {'units': 'units'} - def __init__(self, units=None, **unknown_fields): +class DashboardConnectionInfo(Type): + _toSchema = {'error': 'error', 'proxy_connection': 'proxy-connection', 'ssh_connection': 'ssh-connection'} + _toPy = {'error': 'error', 'proxy-connection': 'proxy_connection', 'ssh-connection': 'ssh_connection'} + def __init__(self, error=None, proxy_connection=None, ssh_connection=None, **unknown_fields): ''' - units : typing.Sequence[~DestroyUnitParams] + error : Error + proxy_connection : Proxy + ssh_connection : DashboardConnectionSSHTunnel ''' - units_ = [DestroyUnitParams.from_json(o) for o in units or []] + error_ = Error.from_json(error) if error else None + proxy_connection_ = Proxy.from_json(proxy_connection) if proxy_connection else None + ssh_connection_ = DashboardConnectionSSHTunnel.from_json(ssh_connection) if ssh_connection else None # Validate arguments against known Juju API types. - if units_ is not None and not isinstance(units_, (bytes, str, list)): - raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.units = units_ + if proxy_connection_ is not None and not isinstance(proxy_connection_, (dict, Proxy)): + raise Exception("Expected proxy_connection_ to be a Proxy, received: {}".format(type(proxy_connection_))) + + if ssh_connection_ is not None and not isinstance(ssh_connection_, (dict, DashboardConnectionSSHTunnel)): + raise Exception("Expected ssh_connection_ to be a DashboardConnectionSSHTunnel, received: {}".format(type(ssh_connection_))) + + self.error = error_ + self.proxy_connection = proxy_connection_ + self.ssh_connection = ssh_connection_ self.unknown_fields = unknown_fields -class DetailedStatus(Type): - _toSchema = {'data': 'data', 'err': 'err', 'info': 'info', 'kind': 'kind', 'life': 'life', 'since': 'since', 'status': 'status', 'version': 'version'} - _toPy = {'data': 'data', 'err': 'err', 'info': 'info', 'kind': 'kind', 'life': 'life', 'since': 'since', 'status': 'status', 'version': 'version'} - def __init__(self, data=None, err=None, info=None, kind=None, life=None, since=None, status=None, version=None, **unknown_fields): +class DashboardConnectionSSHTunnel(Type): + _toSchema = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'} + _toPy = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'} + def __init__(self, entity=None, host=None, model=None, port=None, **unknown_fields): ''' - data : typing.Mapping[str, typing.Any] - err : Error - info : str - kind : str - life : str - since : str - status : str - version : str + entity : str + host : str + model : str + port : str ''' - data_ = data - err_ = Error.from_json(err) if err else None - info_ = info - kind_ = kind - life_ = life - since_ = since - status_ = status - version_ = version + entity_ = entity + host_ = host + model_ = model + port_ = port # Validate arguments against known Juju API types. - if data_ is not None and not isinstance(data_, dict): - raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - - if err_ is not None and not isinstance(err_, (dict, Error)): - raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) - - if info_ is not None and not isinstance(info_, (bytes, str)): - raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) - - if kind_ is not None and not isinstance(kind_, (bytes, str)): - raise Exception("Expected kind_ to be a str, received: {}".format(type(kind_))) - - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if entity_ is not None and not isinstance(entity_, (bytes, str)): + raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) - if since_ is not None and not isinstance(since_, (bytes, str)): - raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + if host_ is not None and not isinstance(host_, (bytes, str)): + raise Exception("Expected host_ to be a str, received: {}".format(type(host_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) - if version_ is not None and not isinstance(version_, (bytes, str)): - raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + if port_ is not None and not isinstance(port_, (bytes, str)): + raise Exception("Expected port_ to be a str, received: {}".format(type(port_))) - self.data = data_ - self.err = err_ - self.info = info_ - self.kind = kind_ - self.life = life_ - self.since = since_ - self.status = status_ - self.version = version_ + self.entity = entity_ + self.host = host_ + self.model = model_ + self.port = port_ self.unknown_fields = unknown_fields -class DownloadInfoResult(Type): - _toSchema = {'charm_origin': 'charm-origin', 'url': 'url'} - _toPy = {'charm-origin': 'charm_origin', 'url': 'url'} - def __init__(self, charm_origin=None, url=None, **unknown_fields): - ''' - charm_origin : CharmOrigin - url : str +class DeleteSecretArg(Type): + _toSchema = {'label': 'label', 'revisions': 'revisions', 'uri': 'uri'} + _toPy = {'label': 'label', 'revisions': 'revisions', 'uri': 'uri'} + def __init__(self, label=None, revisions=None, uri=None, **unknown_fields): ''' - charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None - url_ = url + label : str + revisions : typing.Sequence[int] + uri : str + ''' + label_ = label + revisions_ = revisions + uri_ = uri # Validate arguments against known Juju API types. - if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): - raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + if revisions_ is not None and not isinstance(revisions_, (bytes, str, list)): + raise Exception("Expected revisions_ to be a Sequence, received: {}".format(type(revisions_))) - self.charm_origin = charm_origin_ - self.url = url_ + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.label = label_ + self.revisions = revisions_ + self.uri = uri_ self.unknown_fields = unknown_fields -class DownloadInfoResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class DeleteSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - results : typing.Sequence[~DownloadInfoResult] + args : typing.Sequence[~DeleteSecretArg] ''' - results_ = [DownloadInfoResult.from_json(o) for o in results or []] + args_ = [DeleteSecretArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.results = results_ + self.args = args_ self.unknown_fields = unknown_fields -class DumpModelRequest(Type): - _toSchema = {'entities': 'entities', 'simplified': 'simplified'} - _toPy = {'entities': 'entities', 'simplified': 'simplified'} - def __init__(self, entities=None, simplified=None, **unknown_fields): +class Delta(Type): + _toSchema = {'entity': 'entity', 'removed': 'removed'} + _toPy = {'entity': 'entity', 'removed': 'removed'} + def __init__(self, entity=None, removed=None, **unknown_fields): ''' - entities : typing.Sequence[~Entity] - simplified : bool + entity : Any + removed : bool ''' - entities_ = [Entity.from_json(o) for o in entities or []] - simplified_ = simplified + entity_ = entity + removed_ = removed # Validate arguments against known Juju API types. - if entities_ is not None and not isinstance(entities_, (bytes, str, list)): - raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - - if simplified_ is not None and not isinstance(simplified_, bool): - raise Exception("Expected simplified_ to be a bool, received: {}".format(type(simplified_))) + if removed_ is not None and not isinstance(removed_, bool): + raise Exception("Expected removed_ to be a bool, received: {}".format(type(removed_))) - self.entities = entities_ - self.simplified = simplified_ + self.entity = entity_ + self.removed = removed_ self.unknown_fields = unknown_fields -class EndpointFilterAttributes(Type): - _toSchema = {'interface': 'interface', 'name': 'name', 'role': 'role'} - _toPy = {'interface': 'interface', 'name': 'name', 'role': 'role'} - def __init__(self, interface=None, name=None, role=None, **unknown_fields): +class DeployFromRepositoryArg(Type): + _toSchema = {'applicationname': 'ApplicationName', 'attachstorage': 'AttachStorage', 'base': 'base', 'channel': 'channel', 'charmname': 'CharmName', 'configyaml': 'ConfigYAML', 'cons': 'Cons', 'devices': 'Devices', 'dryrun': 'DryRun', 'endpoint_bindings': 'endpoint-bindings', 'force': 'force', 'num_units': 'num-units', 'placement': 'Placement', 'resources': 'resources', 'revision': 'revision', 'storage': 'Storage', 'trust': 'Trust'} + _toPy = {'ApplicationName': 'applicationname', 'AttachStorage': 'attachstorage', 'CharmName': 'charmname', 'ConfigYAML': 'configyaml', 'Cons': 'cons', 'Devices': 'devices', 'DryRun': 'dryrun', 'Placement': 'placement', 'Storage': 'storage', 'Trust': 'trust', 'base': 'base', 'channel': 'channel', 'endpoint-bindings': 'endpoint_bindings', 'force': 'force', 'num-units': 'num_units', 'resources': 'resources', 'revision': 'revision'} + def __init__(self, applicationname=None, attachstorage=None, charmname=None, configyaml=None, cons=None, devices=None, dryrun=None, placement=None, storage=None, trust=None, base=None, channel=None, endpoint_bindings=None, force=None, num_units=None, resources=None, revision=None, **unknown_fields): ''' - interface : str - name : str - role : str + applicationname : str + attachstorage : typing.Sequence[str] + charmname : str + configyaml : str + cons : Value + devices : typing.Mapping[str, ~Constraints] + dryrun : bool + placement : typing.Sequence[~Placement] + storage : typing.Mapping[str, ~Constraints] + trust : bool + base : Base + channel : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + num_units : int + resources : typing.Mapping[str, str] + revision : int ''' - interface_ = interface - name_ = name - role_ = role + applicationname_ = applicationname + attachstorage_ = attachstorage + charmname_ = charmname + configyaml_ = configyaml + cons_ = Value.from_json(cons) if cons else None + devices_ = {k: Constraints.from_json(v) for k, v in (devices or dict()).items()} + dryrun_ = dryrun + placement_ = [Placement.from_json(o) for o in placement or []] + storage_ = {k: Constraints.from_json(v) for k, v in (storage or dict()).items()} + trust_ = trust + base_ = Base.from_json(base) if base else None + channel_ = channel + endpoint_bindings_ = endpoint_bindings + force_ = force + num_units_ = num_units + resources_ = resources + revision_ = revision # Validate arguments against known Juju API types. - if interface_ is not None and not isinstance(interface_, (bytes, str)): - raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + if applicationname_ is not None and not isinstance(applicationname_, (bytes, str)): + raise Exception("Expected applicationname_ to be a str, received: {}".format(type(applicationname_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if attachstorage_ is not None and not isinstance(attachstorage_, (bytes, str, list)): + raise Exception("Expected attachstorage_ to be a Sequence, received: {}".format(type(attachstorage_))) - if role_ is not None and not isinstance(role_, (bytes, str)): - raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + if charmname_ is not None and not isinstance(charmname_, (bytes, str)): + raise Exception("Expected charmname_ to be a str, received: {}".format(type(charmname_))) - self.interface = interface_ - self.name = name_ - self.role = role_ - self.unknown_fields = unknown_fields + if configyaml_ is not None and not isinstance(configyaml_, (bytes, str)): + raise Exception("Expected configyaml_ to be a str, received: {}".format(type(configyaml_))) + if cons_ is not None and not isinstance(cons_, (dict, Value)): + raise Exception("Expected cons_ to be a Value, received: {}".format(type(cons_))) + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) -class EndpointRelationData(Type): - _toSchema = {'applicationdata': 'ApplicationData', 'cross_model': 'cross-model', 'endpoint': 'endpoint', 'related_endpoint': 'related-endpoint', 'relation_id': 'relation-id', 'unit_relation_data': 'unit-relation-data'} - _toPy = {'ApplicationData': 'applicationdata', 'cross-model': 'cross_model', 'endpoint': 'endpoint', 'related-endpoint': 'related_endpoint', 'relation-id': 'relation_id', 'unit-relation-data': 'unit_relation_data'} - def __init__(self, applicationdata=None, cross_model=None, endpoint=None, related_endpoint=None, relation_id=None, unit_relation_data=None, **unknown_fields): - ''' - applicationdata : typing.Mapping[str, typing.Any] - cross_model : bool - endpoint : str - related_endpoint : str - relation_id : int - unit_relation_data : typing.Mapping[str, ~RelationData] - ''' - applicationdata_ = applicationdata - cross_model_ = cross_model - endpoint_ = endpoint - related_endpoint_ = related_endpoint - relation_id_ = relation_id - unit_relation_data_ = {k: RelationData.from_json(v) for k, v in (unit_relation_data or dict()).items()} + if dryrun_ is not None and not isinstance(dryrun_, bool): + raise Exception("Expected dryrun_ to be a bool, received: {}".format(type(dryrun_))) - # Validate arguments against known Juju API types. - if applicationdata_ is not None and not isinstance(applicationdata_, dict): - raise Exception("Expected applicationdata_ to be a Mapping, received: {}".format(type(applicationdata_))) + if placement_ is not None and not isinstance(placement_, (bytes, str, list)): + raise Exception("Expected placement_ to be a Sequence, received: {}".format(type(placement_))) - if cross_model_ is not None and not isinstance(cross_model_, bool): - raise Exception("Expected cross_model_ to be a bool, received: {}".format(type(cross_model_))) + if storage_ is not None and not isinstance(storage_, dict): + raise Exception("Expected storage_ to be a Mapping, received: {}".format(type(storage_))) - if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): - raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + if trust_ is not None and not isinstance(trust_, bool): + raise Exception("Expected trust_ to be a bool, received: {}".format(type(trust_))) - if related_endpoint_ is not None and not isinstance(related_endpoint_, (bytes, str)): - raise Exception("Expected related_endpoint_ to be a str, received: {}".format(type(related_endpoint_))) + if base_ is not None and not isinstance(base_, (dict, Base)): + raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) - if relation_id_ is not None and not isinstance(relation_id_, int): - raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) - if unit_relation_data_ is not None and not isinstance(unit_relation_data_, dict): - raise Exception("Expected unit_relation_data_ to be a Mapping, received: {}".format(type(unit_relation_data_))) + if endpoint_bindings_ is not None and not isinstance(endpoint_bindings_, dict): + raise Exception("Expected endpoint_bindings_ to be a Mapping, received: {}".format(type(endpoint_bindings_))) - self.applicationdata = applicationdata_ - self.cross_model = cross_model_ - self.endpoint = endpoint_ - self.related_endpoint = related_endpoint_ - self.relation_id = relation_id_ - self.unit_relation_data = unit_relation_data_ + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if num_units_ is not None and not isinstance(num_units_, int): + raise Exception("Expected num_units_ to be a int, received: {}".format(type(num_units_))) + + if resources_ is not None and not isinstance(resources_, dict): + raise Exception("Expected resources_ to be a Mapping, received: {}".format(type(resources_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + self.applicationname = applicationname_ + self.attachstorage = attachstorage_ + self.charmname = charmname_ + self.configyaml = configyaml_ + self.cons = cons_ + self.devices = devices_ + self.dryrun = dryrun_ + self.placement = placement_ + self.storage = storage_ + self.trust = trust_ + self.base = base_ + self.channel = channel_ + self.endpoint_bindings = endpoint_bindings_ + self.force = force_ + self.num_units = num_units_ + self.resources = resources_ + self.revision = revision_ self.unknown_fields = unknown_fields -class EndpointStatus(Type): - _toSchema = {'application': 'application', 'name': 'name', 'role': 'role', 'subordinate': 'subordinate'} - _toPy = {'application': 'application', 'name': 'name', 'role': 'role', 'subordinate': 'subordinate'} - def __init__(self, application=None, name=None, role=None, subordinate=None, **unknown_fields): +class DeployFromRepositoryArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - application : str - name : str - role : str - subordinate : bool + args : typing.Sequence[~DeployFromRepositoryArg] ''' - application_ = application - name_ = name - role_ = role - subordinate_ = subordinate + args_ = [DeployFromRepositoryArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if application_ is not None and not isinstance(application_, (bytes, str)): - raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if role_ is not None and not isinstance(role_, (bytes, str)): - raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) - - if subordinate_ is not None and not isinstance(subordinate_, bool): - raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.application = application_ - self.name = name_ - self.role = role_ - self.subordinate = subordinate_ + self.args = args_ self.unknown_fields = unknown_fields -class EnqueuedActions(Type): - _toSchema = {'actions': 'actions', 'operation': 'operation'} - _toPy = {'actions': 'actions', 'operation': 'operation'} - def __init__(self, actions=None, operation=None, **unknown_fields): +class DeployFromRepositoryInfo(Type): + _toSchema = {'architecture': 'architecture', 'base': 'base', 'channel': 'channel', 'effective_channel': 'effective-channel', 'name': 'name', 'revision': 'revision'} + _toPy = {'architecture': 'architecture', 'base': 'base', 'channel': 'channel', 'effective-channel': 'effective_channel', 'name': 'name', 'revision': 'revision'} + def __init__(self, architecture=None, base=None, channel=None, effective_channel=None, name=None, revision=None, **unknown_fields): ''' - actions : typing.Sequence[~ActionResult] - operation : str + architecture : str + base : Base + channel : str + effective_channel : str + name : str + revision : int ''' - actions_ = [ActionResult.from_json(o) for o in actions or []] - operation_ = operation + architecture_ = architecture + base_ = Base.from_json(base) if base else None + channel_ = channel + effective_channel_ = effective_channel + name_ = name + revision_ = revision # Validate arguments against known Juju API types. - if actions_ is not None and not isinstance(actions_, (bytes, str, list)): - raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + if architecture_ is not None and not isinstance(architecture_, (bytes, str)): + raise Exception("Expected architecture_ to be a str, received: {}".format(type(architecture_))) - if operation_ is not None and not isinstance(operation_, (bytes, str)): - raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + if base_ is not None and not isinstance(base_, (dict, Base)): + raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) - self.actions = actions_ - self.operation = operation_ + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + + if effective_channel_ is not None and not isinstance(effective_channel_, (bytes, str)): + raise Exception("Expected effective_channel_ to be a str, received: {}".format(type(effective_channel_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + self.architecture = architecture_ + self.base = base_ + self.channel = channel_ + self.effective_channel = effective_channel_ + self.name = name_ + self.revision = revision_ self.unknown_fields = unknown_fields -class Entities(Type): - _toSchema = {'entities': 'entities'} - _toPy = {'entities': 'entities'} - def __init__(self, entities=None, **unknown_fields): +class DeployFromRepositoryResult(Type): + _toSchema = {'errors': 'Errors', 'info': 'Info', 'pendingresourceuploads': 'PendingResourceUploads'} + _toPy = {'Errors': 'errors', 'Info': 'info', 'PendingResourceUploads': 'pendingresourceuploads'} + def __init__(self, errors=None, info=None, pendingresourceuploads=None, **unknown_fields): ''' - entities : typing.Sequence[~Entity] + errors : typing.Sequence[~Error] + info : DeployFromRepositoryInfo + pendingresourceuploads : typing.Sequence[~PendingResourceUpload] ''' - entities_ = [Entity.from_json(o) for o in entities or []] + errors_ = [Error.from_json(o) for o in errors or []] + info_ = DeployFromRepositoryInfo.from_json(info) if info else None + pendingresourceuploads_ = [PendingResourceUpload.from_json(o) for o in pendingresourceuploads or []] # Validate arguments against known Juju API types. - if entities_ is not None and not isinstance(entities_, (bytes, str, list)): - raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + if errors_ is not None and not isinstance(errors_, (bytes, str, list)): + raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) - self.entities = entities_ + if info_ is not None and not isinstance(info_, (dict, DeployFromRepositoryInfo)): + raise Exception("Expected info_ to be a DeployFromRepositoryInfo, received: {}".format(type(info_))) + + if pendingresourceuploads_ is not None and not isinstance(pendingresourceuploads_, (bytes, str, list)): + raise Exception("Expected pendingresourceuploads_ to be a Sequence, received: {}".format(type(pendingresourceuploads_))) + + self.errors = errors_ + self.info = info_ + self.pendingresourceuploads = pendingresourceuploads_ self.unknown_fields = unknown_fields -class Entity(Type): - _toSchema = {'tag': 'tag'} - _toPy = {'tag': 'tag'} - def __init__(self, tag=None, **unknown_fields): +class DeployFromRepositoryResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - tag : str + results : typing.Sequence[~DeployFromRepositoryResult] ''' - tag_ = tag + results_ = [DeployFromRepositoryResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.tag = tag_ + self.results = results_ self.unknown_fields = unknown_fields -class EntityAnnotations(Type): - _toSchema = {'annotations': 'annotations', 'entity': 'entity'} - _toPy = {'annotations': 'annotations', 'entity': 'entity'} - def __init__(self, annotations=None, entity=None, **unknown_fields): +class DeployerConnectionValues(Type): + _toSchema = {'api_addresses': 'api-addresses'} + _toPy = {'api-addresses': 'api_addresses'} + def __init__(self, api_addresses=None, **unknown_fields): ''' - annotations : typing.Mapping[str, str] - entity : str + api_addresses : typing.Sequence[str] ''' - annotations_ = annotations - entity_ = entity + api_addresses_ = api_addresses # Validate arguments against known Juju API types. - if annotations_ is not None and not isinstance(annotations_, dict): - raise Exception("Expected annotations_ to be a Mapping, received: {}".format(type(annotations_))) - - if entity_ is not None and not isinstance(entity_, (bytes, str)): - raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) - self.annotations = annotations_ - self.entity = entity_ + self.api_addresses = api_addresses_ self.unknown_fields = unknown_fields -class EntityMetrics(Type): - _toSchema = {'error': 'error', 'metrics': 'metrics'} - _toPy = {'error': 'error', 'metrics': 'metrics'} - def __init__(self, error=None, metrics=None, **unknown_fields): +class DestroyApplicationInfo(Type): + _toSchema = {'destroyed_storage': 'destroyed-storage', 'destroyed_units': 'destroyed-units', 'detached_storage': 'detached-storage'} + _toPy = {'destroyed-storage': 'destroyed_storage', 'destroyed-units': 'destroyed_units', 'detached-storage': 'detached_storage'} + def __init__(self, destroyed_storage=None, destroyed_units=None, detached_storage=None, **unknown_fields): ''' - error : Error - metrics : typing.Sequence[~MetricResult] + destroyed_storage : typing.Sequence[~Entity] + destroyed_units : typing.Sequence[~Entity] + detached_storage : typing.Sequence[~Entity] ''' - error_ = Error.from_json(error) if error else None - metrics_ = [MetricResult.from_json(o) for o in metrics or []] + destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] + destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] + detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): + raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) - if metrics_ is not None and not isinstance(metrics_, (bytes, str, list)): - raise Exception("Expected metrics_ to be a Sequence, received: {}".format(type(metrics_))) + if destroyed_units_ is not None and not isinstance(destroyed_units_, (bytes, str, list)): + raise Exception("Expected destroyed_units_ to be a Sequence, received: {}".format(type(destroyed_units_))) - self.error = error_ - self.metrics = metrics_ + if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): + raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + + self.destroyed_storage = destroyed_storage_ + self.destroyed_units = destroyed_units_ + self.detached_storage = detached_storage_ self.unknown_fields = unknown_fields -class EntityPassword(Type): - _toSchema = {'password': 'password', 'tag': 'tag'} - _toPy = {'password': 'password', 'tag': 'tag'} - def __init__(self, password=None, tag=None, **unknown_fields): +class DestroyApplicationOffers(Type): + _toSchema = {'force': 'force', 'offer_urls': 'offer-urls'} + _toPy = {'force': 'force', 'offer-urls': 'offer_urls'} + def __init__(self, force=None, offer_urls=None, **unknown_fields): ''' - password : str - tag : str + force : bool + offer_urls : typing.Sequence[str] ''' - password_ = password - tag_ = tag + force_ = force + offer_urls_ = offer_urls # Validate arguments against known Juju API types. - if password_ is not None and not isinstance(password_, (bytes, str)): - raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if offer_urls_ is not None and not isinstance(offer_urls_, (bytes, str, list)): + raise Exception("Expected offer_urls_ to be a Sequence, received: {}".format(type(offer_urls_))) - self.password = password_ - self.tag = tag_ + self.force = force_ + self.offer_urls = offer_urls_ self.unknown_fields = unknown_fields -class EntityPasswords(Type): - _toSchema = {'changes': 'changes'} - _toPy = {'changes': 'changes'} - def __init__(self, changes=None, **unknown_fields): +class DestroyApplicationParams(Type): + _toSchema = {'application_tag': 'application-tag', 'destroy_storage': 'destroy-storage', 'dry_run': 'dry-run', 'force': 'force', 'max_wait': 'max-wait'} + _toPy = {'application-tag': 'application_tag', 'destroy-storage': 'destroy_storage', 'dry-run': 'dry_run', 'force': 'force', 'max-wait': 'max_wait'} + def __init__(self, application_tag=None, destroy_storage=None, dry_run=None, force=None, max_wait=None, **unknown_fields): ''' - changes : typing.Sequence[~EntityPassword] + application_tag : str + destroy_storage : bool + dry_run : bool + force : bool + max_wait : int ''' - changes_ = [EntityPassword.from_json(o) for o in changes or []] + application_tag_ = application_tag + destroy_storage_ = destroy_storage + dry_run_ = dry_run + force_ = force + max_wait_ = max_wait # Validate arguments against known Juju API types. - if changes_ is not None and not isinstance(changes_, (bytes, str, list)): - raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - self.changes = changes_ + if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): + raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + + if dry_run_ is not None and not isinstance(dry_run_, bool): + raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + + self.application_tag = application_tag_ + self.destroy_storage = destroy_storage_ + self.dry_run = dry_run_ + self.force = force_ + self.max_wait = max_wait_ self.unknown_fields = unknown_fields -class EntityStatus(Type): - _toSchema = {'data': 'data', 'info': 'info', 'since': 'since', 'status': 'status'} - _toPy = {'data': 'data', 'info': 'info', 'since': 'since', 'status': 'status'} - def __init__(self, data=None, info=None, since=None, status=None, **unknown_fields): +class DestroyApplicationResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' - data : typing.Mapping[str, typing.Any] - info : str - since : str - status : str + error : Error + info : DestroyApplicationInfo ''' - data_ = data - info_ = info - since_ = since - status_ = status + error_ = Error.from_json(error) if error else None + info_ = DestroyApplicationInfo.from_json(info) if info else None # Validate arguments against known Juju API types. - if data_ is not None and not isinstance(data_, dict): - raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - - if info_ is not None and not isinstance(info_, (bytes, str)): - raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) - - if since_ is not None and not isinstance(since_, (bytes, str)): - raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if info_ is not None and not isinstance(info_, (dict, DestroyApplicationInfo)): + raise Exception("Expected info_ to be a DestroyApplicationInfo, received: {}".format(type(info_))) - self.data = data_ + self.error = error_ self.info = info_ - self.since = since_ - self.status = status_ self.unknown_fields = unknown_fields -class Error(Type): - _toSchema = {'code': 'code', 'info': 'info', 'message': 'message'} - _toPy = {'code': 'code', 'info': 'info', 'message': 'message'} - def __init__(self, code=None, info=None, message=None, **unknown_fields): +class DestroyApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - code : str - info : typing.Mapping[str, typing.Any] - message : str + results : typing.Sequence[~DestroyApplicationResult] ''' - code_ = code - info_ = info - message_ = message + results_ = [DestroyApplicationResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if code_ is not None and not isinstance(code_, (bytes, str)): - raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) - - if info_ is not None and not isinstance(info_, dict): - raise Exception("Expected info_ to be a Mapping, received: {}".format(type(info_))) - - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.code = code_ - self.info = info_ - self.message = message_ + self.results = results_ self.unknown_fields = unknown_fields -class ErrorResult(Type): - _toSchema = {'error': 'error'} - _toPy = {'error': 'error'} - def __init__(self, error=None, **unknown_fields): +class DestroyApplicationsParams(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' - error : Error + applications : typing.Sequence[~DestroyApplicationParams] ''' - error_ = Error.from_json(error) if error else None + applications_ = [DestroyApplicationParams.from_json(o) for o in applications or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - self.error = error_ + self.applications = applications_ self.unknown_fields = unknown_fields -class ErrorResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class DestroyConsumedApplicationParams(Type): + _toSchema = {'application_tag': 'application-tag', 'force': 'force', 'max_wait': 'max-wait'} + _toPy = {'application-tag': 'application_tag', 'force': 'force', 'max-wait': 'max_wait'} + def __init__(self, application_tag=None, force=None, max_wait=None, **unknown_fields): ''' - results : typing.Sequence[~ErrorResult] + application_tag : str + force : bool + max_wait : int ''' - results_ = [ErrorResult.from_json(o) for o in results or []] + application_tag_ = application_tag + force_ = force + max_wait_ = max_wait # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - self.results = results_ + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + + self.application_tag = application_tag_ + self.force = force_ + self.max_wait = max_wait_ self.unknown_fields = unknown_fields -class ExportBundleParams(Type): - _toSchema = {'include_charm_defaults': 'include-charm-defaults', 'include_series': 'include-series'} - _toPy = {'include-charm-defaults': 'include_charm_defaults', 'include-series': 'include_series'} - def __init__(self, include_charm_defaults=None, include_series=None, **unknown_fields): +class DestroyConsumedApplicationsParams(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' - include_charm_defaults : bool - include_series : bool + applications : typing.Sequence[~DestroyConsumedApplicationParams] ''' - include_charm_defaults_ = include_charm_defaults - include_series_ = include_series + applications_ = [DestroyConsumedApplicationParams.from_json(o) for o in applications or []] # Validate arguments against known Juju API types. - if include_charm_defaults_ is not None and not isinstance(include_charm_defaults_, bool): - raise Exception("Expected include_charm_defaults_ to be a bool, received: {}".format(type(include_charm_defaults_))) - - if include_series_ is not None and not isinstance(include_series_, bool): - raise Exception("Expected include_series_ to be a bool, received: {}".format(type(include_series_))) + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - self.include_charm_defaults = include_charm_defaults_ - self.include_series = include_series_ + self.applications = applications_ self.unknown_fields = unknown_fields -class ExposedEndpoint(Type): - _toSchema = {'expose_to_cidrs': 'expose-to-cidrs', 'expose_to_spaces': 'expose-to-spaces'} - _toPy = {'expose-to-cidrs': 'expose_to_cidrs', 'expose-to-spaces': 'expose_to_spaces'} - def __init__(self, expose_to_cidrs=None, expose_to_spaces=None, **unknown_fields): +class DestroyControllerArgs(Type): + _toSchema = {'destroy_models': 'destroy-models', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'model_timeout': 'model-timeout'} + _toPy = {'destroy-models': 'destroy_models', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'model-timeout': 'model_timeout'} + def __init__(self, destroy_models=None, destroy_storage=None, force=None, max_wait=None, model_timeout=None, **unknown_fields): ''' - expose_to_cidrs : typing.Sequence[str] - expose_to_spaces : typing.Sequence[str] + destroy_models : bool + destroy_storage : bool + force : bool + max_wait : int + model_timeout : int ''' - expose_to_cidrs_ = expose_to_cidrs - expose_to_spaces_ = expose_to_spaces + destroy_models_ = destroy_models + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + model_timeout_ = model_timeout # Validate arguments against known Juju API types. - if expose_to_cidrs_ is not None and not isinstance(expose_to_cidrs_, (bytes, str, list)): - raise Exception("Expected expose_to_cidrs_ to be a Sequence, received: {}".format(type(expose_to_cidrs_))) - - if expose_to_spaces_ is not None and not isinstance(expose_to_spaces_, (bytes, str, list)): - raise Exception("Expected expose_to_spaces_ to be a Sequence, received: {}".format(type(expose_to_spaces_))) + if destroy_models_ is not None and not isinstance(destroy_models_, bool): + raise Exception("Expected destroy_models_ to be a bool, received: {}".format(type(destroy_models_))) - self.expose_to_cidrs = expose_to_cidrs_ - self.expose_to_spaces = expose_to_spaces_ - self.unknown_fields = unknown_fields + if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): + raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) -class ExpressionTree(Type): - _toSchema = {'expression': 'Expression'} - _toPy = {'Expression': 'expression'} - def __init__(self, expression=None, **unknown_fields): - ''' - expression : Any - ''' - expression_ = expression + if model_timeout_ is not None and not isinstance(model_timeout_, int): + raise Exception("Expected model_timeout_ to be a int, received: {}".format(type(model_timeout_))) - # Validate arguments against known Juju API types. - self.expression = expression_ + self.destroy_models = destroy_models_ + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.model_timeout = model_timeout_ self.unknown_fields = unknown_fields -class ExternalControllerInfo(Type): - _toSchema = {'addrs': 'addrs', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag'} - _toPy = {'addrs': 'addrs', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag'} - def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_tag=None, **unknown_fields): +class DestroyMachineInfo(Type): + _toSchema = {'destroyed_containers': 'destroyed-containers', 'destroyed_storage': 'destroyed-storage', 'destroyed_units': 'destroyed-units', 'detached_storage': 'detached-storage', 'machine_id': 'machine-id'} + _toPy = {'destroyed-containers': 'destroyed_containers', 'destroyed-storage': 'destroyed_storage', 'destroyed-units': 'destroyed_units', 'detached-storage': 'detached_storage', 'machine-id': 'machine_id'} + def __init__(self, destroyed_containers=None, destroyed_storage=None, destroyed_units=None, detached_storage=None, machine_id=None, **unknown_fields): ''' - addrs : typing.Sequence[str] - ca_cert : str - controller_alias : str - controller_tag : str + destroyed_containers : typing.Sequence[~DestroyMachineResult] + destroyed_storage : typing.Sequence[~Entity] + destroyed_units : typing.Sequence[~Entity] + detached_storage : typing.Sequence[~Entity] + machine_id : str ''' - addrs_ = addrs - ca_cert_ = ca_cert - controller_alias_ = controller_alias - controller_tag_ = controller_tag + destroyed_containers_ = [DestroyMachineResult.from_json(o) for o in destroyed_containers or []] + destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] + destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] + detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + machine_id_ = machine_id # Validate arguments against known Juju API types. - if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): - raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) + if destroyed_containers_ is not None and not isinstance(destroyed_containers_, (bytes, str, list)): + raise Exception("Expected destroyed_containers_ to be a Sequence, received: {}".format(type(destroyed_containers_))) - if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): - raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): + raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) - if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): - raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) + if destroyed_units_ is not None and not isinstance(destroyed_units_, (bytes, str, list)): + raise Exception("Expected destroyed_units_ to be a Sequence, received: {}".format(type(destroyed_units_))) - if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): - raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) + if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): + raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) - self.addrs = addrs_ - self.ca_cert = ca_cert_ - self.controller_alias = controller_alias_ - self.controller_tag = controller_tag_ + if machine_id_ is not None and not isinstance(machine_id_, (bytes, str)): + raise Exception("Expected machine_id_ to be a str, received: {}".format(type(machine_id_))) + + self.destroyed_containers = destroyed_containers_ + self.destroyed_storage = destroyed_storage_ + self.destroyed_units = destroyed_units_ + self.detached_storage = detached_storage_ + self.machine_id = machine_id_ self.unknown_fields = unknown_fields -class FilesystemAttachmentDetails(Type): - _toSchema = {'filesystemattachmentinfo': 'FilesystemAttachmentInfo', 'life': 'life', 'mount_point': 'mount-point', 'read_only': 'read-only'} - _toPy = {'FilesystemAttachmentInfo': 'filesystemattachmentinfo', 'life': 'life', 'mount-point': 'mount_point', 'read-only': 'read_only'} - def __init__(self, filesystemattachmentinfo=None, life=None, mount_point=None, read_only=None, **unknown_fields): +class DestroyMachineResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' - filesystemattachmentinfo : FilesystemAttachmentInfo - life : str - mount_point : str - read_only : bool + error : Error + info : DestroyMachineInfo ''' - filesystemattachmentinfo_ = FilesystemAttachmentInfo.from_json(filesystemattachmentinfo) if filesystemattachmentinfo else None - life_ = life - mount_point_ = mount_point - read_only_ = read_only + error_ = Error.from_json(error) if error else None + info_ = DestroyMachineInfo.from_json(info) if info else None # Validate arguments against known Juju API types. - if filesystemattachmentinfo_ is not None and not isinstance(filesystemattachmentinfo_, (dict, FilesystemAttachmentInfo)): - raise Exception("Expected filesystemattachmentinfo_ to be a FilesystemAttachmentInfo, received: {}".format(type(filesystemattachmentinfo_))) - - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - - if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): - raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if read_only_ is not None and not isinstance(read_only_, bool): - raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + if info_ is not None and not isinstance(info_, (dict, DestroyMachineInfo)): + raise Exception("Expected info_ to be a DestroyMachineInfo, received: {}".format(type(info_))) - self.filesystemattachmentinfo = filesystemattachmentinfo_ - self.life = life_ - self.mount_point = mount_point_ - self.read_only = read_only_ + self.error = error_ + self.info = info_ self.unknown_fields = unknown_fields -class FilesystemAttachmentInfo(Type): - _toSchema = {'mount_point': 'mount-point', 'read_only': 'read-only'} - _toPy = {'mount-point': 'mount_point', 'read-only': 'read_only'} - def __init__(self, mount_point=None, read_only=None, **unknown_fields): - ''' - mount_point : str - read_only : bool +class DestroyMachineResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - mount_point_ = mount_point - read_only_ = read_only + results : typing.Sequence[~DestroyMachineResult] + ''' + results_ = [DestroyMachineResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): - raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) - - if read_only_ is not None and not isinstance(read_only_, bool): - raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.mount_point = mount_point_ - self.read_only = read_only_ + self.results = results_ self.unknown_fields = unknown_fields -class FilesystemDetails(Type): - _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'life': 'life', 'machine_attachments': 'machine-attachments', 'status': 'status', 'storage': 'storage', 'unit_attachments': 'unit-attachments', 'volume_tag': 'volume-tag'} - _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'life': 'life', 'machine-attachments': 'machine_attachments', 'status': 'status', 'storage': 'storage', 'unit-attachments': 'unit_attachments', 'volume-tag': 'volume_tag'} - def __init__(self, filesystem_tag=None, info=None, life=None, machine_attachments=None, status=None, storage=None, unit_attachments=None, volume_tag=None, **unknown_fields): +class DestroyMachinesParams(Type): + _toSchema = {'dry_run': 'dry-run', 'force': 'force', 'keep': 'keep', 'machine_tags': 'machine-tags', 'max_wait': 'max-wait'} + _toPy = {'dry-run': 'dry_run', 'force': 'force', 'keep': 'keep', 'machine-tags': 'machine_tags', 'max-wait': 'max_wait'} + def __init__(self, dry_run=None, force=None, keep=None, machine_tags=None, max_wait=None, **unknown_fields): ''' - filesystem_tag : str - info : FilesystemInfo - life : str - machine_attachments : typing.Mapping[str, ~FilesystemAttachmentDetails] - status : EntityStatus - storage : StorageDetails - unit_attachments : typing.Mapping[str, ~FilesystemAttachmentDetails] - volume_tag : str + dry_run : bool + force : bool + keep : bool + machine_tags : typing.Sequence[str] + max_wait : int ''' - filesystem_tag_ = filesystem_tag - info_ = FilesystemInfo.from_json(info) if info else None - life_ = life - machine_attachments_ = {k: FilesystemAttachmentDetails.from_json(v) for k, v in (machine_attachments or dict()).items()} - status_ = EntityStatus.from_json(status) if status else None - storage_ = StorageDetails.from_json(storage) if storage else None - unit_attachments_ = {k: FilesystemAttachmentDetails.from_json(v) for k, v in (unit_attachments or dict()).items()} - volume_tag_ = volume_tag + dry_run_ = dry_run + force_ = force + keep_ = keep + machine_tags_ = machine_tags + max_wait_ = max_wait # Validate arguments against known Juju API types. - if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): - raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) - - if info_ is not None and not isinstance(info_, (dict, FilesystemInfo)): - raise Exception("Expected info_ to be a FilesystemInfo, received: {}".format(type(info_))) - - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - - if machine_attachments_ is not None and not isinstance(machine_attachments_, dict): - raise Exception("Expected machine_attachments_ to be a Mapping, received: {}".format(type(machine_attachments_))) + if 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 status_ is not None and not isinstance(status_, (dict, EntityStatus)): - raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - if storage_ is not None and not isinstance(storage_, (dict, StorageDetails)): - raise Exception("Expected storage_ to be a StorageDetails, received: {}".format(type(storage_))) + if keep_ is not None and not isinstance(keep_, bool): + raise Exception("Expected keep_ to be a bool, received: {}".format(type(keep_))) - if unit_attachments_ is not None and not isinstance(unit_attachments_, dict): - raise Exception("Expected unit_attachments_ to be a Mapping, received: {}".format(type(unit_attachments_))) + if machine_tags_ is not None and not isinstance(machine_tags_, (bytes, str, list)): + raise Exception("Expected machine_tags_ to be a Sequence, received: {}".format(type(machine_tags_))) - if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): - raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) - self.filesystem_tag = filesystem_tag_ - self.info = info_ - self.life = life_ - self.machine_attachments = machine_attachments_ - self.status = status_ - self.storage = storage_ - self.unit_attachments = unit_attachments_ - self.volume_tag = volume_tag_ + self.dry_run = dry_run_ + self.force = force_ + self.keep = keep_ + self.machine_tags = machine_tags_ + self.max_wait = max_wait_ self.unknown_fields = unknown_fields -class FilesystemDetailsListResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class DestroyModelParams(Type): + _toSchema = {'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'model_tag': 'model-tag', 'timeout': 'timeout'} + _toPy = {'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'model-tag': 'model_tag', 'timeout': 'timeout'} + def __init__(self, destroy_storage=None, force=None, max_wait=None, model_tag=None, timeout=None, **unknown_fields): ''' - error : Error - result : typing.Sequence[~FilesystemDetails] + destroy_storage : bool + force : bool + max_wait : int + model_tag : str + timeout : int ''' - error_ = Error.from_json(error) if error else None - result_ = [FilesystemDetails.from_json(o) for o in result or []] + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + model_tag_ = model_tag + timeout_ = timeout # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): + raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) - if result_ is not None and not isinstance(result_, (bytes, str, list)): - raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - self.error = error_ - self.result = result_ + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if timeout_ is not None and not isinstance(timeout_, int): + raise Exception("Expected timeout_ to be a int, received: {}".format(type(timeout_))) + + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.model_tag = model_tag_ + self.timeout = timeout_ self.unknown_fields = unknown_fields -class FilesystemDetailsListResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class DestroyModelsParams(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' - results : typing.Sequence[~FilesystemDetailsListResult] + models : typing.Sequence[~DestroyModelParams] ''' - results_ = [FilesystemDetailsListResult.from_json(o) for o in results or []] + models_ = [DestroyModelParams.from_json(o) for o in models or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) - self.results = results_ + self.models = models_ self.unknown_fields = unknown_fields -class FilesystemFilter(Type): - _toSchema = {'machines': 'machines'} - _toPy = {'machines': 'machines'} - def __init__(self, machines=None, **unknown_fields): +class DestroyRelation(Type): + _toSchema = {'endpoints': 'endpoints', 'force': 'force', 'max_wait': 'max-wait', 'relation_id': 'relation-id'} + _toPy = {'endpoints': 'endpoints', 'force': 'force', 'max-wait': 'max_wait', 'relation-id': 'relation_id'} + def __init__(self, endpoints=None, force=None, max_wait=None, relation_id=None, **unknown_fields): ''' - machines : typing.Sequence[str] + endpoints : typing.Sequence[str] + force : bool + max_wait : int + relation_id : int ''' - machines_ = machines + endpoints_ = endpoints + force_ = force + max_wait_ = max_wait + relation_id_ = relation_id # Validate arguments against known Juju API types. - if machines_ is not None and not isinstance(machines_, (bytes, str, list)): - raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) - self.machines = machines_ + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + + if relation_id_ is not None and not isinstance(relation_id_, int): + raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + + self.endpoints = endpoints_ + self.force = force_ + self.max_wait = max_wait_ + self.relation_id = relation_id_ self.unknown_fields = unknown_fields -class FilesystemFilters(Type): - _toSchema = {'filters': 'filters'} - _toPy = {'filters': 'filters'} - def __init__(self, filters=None, **unknown_fields): +class DestroyUnitInfo(Type): + _toSchema = {'destroyed_storage': 'destroyed-storage', 'detached_storage': 'detached-storage'} + _toPy = {'destroyed-storage': 'destroyed_storage', 'detached-storage': 'detached_storage'} + def __init__(self, destroyed_storage=None, detached_storage=None, **unknown_fields): ''' - filters : typing.Sequence[~FilesystemFilter] + destroyed_storage : typing.Sequence[~Entity] + detached_storage : typing.Sequence[~Entity] ''' - filters_ = [FilesystemFilter.from_json(o) for o in filters or []] + destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] + detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] # Validate arguments against known Juju API types. - if filters_ is not None and not isinstance(filters_, (bytes, str, list)): - raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): + raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) - self.filters = filters_ + if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): + raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + + self.destroyed_storage = destroyed_storage_ + self.detached_storage = detached_storage_ self.unknown_fields = unknown_fields -class FilesystemInfo(Type): - _toSchema = {'filesystem_id': 'filesystem-id', 'pool': 'pool', 'size': 'size'} - _toPy = {'filesystem-id': 'filesystem_id', 'pool': 'pool', 'size': 'size'} - def __init__(self, filesystem_id=None, pool=None, size=None, **unknown_fields): +class DestroyUnitParams(Type): + _toSchema = {'destroy_storage': 'destroy-storage', 'dry_run': 'dry-run', 'force': 'force', 'max_wait': 'max-wait', 'unit_tag': 'unit-tag'} + _toPy = {'destroy-storage': 'destroy_storage', 'dry-run': 'dry_run', 'force': 'force', 'max-wait': 'max_wait', 'unit-tag': 'unit_tag'} + def __init__(self, destroy_storage=None, dry_run=None, force=None, max_wait=None, unit_tag=None, **unknown_fields): ''' - filesystem_id : str - pool : str - size : int + destroy_storage : bool + dry_run : bool + force : bool + max_wait : int + unit_tag : str ''' - filesystem_id_ = filesystem_id - pool_ = pool - size_ = size + destroy_storage_ = destroy_storage + dry_run_ = dry_run + force_ = force + max_wait_ = max_wait + unit_tag_ = unit_tag # Validate arguments against known Juju API types. - if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): - raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) - - if pool_ is not None and not isinstance(pool_, (bytes, str)): - raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): + raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + 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_))) - self.filesystem_id = filesystem_id_ - self.pool = pool_ - self.size = size_ - self.unknown_fields = unknown_fields - - - -class FindToolsParams(Type): - _toSchema = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'number': 'number', 'os_type': 'os-type'} - _toPy = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'number': 'number', 'os-type': 'os_type'} - def __init__(self, agentstream=None, arch=None, major=None, number=None, os_type=None, **unknown_fields): - ''' - agentstream : str - arch : str - major : int - number : Number - os_type : str - ''' - agentstream_ = agentstream - arch_ = arch - major_ = major - number_ = Number.from_json(number) if number else None - os_type_ = os_type - - # Validate arguments against known Juju API types. - if agentstream_ is not None and not isinstance(agentstream_, (bytes, str)): - raise Exception("Expected agentstream_ to be a str, received: {}".format(type(agentstream_))) - - if arch_ is not None and not isinstance(arch_, (bytes, str)): - raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) - - if major_ is not None and not isinstance(major_, int): - raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - if number_ is not None and not isinstance(number_, (dict, Number)): - raise Exception("Expected number_ to be a Number, received: {}".format(type(number_))) + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) - if os_type_ is not None and not isinstance(os_type_, (bytes, str)): - raise Exception("Expected os_type_ to be a str, received: {}".format(type(os_type_))) + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) - self.agentstream = agentstream_ - self.arch = arch_ - self.major = major_ - self.number = number_ - self.os_type = os_type_ + self.destroy_storage = destroy_storage_ + self.dry_run = dry_run_ + self.force = force_ + self.max_wait = max_wait_ + self.unit_tag = unit_tag_ self.unknown_fields = unknown_fields -class FindToolsResult(Type): - _toSchema = {'error': 'error', 'list_': 'list'} - _toPy = {'error': 'error', 'list': 'list_'} - def __init__(self, error=None, list_=None, **unknown_fields): +class DestroyUnitResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error - list_ : typing.Sequence[~Tools] + info : DestroyUnitInfo ''' error_ = Error.from_json(error) if error else None - list__ = [Tools.from_json(o) for o in list_ or []] + info_ = DestroyUnitInfo.from_json(info) if info else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if list__ is not None and not isinstance(list__, (bytes, str, list)): - raise Exception("Expected list__ to be a Sequence, received: {}".format(type(list__))) + if info_ is not None and not isinstance(info_, (dict, DestroyUnitInfo)): + raise Exception("Expected info_ to be a DestroyUnitInfo, received: {}".format(type(info_))) self.error = error_ - self.list_ = list__ + self.info = info_ self.unknown_fields = unknown_fields -class FirewallRule(Type): - _toSchema = {'known_service': 'known-service', 'whitelist_cidrs': 'whitelist-cidrs'} - _toPy = {'known-service': 'known_service', 'whitelist-cidrs': 'whitelist_cidrs'} - def __init__(self, known_service=None, whitelist_cidrs=None, **unknown_fields): +class DestroyUnitResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - known_service : str - whitelist_cidrs : typing.Sequence[str] + results : typing.Sequence[~DestroyUnitResult] ''' - known_service_ = known_service - whitelist_cidrs_ = whitelist_cidrs + results_ = [DestroyUnitResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if known_service_ is not None and not isinstance(known_service_, (bytes, str)): - raise Exception("Expected known_service_ to be a str, received: {}".format(type(known_service_))) - - if whitelist_cidrs_ is not None and not isinstance(whitelist_cidrs_, (bytes, str, list)): - raise Exception("Expected whitelist_cidrs_ to be a Sequence, received: {}".format(type(whitelist_cidrs_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.known_service = known_service_ - self.whitelist_cidrs = whitelist_cidrs_ + self.results = results_ self.unknown_fields = unknown_fields -class FirewallRuleArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class DestroyUnitsParams(Type): + _toSchema = {'units': 'units'} + _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): ''' - args : typing.Sequence[~FirewallRule] + units : typing.Sequence[~DestroyUnitParams] ''' - args_ = [FirewallRule.from_json(o) for o in args or []] + units_ = [DestroyUnitParams.from_json(o) for o in units or []] # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) - self.args = args_ + self.units = units_ self.unknown_fields = unknown_fields -class FullStatus(Type): - _toSchema = {'applications': 'applications', 'branches': 'branches', 'controller_timestamp': 'controller-timestamp', 'filesystems': 'filesystems', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote_applications': 'remote-applications', 'storage': 'storage', 'volumes': 'volumes'} - _toPy = {'applications': 'applications', 'branches': 'branches', 'controller-timestamp': 'controller_timestamp', 'filesystems': 'filesystems', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote-applications': 'remote_applications', 'storage': 'storage', 'volumes': 'volumes'} - def __init__(self, applications=None, branches=None, controller_timestamp=None, filesystems=None, machines=None, model=None, offers=None, relations=None, remote_applications=None, storage=None, volumes=None, **unknown_fields): +class DetailedStatus(Type): + _toSchema = {'data': 'data', 'err': 'err', 'info': 'info', 'kind': 'kind', 'life': 'life', 'since': 'since', 'status': 'status', 'version': 'version'} + _toPy = {'data': 'data', 'err': 'err', 'info': 'info', 'kind': 'kind', 'life': 'life', 'since': 'since', 'status': 'status', 'version': 'version'} + def __init__(self, data=None, err=None, info=None, kind=None, life=None, since=None, status=None, version=None, **unknown_fields): ''' - applications : typing.Mapping[str, ~ApplicationStatus] - branches : typing.Mapping[str, ~BranchStatus] - controller_timestamp : str - filesystems : typing.Sequence[~FilesystemDetails] - machines : typing.Mapping[str, ~MachineStatus] - model : ModelStatusInfo - offers : typing.Mapping[str, ~ApplicationOfferStatus] - relations : typing.Sequence[~RelationStatus] - remote_applications : typing.Mapping[str, ~RemoteApplicationStatus] - storage : typing.Sequence[~StorageDetails] - volumes : typing.Sequence[~VolumeDetails] + data : typing.Mapping[str, typing.Any] + err : Error + info : str + kind : str + life : str + since : str + status : str + version : str ''' - applications_ = {k: ApplicationStatus.from_json(v) for k, v in (applications or dict()).items()} - branches_ = {k: BranchStatus.from_json(v) for k, v in (branches or dict()).items()} - controller_timestamp_ = controller_timestamp - filesystems_ = [FilesystemDetails.from_json(o) for o in filesystems or []] - machines_ = {k: MachineStatus.from_json(v) for k, v in (machines or dict()).items()} - model_ = ModelStatusInfo.from_json(model) if model else None - offers_ = {k: ApplicationOfferStatus.from_json(v) for k, v in (offers or dict()).items()} - relations_ = [RelationStatus.from_json(o) for o in relations or []] - remote_applications_ = {k: RemoteApplicationStatus.from_json(v) for k, v in (remote_applications or dict()).items()} - storage_ = [StorageDetails.from_json(o) for o in storage or []] - volumes_ = [VolumeDetails.from_json(o) for o in volumes or []] + data_ = data + err_ = Error.from_json(err) if err else None + info_ = info + kind_ = kind + life_ = life + since_ = since + status_ = status + version_ = version # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, dict): - raise Exception("Expected applications_ to be a Mapping, received: {}".format(type(applications_))) - - if branches_ is not None and not isinstance(branches_, dict): - raise Exception("Expected branches_ to be a Mapping, received: {}".format(type(branches_))) - - if controller_timestamp_ is not None and not isinstance(controller_timestamp_, (bytes, str)): - raise Exception("Expected controller_timestamp_ to be a str, received: {}".format(type(controller_timestamp_))) - - if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): - raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - if machines_ is not None and not isinstance(machines_, dict): - raise Exception("Expected machines_ to be a Mapping, received: {}".format(type(machines_))) + if err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) - if model_ is not None and not isinstance(model_, (dict, ModelStatusInfo)): - raise Exception("Expected model_ to be a ModelStatusInfo, received: {}".format(type(model_))) + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) - if offers_ is not None and not isinstance(offers_, dict): - raise Exception("Expected offers_ to be a Mapping, received: {}".format(type(offers_))) + if kind_ is not None and not isinstance(kind_, (bytes, str)): + raise Exception("Expected kind_ to be a str, received: {}".format(type(kind_))) - if relations_ is not None and not isinstance(relations_, (bytes, str, list)): - raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if remote_applications_ is not None and not isinstance(remote_applications_, dict): - raise Exception("Expected remote_applications_ to be a Mapping, received: {}".format(type(remote_applications_))) + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) - if storage_ is not None and not isinstance(storage_, (bytes, str, list)): - raise Exception("Expected storage_ to be a Sequence, received: {}".format(type(storage_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): - raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) - self.applications = applications_ - self.branches = branches_ - self.controller_timestamp = controller_timestamp_ - self.filesystems = filesystems_ - self.machines = machines_ - self.model = model_ - self.offers = offers_ - self.relations = relations_ - self.remote_applications = remote_applications_ - self.storage = storage_ - self.volumes = volumes_ + self.data = data_ + self.err = err_ + self.info = info_ + self.kind = kind_ + self.life = life_ + self.since = since_ + self.status = status_ + self.version = version_ self.unknown_fields = unknown_fields -class Generation(Type): - _toSchema = {'applications': 'applications', 'branch': 'branch', 'completed': 'completed', 'completed_by': 'completed-by', 'created': 'created', 'created_by': 'created-by', 'generation_id': 'generation-id'} - _toPy = {'applications': 'applications', 'branch': 'branch', 'completed': 'completed', 'completed-by': 'completed_by', 'created': 'created', 'created-by': 'created_by', 'generation-id': 'generation_id'} - def __init__(self, applications=None, branch=None, completed=None, completed_by=None, created=None, created_by=None, generation_id=None, **unknown_fields): +class DeviceBridgeInfo(Type): + _toSchema = {'bridge_name': 'bridge-name', 'host_device_name': 'host-device-name', 'mac_address': 'mac-address'} + _toPy = {'bridge-name': 'bridge_name', 'host-device-name': 'host_device_name', 'mac-address': 'mac_address'} + def __init__(self, bridge_name=None, host_device_name=None, mac_address=None, **unknown_fields): ''' - applications : typing.Sequence[~GenerationApplication] - branch : str - completed : int - completed_by : str - created : int - created_by : str - generation_id : int + bridge_name : str + host_device_name : str + mac_address : str ''' - applications_ = [GenerationApplication.from_json(o) for o in applications or []] - branch_ = branch - completed_ = completed - completed_by_ = completed_by - created_ = created - created_by_ = created_by - generation_id_ = generation_id + bridge_name_ = bridge_name + host_device_name_ = host_device_name + mac_address_ = mac_address # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if bridge_name_ is not None and not isinstance(bridge_name_, (bytes, str)): + raise Exception("Expected bridge_name_ to be a str, received: {}".format(type(bridge_name_))) - if branch_ is not None and not isinstance(branch_, (bytes, str)): - raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) + if host_device_name_ is not None and not isinstance(host_device_name_, (bytes, str)): + raise Exception("Expected host_device_name_ to be a str, received: {}".format(type(host_device_name_))) - if completed_ is not None and not isinstance(completed_, int): - raise Exception("Expected completed_ to be a int, received: {}".format(type(completed_))) + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) - if completed_by_ is not None and not isinstance(completed_by_, (bytes, str)): - raise Exception("Expected completed_by_ to be a str, received: {}".format(type(completed_by_))) + self.bridge_name = bridge_name_ + self.host_device_name = host_device_name_ + self.mac_address = mac_address_ + self.unknown_fields = unknown_fields - if created_ is not None and not isinstance(created_, int): - raise Exception("Expected created_ to be a int, received: {}".format(type(created_))) - if created_by_ is not None and not isinstance(created_by_, (bytes, str)): - raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) - if generation_id_ is not None and not isinstance(generation_id_, int): - raise Exception("Expected generation_id_ to be a int, received: {}".format(type(generation_id_))) - - self.applications = applications_ - self.branch = branch_ - self.completed = completed_ - self.completed_by = completed_by_ - self.created = created_ - self.created_by = created_by_ - self.generation_id = generation_id_ - self.unknown_fields = unknown_fields - - - -class GenerationApplication(Type): - _toSchema = {'application': 'application', 'config': 'config', 'pending': 'pending', 'progress': 'progress', 'tracking': 'tracking'} - _toPy = {'application': 'application', 'config': 'config', 'pending': 'pending', 'progress': 'progress', 'tracking': 'tracking'} - def __init__(self, application=None, config=None, pending=None, progress=None, tracking=None, **unknown_fields): +class DistributionGroupResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - application : str - config : typing.Mapping[str, typing.Any] - pending : typing.Sequence[str] - progress : str - tracking : typing.Sequence[str] + error : Error + result : typing.Sequence[str] ''' - application_ = application - config_ = config - pending_ = pending - progress_ = progress - tracking_ = tracking + error_ = Error.from_json(error) if error else None + result_ = result # Validate arguments against known Juju API types. - if application_ is not None and not isinstance(application_, (bytes, str)): - raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) - - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if pending_ is not None and not isinstance(pending_, (bytes, str, list)): - raise Exception("Expected pending_ to be a Sequence, received: {}".format(type(pending_))) - - if progress_ is not None and not isinstance(progress_, (bytes, str)): - raise Exception("Expected progress_ to be a str, received: {}".format(type(progress_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if tracking_ is not None and not isinstance(tracking_, (bytes, str, list)): - raise Exception("Expected tracking_ to be a Sequence, received: {}".format(type(tracking_))) + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) - self.application = application_ - self.config = config_ - self.pending = pending_ - self.progress = progress_ - self.tracking = tracking_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class GenerationId(Type): - _toSchema = {'generation_id': 'generation-id'} - _toPy = {'generation-id': 'generation_id'} - def __init__(self, generation_id=None, **unknown_fields): +class DistributionGroupResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - generation_id : int + results : typing.Sequence[~DistributionGroupResult] ''' - generation_id_ = generation_id + results_ = [DistributionGroupResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if generation_id_ is not None and not isinstance(generation_id_, int): - raise Exception("Expected generation_id_ to be a int, received: {}".format(type(generation_id_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.generation_id = generation_id_ + self.results = results_ self.unknown_fields = unknown_fields -class GenerationResult(Type): - _toSchema = {'error': 'error', 'generation': 'generation'} - _toPy = {'error': 'error', 'generation': 'generation'} - def __init__(self, error=None, generation=None, **unknown_fields): +class DockerImageInfo(Type): + _toSchema = {'auth': 'auth', 'email': 'email', 'identitytoken': 'identitytoken', 'image_name': 'image-name', 'password': 'password', 'registrytoken': 'registrytoken', 'repository': 'repository', 'serveraddress': 'serveraddress', 'username': 'username'} + _toPy = {'auth': 'auth', 'email': 'email', 'identitytoken': 'identitytoken', 'image-name': 'image_name', 'password': 'password', 'registrytoken': 'registrytoken', 'repository': 'repository', 'serveraddress': 'serveraddress', 'username': 'username'} + def __init__(self, auth=None, email=None, identitytoken=None, image_name=None, password=None, registrytoken=None, repository=None, serveraddress=None, username=None, **unknown_fields): ''' - error : Error - generation : Generation + auth : str + email : str + identitytoken : str + image_name : str + password : str + registrytoken : str + repository : str + serveraddress : str + username : str ''' - error_ = Error.from_json(error) if error else None - generation_ = Generation.from_json(generation) if generation else None + auth_ = auth + email_ = email + identitytoken_ = identitytoken + image_name_ = image_name + password_ = password + registrytoken_ = registrytoken + repository_ = repository + serveraddress_ = serveraddress + username_ = username # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if auth_ is not None and not isinstance(auth_, (bytes, str)): + raise Exception("Expected auth_ to be a str, received: {}".format(type(auth_))) - if generation_ is not None and not isinstance(generation_, (dict, Generation)): - raise Exception("Expected generation_ to be a Generation, received: {}".format(type(generation_))) + if email_ is not None and not isinstance(email_, (bytes, str)): + raise Exception("Expected email_ to be a str, received: {}".format(type(email_))) - self.error = error_ - self.generation = generation_ - self.unknown_fields = unknown_fields + if identitytoken_ is not None and not isinstance(identitytoken_, (bytes, str)): + raise Exception("Expected identitytoken_ to be a str, received: {}".format(type(identitytoken_))) + if image_name_ is not None and not isinstance(image_name_, (bytes, str)): + raise Exception("Expected image_name_ to be a str, received: {}".format(type(image_name_))) + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) -class GetConstraintsResults(Type): - _toSchema = {'constraints': 'constraints'} - _toPy = {'constraints': 'constraints'} - def __init__(self, constraints=None, **unknown_fields): - ''' - constraints : Value - ''' - constraints_ = Value.from_json(constraints) if constraints else None + if registrytoken_ is not None and not isinstance(registrytoken_, (bytes, str)): + raise Exception("Expected registrytoken_ to be a str, received: {}".format(type(registrytoken_))) - # Validate arguments against known Juju API types. - if constraints_ is not None and not isinstance(constraints_, (dict, Value)): - raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + if repository_ is not None and not isinstance(repository_, (bytes, str)): + raise Exception("Expected repository_ to be a str, received: {}".format(type(repository_))) - self.constraints = constraints_ + if serveraddress_ is not None and not isinstance(serveraddress_, (bytes, str)): + raise Exception("Expected serveraddress_ to be a str, received: {}".format(type(serveraddress_))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.auth = auth_ + self.email = email_ + self.identitytoken = identitytoken_ + self.image_name = image_name_ + self.password = password_ + self.registrytoken = registrytoken_ + self.repository = repository_ + self.serveraddress = serveraddress_ + self.username = username_ self.unknown_fields = unknown_fields -class GrantRevokeUserSecretArg(Type): - _toSchema = {'applications': 'applications', 'label': 'label', 'uri': 'uri'} - _toPy = {'applications': 'applications', 'label': 'label', 'uri': 'uri'} - def __init__(self, applications=None, label=None, uri=None, **unknown_fields): +class DownloadInfoResult(Type): + _toSchema = {'charm_origin': 'charm-origin', 'url': 'url'} + _toPy = {'charm-origin': 'charm_origin', 'url': 'url'} + def __init__(self, charm_origin=None, url=None, **unknown_fields): ''' - applications : typing.Sequence[str] - label : str - uri : str + charm_origin : CharmOrigin + url : str ''' - applications_ = applications - label_ = label - uri_ = uri + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + url_ = url # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): + raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) - if uri_ is not None and not isinstance(uri_, (bytes, str)): - raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) - self.applications = applications_ - self.label = label_ - self.uri = uri_ + self.charm_origin = charm_origin_ + self.url = url_ self.unknown_fields = unknown_fields -class HardwareCharacteristics(Type): - _toSchema = {'arch': 'arch', 'availability_zone': 'availability-zone', 'cpu_cores': 'cpu-cores', 'cpu_power': 'cpu-power', 'mem': 'mem', 'root_disk': 'root-disk', 'root_disk_source': 'root-disk-source', 'tags': 'tags', 'virt_type': 'virt-type'} - _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cpu-cores': 'cpu_cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'root-disk-source': 'root_disk_source', 'tags': 'tags', 'virt-type': 'virt_type'} - def __init__(self, arch=None, availability_zone=None, cpu_cores=None, cpu_power=None, mem=None, root_disk=None, root_disk_source=None, tags=None, virt_type=None, **unknown_fields): +class DownloadInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - arch : str - availability_zone : str - cpu_cores : int - cpu_power : int - mem : int - root_disk : int - root_disk_source : str - tags : typing.Sequence[str] - virt_type : str + results : typing.Sequence[~DownloadInfoResult] ''' - arch_ = arch - availability_zone_ = availability_zone - cpu_cores_ = cpu_cores - cpu_power_ = cpu_power - mem_ = mem - root_disk_ = root_disk - root_disk_source_ = root_disk_source - tags_ = tags - virt_type_ = virt_type + results_ = [DownloadInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if arch_ is not None and not isinstance(arch_, (bytes, str)): - raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) - - if availability_zone_ is not None and not isinstance(availability_zone_, (bytes, str)): - raise Exception("Expected availability_zone_ to be a str, received: {}".format(type(availability_zone_))) - - if cpu_cores_ is not None and not isinstance(cpu_cores_, int): - raise Exception("Expected cpu_cores_ to be a int, received: {}".format(type(cpu_cores_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if cpu_power_ is not None and not isinstance(cpu_power_, int): - raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) + self.results = results_ + self.unknown_fields = unknown_fields - if mem_ is not None and not isinstance(mem_, int): - raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) - if root_disk_ is not None and not isinstance(root_disk_, int): - raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) - if root_disk_source_ is not None and not isinstance(root_disk_source_, (bytes, str)): - raise Exception("Expected root_disk_source_ to be a str, received: {}".format(type(root_disk_source_))) +class DumpModelRequest(Type): + _toSchema = {'entities': 'entities', 'simplified': 'simplified'} + _toPy = {'entities': 'entities', 'simplified': 'simplified'} + def __init__(self, entities=None, simplified=None, **unknown_fields): + ''' + entities : typing.Sequence[~Entity] + simplified : bool + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + simplified_ = simplified - if tags_ is not None and not isinstance(tags_, (bytes, str, list)): - raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): - raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + if simplified_ is not None and not isinstance(simplified_, bool): + raise Exception("Expected simplified_ to be a bool, received: {}".format(type(simplified_))) - self.arch = arch_ - self.availability_zone = availability_zone_ - self.cpu_cores = cpu_cores_ - self.cpu_power = cpu_power_ - self.mem = mem_ - self.root_disk = root_disk_ - self.root_disk_source = root_disk_source_ - self.tags = tags_ - self.virt_type = virt_type_ + self.entities = entities_ + self.simplified = simplified_ self.unknown_fields = unknown_fields -class History(Type): - _toSchema = {'error': 'error', 'statuses': 'statuses'} - _toPy = {'error': 'error', 'statuses': 'statuses'} - def __init__(self, error=None, statuses=None, **unknown_fields): +class Endpoint(Type): + _toSchema = {'application_name': 'application-name', 'relation': 'relation'} + _toPy = {'application-name': 'application_name', 'relation': 'relation'} + def __init__(self, application_name=None, relation=None, **unknown_fields): ''' - error : Error - statuses : typing.Sequence[~DetailedStatus] + application_name : str + relation : CharmRelation ''' - error_ = Error.from_json(error) if error else None - statuses_ = [DetailedStatus.from_json(o) for o in statuses or []] + application_name_ = application_name + relation_ = CharmRelation.from_json(relation) if relation else None # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if application_name_ is not None and not isinstance(application_name_, (bytes, str)): + raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) - if statuses_ is not None and not isinstance(statuses_, (bytes, str, list)): - raise Exception("Expected statuses_ to be a Sequence, received: {}".format(type(statuses_))) + if relation_ is not None and not isinstance(relation_, (dict, CharmRelation)): + raise Exception("Expected relation_ to be a CharmRelation, received: {}".format(type(relation_))) - self.error = error_ - self.statuses = statuses_ + self.application_name = application_name_ + self.relation = relation_ self.unknown_fields = unknown_fields -class HostPort(Type): - _toSchema = {'address': 'Address', 'cidr': 'cidr', 'config_type': 'config-type', 'is_secondary': 'is-secondary', 'port': 'port', 'scope': 'scope', 'space_id': 'space-id', 'space_name': 'space-name', 'type_': 'type', 'value': 'value'} - _toPy = {'Address': 'address', 'cidr': 'cidr', 'config-type': 'config_type', 'is-secondary': 'is_secondary', 'port': 'port', 'scope': 'scope', 'space-id': 'space_id', 'space-name': 'space_name', 'type': 'type_', 'value': 'value'} - def __init__(self, address=None, cidr=None, config_type=None, is_secondary=None, port=None, scope=None, space_id=None, space_name=None, type_=None, value=None, **unknown_fields): +class EndpointFilterAttributes(Type): + _toSchema = {'interface': 'interface', 'name': 'name', 'role': 'role'} + _toPy = {'interface': 'interface', 'name': 'name', 'role': 'role'} + def __init__(self, interface=None, name=None, role=None, **unknown_fields): ''' - address : Address - cidr : str - config_type : str - is_secondary : bool - port : int - scope : str - space_id : str - space_name : str - type_ : str - value : str + interface : str + name : str + role : str ''' - address_ = Address.from_json(address) if address else None - cidr_ = cidr - config_type_ = config_type - is_secondary_ = is_secondary - port_ = port - scope_ = scope - space_id_ = space_id - space_name_ = space_name - type__ = type_ - value_ = value + interface_ = interface + name_ = name + role_ = role # Validate arguments against known Juju API types. - if address_ is not None and not isinstance(address_, (dict, Address)): - raise Exception("Expected address_ to be a Address, received: {}".format(type(address_))) + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) - if cidr_ is not None and not isinstance(cidr_, (bytes, str)): - raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if config_type_ is not None and not isinstance(config_type_, (bytes, str)): - raise Exception("Expected config_type_ to be a str, received: {}".format(type(config_type_))) + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) - if is_secondary_ is not None and not isinstance(is_secondary_, bool): - raise Exception("Expected is_secondary_ to be a bool, received: {}".format(type(is_secondary_))) + self.interface = interface_ + self.name = name_ + self.role = role_ + self.unknown_fields = unknown_fields - if port_ is not None and not isinstance(port_, int): - raise Exception("Expected port_ to be a int, received: {}".format(type(port_))) - if scope_ is not None and not isinstance(scope_, (bytes, str)): - raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) - if space_id_ is not None and not isinstance(space_id_, (bytes, str)): - raise Exception("Expected space_id_ to be a str, received: {}".format(type(space_id_))) +class EndpointRelationData(Type): + _toSchema = {'applicationdata': 'ApplicationData', 'cross_model': 'cross-model', 'endpoint': 'endpoint', 'related_endpoint': 'related-endpoint', 'relation_id': 'relation-id', 'unit_relation_data': 'unit-relation-data'} + _toPy = {'ApplicationData': 'applicationdata', 'cross-model': 'cross_model', 'endpoint': 'endpoint', 'related-endpoint': 'related_endpoint', 'relation-id': 'relation_id', 'unit-relation-data': 'unit_relation_data'} + def __init__(self, applicationdata=None, cross_model=None, endpoint=None, related_endpoint=None, relation_id=None, unit_relation_data=None, **unknown_fields): + ''' + applicationdata : typing.Mapping[str, typing.Any] + cross_model : bool + endpoint : str + related_endpoint : str + relation_id : int + unit_relation_data : typing.Mapping[str, ~RelationData] + ''' + applicationdata_ = applicationdata + cross_model_ = cross_model + endpoint_ = endpoint + related_endpoint_ = related_endpoint + relation_id_ = relation_id + unit_relation_data_ = {k: RelationData.from_json(v) for k, v in (unit_relation_data or dict()).items()} - if space_name_ is not None and not isinstance(space_name_, (bytes, str)): - raise Exception("Expected space_name_ to be a str, received: {}".format(type(space_name_))) + # Validate arguments against known Juju API types. + if applicationdata_ is not None and not isinstance(applicationdata_, dict): + raise Exception("Expected applicationdata_ to be a Mapping, received: {}".format(type(applicationdata_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if cross_model_ is not None and not isinstance(cross_model_, bool): + raise Exception("Expected cross_model_ to be a bool, received: {}".format(type(cross_model_))) - if value_ is not None and not isinstance(value_, (bytes, str)): - raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) - self.address = address_ - self.cidr = cidr_ - self.config_type = config_type_ - self.is_secondary = is_secondary_ - self.port = port_ - self.scope = scope_ - self.space_id = space_id_ - self.space_name = space_name_ - self.type_ = type__ - self.value = value_ + if related_endpoint_ is not None and not isinstance(related_endpoint_, (bytes, str)): + raise Exception("Expected related_endpoint_ to be a str, received: {}".format(type(related_endpoint_))) + + if relation_id_ is not None and not isinstance(relation_id_, int): + raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + + if unit_relation_data_ is not None and not isinstance(unit_relation_data_, dict): + raise Exception("Expected unit_relation_data_ to be a Mapping, received: {}".format(type(unit_relation_data_))) + + self.applicationdata = applicationdata_ + self.cross_model = cross_model_ + self.endpoint = endpoint_ + self.related_endpoint = related_endpoint_ + self.relation_id = relation_id_ + self.unit_relation_data = unit_relation_data_ self.unknown_fields = unknown_fields -class HostedModelConfig(Type): - _toSchema = {'cloud_spec': 'cloud-spec', 'config': 'config', 'error': 'error', 'name': 'name', 'owner': 'owner'} - _toPy = {'cloud-spec': 'cloud_spec', 'config': 'config', 'error': 'error', 'name': 'name', 'owner': 'owner'} - def __init__(self, cloud_spec=None, config=None, error=None, name=None, owner=None, **unknown_fields): +class EndpointStatus(Type): + _toSchema = {'application': 'application', 'name': 'name', 'role': 'role', 'subordinate': 'subordinate'} + _toPy = {'application': 'application', 'name': 'name', 'role': 'role', 'subordinate': 'subordinate'} + def __init__(self, application=None, name=None, role=None, subordinate=None, **unknown_fields): ''' - cloud_spec : CloudSpec - config : typing.Mapping[str, typing.Any] - error : Error + application : str name : str - owner : str + role : str + subordinate : bool ''' - cloud_spec_ = CloudSpec.from_json(cloud_spec) if cloud_spec else None - config_ = config - error_ = Error.from_json(error) if error else None + application_ = application name_ = name - owner_ = owner + role_ = role + subordinate_ = subordinate # Validate arguments against known Juju API types. - if cloud_spec_ is not None and not isinstance(cloud_spec_, (dict, CloudSpec)): - raise Exception("Expected cloud_spec_ to be a CloudSpec, received: {}".format(type(cloud_spec_))) - - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if owner_ is not None and not isinstance(owner_, (bytes, str)): - raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) - self.cloud_spec = cloud_spec_ - self.config = config_ - self.error = error_ + if subordinate_ is not None and not isinstance(subordinate_, bool): + raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + + self.application = application_ self.name = name_ - self.owner = owner_ + self.role = role_ + self.subordinate = subordinate_ self.unknown_fields = unknown_fields -class HostedModelConfigsResults(Type): - _toSchema = {'models': 'models'} - _toPy = {'models': 'models'} - def __init__(self, models=None, **unknown_fields): +class EnqueuedActions(Type): + _toSchema = {'actions': 'actions', 'operation': 'operation'} + _toPy = {'actions': 'actions', 'operation': 'operation'} + def __init__(self, actions=None, operation=None, **unknown_fields): ''' - models : typing.Sequence[~HostedModelConfig] + actions : typing.Sequence[~ActionResult] + operation : str ''' - models_ = [HostedModelConfig.from_json(o) for o in models or []] + actions_ = [ActionResult.from_json(o) for o in actions or []] + operation_ = operation # Validate arguments against known Juju API types. - if models_ is not None and not isinstance(models_, (bytes, str, list)): - raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) - self.models = models_ + if operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + self.actions = actions_ + self.operation = operation_ self.unknown_fields = unknown_fields -class ImageMetadataFilter(Type): - _toSchema = {'arches': 'arches', 'region': 'region', 'root_storage_type': 'root-storage-type', 'stream': 'stream', 'versions': 'versions', 'virt_type': 'virt-type'} - _toPy = {'arches': 'arches', 'region': 'region', 'root-storage-type': 'root_storage_type', 'stream': 'stream', 'versions': 'versions', 'virt-type': 'virt_type'} - def __init__(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None, **unknown_fields): +class Entities(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' - arches : typing.Sequence[str] - region : str - root_storage_type : str - stream : str - versions : typing.Sequence[str] - virt_type : str + entities : typing.Sequence[~Entity] ''' - arches_ = arches - region_ = region - root_storage_type_ = root_storage_type - stream_ = stream - versions_ = versions - virt_type_ = virt_type + entities_ = [Entity.from_json(o) for o in entities or []] # Validate arguments against known Juju API types. - if arches_ is not None and not isinstance(arches_, (bytes, str, list)): - raise Exception("Expected arches_ to be a Sequence, received: {}".format(type(arches_))) + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - if region_ is not None and not isinstance(region_, (bytes, str)): - raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + self.entities = entities_ + self.unknown_fields = unknown_fields - 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_))) +class EntitiesCharmURL(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~EntityCharmURL] + ''' + entities_ = [EntityCharmURL.from_json(o) for o in entities or []] - 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_))) + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - self.arches = arches_ - self.region = region_ - self.root_storage_type = root_storage_type_ - self.stream = stream_ - self.versions = versions_ - self.virt_type = virt_type_ + self.entities = entities_ self.unknown_fields = unknown_fields -class ImportStorageDetails(Type): - _toSchema = {'storage_tag': 'storage-tag'} - _toPy = {'storage-tag': 'storage_tag'} - def __init__(self, storage_tag=None, **unknown_fields): +class EntitiesResult(Type): + _toSchema = {'entities': 'entities', 'error': 'error'} + _toPy = {'entities': 'entities', 'error': 'error'} + def __init__(self, entities=None, error=None, **unknown_fields): ''' - storage_tag : str + entities : typing.Sequence[~Entity] + error : Error ''' - storage_tag_ = storage_tag + entities_ = [Entity.from_json(o) for o in entities or []] + error_ = Error.from_json(error) if error else None # Validate arguments against known Juju API types. - if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): - raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - self.storage_tag = storage_tag_ + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.entities = entities_ + self.error = error_ self.unknown_fields = unknown_fields -class ImportStorageParams(Type): - _toSchema = {'kind': 'kind', 'pool': 'pool', 'provider_id': 'provider-id', 'storage_name': 'storage-name'} - _toPy = {'kind': 'kind', 'pool': 'pool', 'provider-id': 'provider_id', 'storage-name': 'storage_name'} - def __init__(self, kind=None, pool=None, provider_id=None, storage_name=None, **unknown_fields): +class EntitiesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - kind : int - pool : str - provider_id : str - storage_name : str + results : typing.Sequence[~EntitiesResult] ''' - kind_ = kind - pool_ = pool - provider_id_ = provider_id - storage_name_ = storage_name + results_ = [EntitiesResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if kind_ is not None and not isinstance(kind_, int): - raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if pool_ is not None and not isinstance(pool_, (bytes, str)): - raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + self.results = results_ + self.unknown_fields = unknown_fields - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - if storage_name_ is not None and not isinstance(storage_name_, (bytes, str)): - raise Exception("Expected storage_name_ to be a str, received: {}".format(type(storage_name_))) - self.kind = kind_ - self.pool = pool_ - self.provider_id = provider_id_ - self.storage_name = storage_name_ +class EntitiesVersion(Type): + _toSchema = {'agent_tools': 'agent-tools'} + _toPy = {'agent-tools': 'agent_tools'} + def __init__(self, agent_tools=None, **unknown_fields): + ''' + agent_tools : typing.Sequence[~EntityVersion] + ''' + agent_tools_ = [EntityVersion.from_json(o) for o in agent_tools or []] + + # Validate arguments against known Juju API types. + if agent_tools_ is not None and not isinstance(agent_tools_, (bytes, str, list)): + raise Exception("Expected agent_tools_ to be a Sequence, received: {}".format(type(agent_tools_))) + + self.agent_tools = agent_tools_ self.unknown_fields = unknown_fields -class ImportStorageResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class EntitiesWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' + changes : typing.Sequence[str] error : Error - result : ImportStorageDetails + watcher_id : str ''' + changes_ = changes error_ = Error.from_json(error) if error else None - result_ = ImportStorageDetails.from_json(result) if result else None + watcher_id_ = watcher_id # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, ImportStorageDetails)): - raise Exception("Expected result_ to be a ImportStorageDetails, received: {}".format(type(result_))) + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + self.changes = changes_ self.error = error_ - self.result = result_ + self.watcher_id = watcher_id_ self.unknown_fields = unknown_fields -class ImportStorageResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class Entity(Type): + _toSchema = {'tag': 'tag'} + _toPy = {'tag': 'tag'} + def __init__(self, tag=None, **unknown_fields): ''' - results : typing.Sequence[~ImportStorageResult] + tag : str ''' - results_ = [ImportStorageResult.from_json(o) for o in results or []] + tag_ = tag # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - self.results = results_ + self.tag = tag_ self.unknown_fields = unknown_fields -class InitiateMigrationArgs(Type): - _toSchema = {'specs': 'specs'} - _toPy = {'specs': 'specs'} - def __init__(self, specs=None, **unknown_fields): +class EntityAnnotations(Type): + _toSchema = {'annotations': 'annotations', 'entity': 'entity'} + _toPy = {'annotations': 'annotations', 'entity': 'entity'} + def __init__(self, annotations=None, entity=None, **unknown_fields): ''' - specs : typing.Sequence[~MigrationSpec] + annotations : typing.Mapping[str, str] + entity : str ''' - specs_ = [MigrationSpec.from_json(o) for o in specs or []] + annotations_ = annotations + entity_ = entity # Validate arguments against known Juju API types. - if specs_ is not None and not isinstance(specs_, (bytes, str, list)): - raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + if annotations_ is not None and not isinstance(annotations_, dict): + raise Exception("Expected annotations_ to be a Mapping, received: {}".format(type(annotations_))) - self.specs = specs_ + if entity_ is not None and not isinstance(entity_, (bytes, str)): + raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + + self.annotations = annotations_ + self.entity = entity_ self.unknown_fields = unknown_fields -class InitiateMigrationResult(Type): - _toSchema = {'error': 'error', 'migration_id': 'migration-id', 'model_tag': 'model-tag'} - _toPy = {'error': 'error', 'migration-id': 'migration_id', 'model-tag': 'model_tag'} - def __init__(self, error=None, migration_id=None, model_tag=None, **unknown_fields): +class EntityCharmURL(Type): + _toSchema = {'charm_url': 'charm-url', 'tag': 'tag'} + _toPy = {'charm-url': 'charm_url', 'tag': 'tag'} + def __init__(self, charm_url=None, tag=None, **unknown_fields): ''' - error : Error - migration_id : str - model_tag : str + charm_url : str + tag : str ''' - error_ = Error.from_json(error) if error else None - migration_id_ = migration_id - model_tag_ = model_tag + charm_url_ = charm_url + tag_ = tag # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if 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 charm_url_ is not None and not isinstance(charm_url_, (bytes, str)): + raise Exception("Expected charm_url_ to be a str, received: {}".format(type(charm_url_))) - if 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 tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - self.error = error_ - self.migration_id = migration_id_ - self.model_tag = model_tag_ + self.charm_url = charm_url_ + self.tag = tag_ self.unknown_fields = unknown_fields -class InitiateMigrationResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class EntityMacaroonArg(Type): + _toSchema = {'macaroon': 'macaroon', 'tag': 'tag'} + _toPy = {'macaroon': 'macaroon', 'tag': 'tag'} + def __init__(self, macaroon=None, tag=None, **unknown_fields): ''' - results : typing.Sequence[~InitiateMigrationResult] + macaroon : Macaroon + tag : str ''' - results_ = [InitiateMigrationResult.from_json(o) for o in results or []] + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + tag_ = tag # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) - self.results = results_ + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.macaroon = macaroon_ + self.tag = tag_ self.unknown_fields = unknown_fields -class InstanceType(Type): - _toSchema = {'arches': 'arches', 'cost': 'cost', 'cpu_cores': 'cpu-cores', 'memory': 'memory', 'name': 'name', 'root_disk': 'root-disk', 'virt_type': 'virt-type'} - _toPy = {'arches': 'arches', 'cost': 'cost', 'cpu-cores': 'cpu_cores', 'memory': 'memory', 'name': 'name', 'root-disk': 'root_disk', 'virt-type': 'virt_type'} - def __init__(self, arches=None, cost=None, cpu_cores=None, memory=None, name=None, root_disk=None, virt_type=None, **unknown_fields): +class EntityMacaroonArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - arches : typing.Sequence[str] - cost : int - cpu_cores : int - memory : int - name : str - root_disk : int - virt_type : str + args : typing.Sequence[~EntityMacaroonArg] ''' - arches_ = arches - cost_ = cost - cpu_cores_ = cpu_cores - memory_ = memory - name_ = name - root_disk_ = root_disk - virt_type_ = virt_type + args_ = [EntityMacaroonArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if arches_ is not None and not isinstance(arches_, (bytes, str, list)): - raise Exception("Expected arches_ to be a Sequence, received: {}".format(type(arches_))) - - if cost_ is not None and not isinstance(cost_, int): - raise Exception("Expected cost_ to be a int, received: {}".format(type(cost_))) - - if cpu_cores_ is not None and not isinstance(cpu_cores_, int): - raise Exception("Expected cpu_cores_ to be a int, received: {}".format(type(cpu_cores_))) - - if memory_ is not None and not isinstance(memory_, int): - raise Exception("Expected memory_ to be a int, received: {}".format(type(memory_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if root_disk_ is not None and not isinstance(root_disk_, int): - raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) - - if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): - raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.arches = arches_ - self.cost = cost_ - self.cpu_cores = cpu_cores_ - self.memory = memory_ - self.name = name_ - self.root_disk = root_disk_ - self.virt_type = virt_type_ + self.args = args_ self.unknown_fields = unknown_fields -class InstanceTypesResult(Type): - _toSchema = {'cost_currency': 'cost-currency', 'cost_divisor': 'cost-divisor', 'cost_unit': 'cost-unit', 'error': 'error', 'instance_types': 'instance-types'} - _toPy = {'cost-currency': 'cost_currency', 'cost-divisor': 'cost_divisor', 'cost-unit': 'cost_unit', 'error': 'error', 'instance-types': 'instance_types'} - def __init__(self, cost_currency=None, cost_divisor=None, cost_unit=None, error=None, instance_types=None, **unknown_fields): +class EntityMetrics(Type): + _toSchema = {'error': 'error', 'metrics': 'metrics'} + _toPy = {'error': 'error', 'metrics': 'metrics'} + def __init__(self, error=None, metrics=None, **unknown_fields): ''' - cost_currency : str - cost_divisor : int - cost_unit : str error : Error - instance_types : typing.Sequence[~InstanceType] + metrics : typing.Sequence[~MetricResult] ''' - cost_currency_ = cost_currency - cost_divisor_ = cost_divisor - cost_unit_ = cost_unit error_ = Error.from_json(error) if error else None - instance_types_ = [InstanceType.from_json(o) for o in instance_types or []] + metrics_ = [MetricResult.from_json(o) for o in metrics or []] # Validate arguments against known Juju API types. - if cost_currency_ is not None and not isinstance(cost_currency_, (bytes, str)): - raise Exception("Expected cost_currency_ to be a str, received: {}".format(type(cost_currency_))) - - if cost_divisor_ is not None and not isinstance(cost_divisor_, int): - raise Exception("Expected cost_divisor_ to be a int, received: {}".format(type(cost_divisor_))) - - if cost_unit_ is not None and not isinstance(cost_unit_, (bytes, str)): - raise Exception("Expected cost_unit_ to be a str, received: {}".format(type(cost_unit_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if instance_types_ is not None and not isinstance(instance_types_, (bytes, str, list)): - raise Exception("Expected instance_types_ to be a Sequence, received: {}".format(type(instance_types_))) + if metrics_ is not None and not isinstance(metrics_, (bytes, str, list)): + raise Exception("Expected metrics_ to be a Sequence, received: {}".format(type(metrics_))) - self.cost_currency = cost_currency_ - self.cost_divisor = cost_divisor_ - self.cost_unit = cost_unit_ self.error = error_ - self.instance_types = instance_types_ + self.metrics = metrics_ self.unknown_fields = unknown_fields -class InstanceTypesResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class EntityPassword(Type): + _toSchema = {'password': 'password', 'tag': 'tag'} + _toPy = {'password': 'password', 'tag': 'tag'} + def __init__(self, password=None, tag=None, **unknown_fields): ''' - results : typing.Sequence[~InstanceTypesResult] + password : str + tag : str ''' - results_ = [InstanceTypesResult.from_json(o) for o in results or []] + password_ = password + tag_ = tag # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) - self.results = results_ + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.password = password_ + self.tag = tag_ self.unknown_fields = unknown_fields -class IntResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): - ''' - error : Error - result : int +class EntityPasswords(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' - error_ = Error.from_json(error) if error else None - result_ = result + changes : typing.Sequence[~EntityPassword] + ''' + changes_ = [EntityPassword.from_json(o) for o in changes or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if result_ is not None and not isinstance(result_, int): - raise Exception("Expected result_ to be a int, received: {}".format(type(result_))) + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) - self.error = error_ - self.result = result_ + self.changes = changes_ self.unknown_fields = unknown_fields -class InvalidateCredentialArg(Type): - _toSchema = {'reason': 'reason'} - _toPy = {'reason': 'reason'} - def __init__(self, reason=None, **unknown_fields): +class EntityPortRange(Type): + _toSchema = {'endpoint': 'endpoint', 'from_port': 'from-port', 'protocol': 'protocol', 'tag': 'tag', 'to_port': 'to-port'} + _toPy = {'endpoint': 'endpoint', 'from-port': 'from_port', 'protocol': 'protocol', 'tag': 'tag', 'to-port': 'to_port'} + def __init__(self, endpoint=None, from_port=None, protocol=None, tag=None, to_port=None, **unknown_fields): ''' - reason : str + endpoint : str + from_port : int + protocol : str + tag : str + to_port : int ''' - reason_ = reason + endpoint_ = endpoint + from_port_ = from_port + protocol_ = protocol + tag_ = tag + to_port_ = to_port # Validate arguments against known Juju API types. - if reason_ is not None and not isinstance(reason_, (bytes, str)): - raise Exception("Expected reason_ to be a str, received: {}".format(type(reason_))) + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) - self.reason = reason_ + if from_port_ is not None and not isinstance(from_port_, int): + raise Exception("Expected from_port_ to be a int, received: {}".format(type(from_port_))) + + if protocol_ is not None and not isinstance(protocol_, (bytes, str)): + raise Exception("Expected protocol_ to be a str, received: {}".format(type(protocol_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if to_port_ is not None and not isinstance(to_port_, int): + raise Exception("Expected to_port_ to be a int, received: {}".format(type(to_port_))) + + self.endpoint = endpoint_ + self.from_port = from_port_ + self.protocol = protocol_ + self.tag = tag_ + self.to_port = to_port_ self.unknown_fields = unknown_fields -class IsMeteredResult(Type): - _toSchema = {'metered': 'metered'} - _toPy = {'metered': 'metered'} - def __init__(self, metered=None, **unknown_fields): +class EntityStatus(Type): + _toSchema = {'data': 'data', 'info': 'info', 'since': 'since', 'status': 'status'} + _toPy = {'data': 'data', 'info': 'info', 'since': 'since', 'status': 'status'} + def __init__(self, data=None, info=None, since=None, status=None, **unknown_fields): ''' - metered : bool + data : typing.Mapping[str, typing.Any] + info : str + since : str + status : str ''' - metered_ = metered + data_ = data + info_ = info + since_ = since + status_ = status # Validate arguments against known Juju API types. - if metered_ is not None and not isinstance(metered_, bool): - raise Exception("Expected metered_ to be a bool, received: {}".format(type(metered_))) + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - self.metered = metered_ + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.data = data_ + self.info = info_ + self.since = since_ + self.status = status_ self.unknown_fields = unknown_fields -class LXDProfile(Type): - _toSchema = {'config': 'config', 'description': 'description', 'devices': 'devices'} - _toPy = {'config': 'config', 'description': 'description', 'devices': 'devices'} - def __init__(self, config=None, description=None, devices=None, **unknown_fields): +class EntityStatusArgs(Type): + _toSchema = {'data': 'data', 'info': 'info', 'status': 'status', 'tag': 'tag'} + _toPy = {'data': 'data', 'info': 'info', 'status': 'status', 'tag': 'tag'} + def __init__(self, data=None, info=None, status=None, tag=None, **unknown_fields): ''' - config : typing.Mapping[str, str] - description : str - devices : typing.Mapping[str, typing.Any] + data : typing.Mapping[str, typing.Any] + info : str + status : str + tag : str ''' - config_ = config - description_ = description - devices_ = devices + data_ = data + info_ = info + status_ = status + tag_ = tag # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) - if devices_ is not None and not isinstance(devices_, dict): - raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - self.config = config_ - self.description = description_ - self.devices = devices_ + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.data = data_ + self.info = info_ + self.status = status_ + self.tag = tag_ self.unknown_fields = unknown_fields -class ListCloudImageMetadataResult(Type): - _toSchema = {'result': 'result'} - _toPy = {'result': 'result'} - def __init__(self, result=None, **unknown_fields): +class EntityString(Type): + _toSchema = {'tag': 'tag', 'value': 'value'} + _toPy = {'tag': 'tag', 'value': 'value'} + def __init__(self, tag=None, value=None, **unknown_fields): ''' - result : typing.Sequence[~CloudImageMetadata] + tag : str + value : str ''' - result_ = [CloudImageMetadata.from_json(o) for o in result or []] + tag_ = tag + value_ = value # Validate arguments against known Juju API types. - if result_ is not None and not isinstance(result_, (bytes, str, list)): - raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - self.result = result_ + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.tag = tag_ + self.value = value_ self.unknown_fields = unknown_fields -class ListCloudInfo(Type): - _toSchema = {'clouddetails': 'CloudDetails', 'user_access': 'user-access'} - _toPy = {'CloudDetails': 'clouddetails', 'user-access': 'user_access'} - def __init__(self, clouddetails=None, user_access=None, **unknown_fields): +class EntityVersion(Type): + _toSchema = {'tag': 'tag', 'tools': 'tools'} + _toPy = {'tag': 'tag', 'tools': 'tools'} + def __init__(self, tag=None, tools=None, **unknown_fields): ''' - clouddetails : CloudDetails - user_access : str + tag : str + tools : Version ''' - clouddetails_ = CloudDetails.from_json(clouddetails) if clouddetails else None - user_access_ = user_access + tag_ = tag + tools_ = Version.from_json(tools) if tools else None # Validate arguments against known Juju API types. - if clouddetails_ is not None and not isinstance(clouddetails_, (dict, CloudDetails)): - raise Exception("Expected clouddetails_ to be a CloudDetails, received: {}".format(type(clouddetails_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - if user_access_ is not None and not isinstance(user_access_, (bytes, str)): - raise Exception("Expected user_access_ to be a str, received: {}".format(type(user_access_))) + if tools_ is not None and not isinstance(tools_, (dict, Version)): + raise Exception("Expected tools_ to be a Version, received: {}".format(type(tools_))) - self.clouddetails = clouddetails_ - self.user_access = user_access_ + self.tag = tag_ + self.tools = tools_ self.unknown_fields = unknown_fields -class ListCloudInfoResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class EntityWorkloadVersion(Type): + _toSchema = {'tag': 'tag', 'workload_version': 'workload-version'} + _toPy = {'tag': 'tag', 'workload-version': 'workload_version'} + def __init__(self, tag=None, workload_version=None, **unknown_fields): ''' - error : Error - result : ListCloudInfo + tag : str + workload_version : str ''' - error_ = Error.from_json(error) if error else None - result_ = ListCloudInfo.from_json(result) if result else None + tag_ = tag + workload_version_ = workload_version # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - if result_ is not None and not isinstance(result_, (dict, ListCloudInfo)): - raise Exception("Expected result_ to be a ListCloudInfo, received: {}".format(type(result_))) + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) - self.error = error_ - self.result = result_ + self.tag = tag_ + self.workload_version = workload_version_ self.unknown_fields = unknown_fields -class ListCloudInfoResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class EntityWorkloadVersions(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' - results : typing.Sequence[~ListCloudInfoResult] + entities : typing.Sequence[~EntityWorkloadVersion] ''' - results_ = [ListCloudInfoResult.from_json(o) for o in results or []] + entities_ = [EntityWorkloadVersion.from_json(o) for o in entities or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - self.results = results_ + self.entities = entities_ self.unknown_fields = unknown_fields -class ListCloudsRequest(Type): - _toSchema = {'all_': 'all', 'user_tag': 'user-tag'} - _toPy = {'all': 'all_', 'user-tag': 'user_tag'} - def __init__(self, all_=None, user_tag=None, **unknown_fields): +class Error(Type): + _toSchema = {'code': 'code', 'info': 'info', 'message': 'message'} + _toPy = {'code': 'code', 'info': 'info', 'message': 'message'} + def __init__(self, code=None, info=None, message=None, **unknown_fields): ''' - all_ : bool - user_tag : str + code : str + info : typing.Mapping[str, typing.Any] + message : str ''' - all__ = all_ - user_tag_ = user_tag + code_ = code + info_ = info + message_ = message # Validate arguments against known Juju API types. - if all__ is not None and not isinstance(all__, bool): - raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if info_ is not None and not isinstance(info_, dict): + raise Exception("Expected info_ to be a Mapping, received: {}".format(type(info_))) - self.all_ = all__ - self.user_tag = user_tag_ + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.code = code_ + self.info = info_ + self.message = message_ self.unknown_fields = unknown_fields -class ListFirewallRulesResults(Type): - _toSchema = {'rules': 'Rules'} - _toPy = {'Rules': 'rules'} - def __init__(self, rules=None, **unknown_fields): +class ErrorResult(Type): + _toSchema = {'error': 'error'} + _toPy = {'error': 'error'} + def __init__(self, error=None, **unknown_fields): ''' - rules : typing.Sequence[~FirewallRule] + error : Error ''' - rules_ = [FirewallRule.from_json(o) for o in rules or []] + error_ = Error.from_json(error) if error else None # Validate arguments against known Juju API types. - if rules_ is not None and not isinstance(rules_, (bytes, str, list)): - raise Exception("Expected rules_ to be a Sequence, received: {}".format(type(rules_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.rules = rules_ + self.error = error_ self.unknown_fields = unknown_fields -class ListResourcesArgs(Type): - _toSchema = {'entities': 'entities'} - _toPy = {'entities': 'entities'} - def __init__(self, entities=None, **unknown_fields): - ''' - entities : typing.Sequence[~Entity] - ''' - entities_ = [Entity.from_json(o) for o in entities or []] +class ErrorResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ErrorResult] + ''' + results_ = [ErrorResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if entities_ is not None and not isinstance(entities_, (bytes, str, list)): - raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.entities = entities_ + self.results = results_ self.unknown_fields = unknown_fields -class ListSSHKeys(Type): - _toSchema = {'entities': 'entities', 'mode': 'mode'} - _toPy = {'entities': 'entities', 'mode': 'mode'} - def __init__(self, entities=None, mode=None, **unknown_fields): +class ExportBundleParams(Type): + _toSchema = {'include_charm_defaults': 'include-charm-defaults', 'include_series': 'include-series'} + _toPy = {'include-charm-defaults': 'include_charm_defaults', 'include-series': 'include_series'} + def __init__(self, include_charm_defaults=None, include_series=None, **unknown_fields): ''' - entities : Entities - mode : bool + include_charm_defaults : bool + include_series : bool ''' - entities_ = Entities.from_json(entities) if entities else None - mode_ = mode + include_charm_defaults_ = include_charm_defaults + include_series_ = include_series # Validate arguments against known Juju API types. - if entities_ is not None and not isinstance(entities_, (dict, Entities)): - raise Exception("Expected entities_ to be a Entities, received: {}".format(type(entities_))) + if include_charm_defaults_ is not None and not isinstance(include_charm_defaults_, bool): + raise Exception("Expected include_charm_defaults_ to be a bool, received: {}".format(type(include_charm_defaults_))) - if mode_ is not None and not isinstance(mode_, bool): - raise Exception("Expected mode_ to be a bool, received: {}".format(type(mode_))) + if include_series_ is not None and not isinstance(include_series_, bool): + raise Exception("Expected include_series_ to be a bool, received: {}".format(type(include_series_))) - self.entities = entities_ - self.mode = mode_ + self.include_charm_defaults = include_charm_defaults_ + self.include_series = include_series_ self.unknown_fields = unknown_fields -class ListSecretBackendsArgs(Type): - _toSchema = {'names': 'names', 'reveal': 'reveal'} - _toPy = {'names': 'names', 'reveal': 'reveal'} - def __init__(self, names=None, reveal=None, **unknown_fields): +class ExposeInfoResult(Type): + _toSchema = {'error': 'error', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints'} + _toPy = {'error': 'error', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints'} + def __init__(self, error=None, exposed=None, exposed_endpoints=None, **unknown_fields): ''' - names : typing.Sequence[str] - reveal : bool + error : Error + exposed : bool + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] ''' - names_ = names - reveal_ = reveal + error_ = Error.from_json(error) if error else None + exposed_ = exposed + exposed_endpoints_ = {k: ExposedEndpoint.from_json(v) for k, v in (exposed_endpoints or dict()).items()} # Validate arguments against known Juju API types. - if names_ is not None and not isinstance(names_, (bytes, str, list)): - raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if reveal_ is not None and not isinstance(reveal_, bool): - raise Exception("Expected reveal_ to be a bool, received: {}".format(type(reveal_))) + if exposed_ is not None and not isinstance(exposed_, bool): + raise Exception("Expected exposed_ to be a bool, received: {}".format(type(exposed_))) - self.names = names_ - self.reveal = reveal_ + if exposed_endpoints_ is not None and not isinstance(exposed_endpoints_, dict): + raise Exception("Expected exposed_endpoints_ to be a Mapping, received: {}".format(type(exposed_endpoints_))) + + self.error = error_ + self.exposed = exposed_ + self.exposed_endpoints = exposed_endpoints_ self.unknown_fields = unknown_fields -class ListSecretBackendsResults(Type): +class ExposeInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~SecretBackendResult] + results : typing.Sequence[~ExposeInfoResult] ''' - results_ = [SecretBackendResult.from_json(o) for o in results or []] + results_ = [ExposeInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -8632,110 +9511,113 @@ def __init__(self, results=None, **unknown_fields): -class ListSecretResult(Type): - _toSchema = {'access': 'access', 'create_time': 'create-time', 'description': 'description', 'label': 'label', 'latest_expire_time': 'latest-expire-time', 'latest_revision': 'latest-revision', 'next_rotate_time': 'next-rotate-time', 'owner_tag': 'owner-tag', 'revisions': 'revisions', 'rotate_policy': 'rotate-policy', 'update_time': 'update-time', 'uri': 'uri', 'value': 'value', 'version': 'version'} - _toPy = {'access': 'access', 'create-time': 'create_time', 'description': 'description', 'label': 'label', 'latest-expire-time': 'latest_expire_time', 'latest-revision': 'latest_revision', 'next-rotate-time': 'next_rotate_time', 'owner-tag': 'owner_tag', 'revisions': 'revisions', 'rotate-policy': 'rotate_policy', 'update-time': 'update_time', 'uri': 'uri', 'value': 'value', 'version': 'version'} - def __init__(self, access=None, create_time=None, description=None, label=None, latest_expire_time=None, latest_revision=None, next_rotate_time=None, owner_tag=None, revisions=None, rotate_policy=None, update_time=None, uri=None, value=None, version=None, **unknown_fields): +class ExposedEndpoint(Type): + _toSchema = {'expose_to_cidrs': 'expose-to-cidrs', 'expose_to_spaces': 'expose-to-spaces'} + _toPy = {'expose-to-cidrs': 'expose_to_cidrs', 'expose-to-spaces': 'expose_to_spaces'} + def __init__(self, expose_to_cidrs=None, expose_to_spaces=None, **unknown_fields): ''' - access : typing.Sequence[~AccessInfo] - create_time : str - description : str - label : str - latest_expire_time : str - latest_revision : int - next_rotate_time : str - owner_tag : str - revisions : typing.Sequence[~SecretRevision] - rotate_policy : str - update_time : str - uri : str - value : SecretValueResult - version : int + expose_to_cidrs : typing.Sequence[str] + expose_to_spaces : typing.Sequence[str] ''' - access_ = [AccessInfo.from_json(o) for o in access or []] - create_time_ = create_time - description_ = description - label_ = label - latest_expire_time_ = latest_expire_time - latest_revision_ = latest_revision - next_rotate_time_ = next_rotate_time - owner_tag_ = owner_tag - revisions_ = [SecretRevision.from_json(o) for o in revisions or []] - rotate_policy_ = rotate_policy - update_time_ = update_time - uri_ = uri - value_ = SecretValueResult.from_json(value) if value else None - version_ = version + expose_to_cidrs_ = expose_to_cidrs + expose_to_spaces_ = expose_to_spaces # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str, list)): - raise Exception("Expected access_ to be a Sequence, received: {}".format(type(access_))) + if expose_to_cidrs_ is not None and not isinstance(expose_to_cidrs_, (bytes, str, list)): + raise Exception("Expected expose_to_cidrs_ to be a Sequence, received: {}".format(type(expose_to_cidrs_))) - if create_time_ is not None and not isinstance(create_time_, (bytes, str)): - raise Exception("Expected create_time_ to be a str, received: {}".format(type(create_time_))) + if expose_to_spaces_ is not None and not isinstance(expose_to_spaces_, (bytes, str, list)): + raise Exception("Expected expose_to_spaces_ to be a Sequence, received: {}".format(type(expose_to_spaces_))) - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + self.expose_to_cidrs = expose_to_cidrs_ + self.expose_to_spaces = expose_to_spaces_ + self.unknown_fields = unknown_fields - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - if latest_expire_time_ is not None and not isinstance(latest_expire_time_, (bytes, str)): - raise Exception("Expected latest_expire_time_ to be a str, received: {}".format(type(latest_expire_time_))) - if latest_revision_ is not None and not isinstance(latest_revision_, int): - raise Exception("Expected latest_revision_ to be a int, received: {}".format(type(latest_revision_))) +class ExpressionTree(Type): + _toSchema = {'expression': 'Expression'} + _toPy = {'Expression': 'expression'} + def __init__(self, expression=None, **unknown_fields): + ''' + expression : Any + ''' + expression_ = expression - if next_rotate_time_ is not None and not isinstance(next_rotate_time_, (bytes, str)): - raise Exception("Expected next_rotate_time_ to be a str, received: {}".format(type(next_rotate_time_))) + # Validate arguments against known Juju API types. + self.expression = expression_ + self.unknown_fields = unknown_fields - 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 revisions_ is not None and not isinstance(revisions_, (bytes, str, list)): - raise Exception("Expected revisions_ to be a Sequence, received: {}".format(type(revisions_))) - if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): - raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) +class ExternalControllerInfo(Type): + _toSchema = {'addrs': 'addrs', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag'} + _toPy = {'addrs': 'addrs', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag'} + def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_tag=None, **unknown_fields): + ''' + addrs : typing.Sequence[str] + ca_cert : str + controller_alias : str + controller_tag : str + ''' + addrs_ = addrs + ca_cert_ = ca_cert + controller_alias_ = controller_alias + controller_tag_ = controller_tag - if update_time_ is not None and not isinstance(update_time_, (bytes, str)): - raise Exception("Expected update_time_ to be a str, received: {}".format(type(update_time_))) + # Validate arguments against known Juju API types. + if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): + raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) - if uri_ is not None and not isinstance(uri_, (bytes, str)): - raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) - if value_ is not None and not isinstance(value_, (dict, SecretValueResult)): - raise Exception("Expected value_ to be a SecretValueResult, received: {}".format(type(value_))) + if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): + raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) - if version_ is not None and not isinstance(version_, int): - raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): + raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) - self.access = access_ - self.create_time = create_time_ - self.description = description_ - self.label = label_ - self.latest_expire_time = latest_expire_time_ - self.latest_revision = latest_revision_ - self.next_rotate_time = next_rotate_time_ - self.owner_tag = owner_tag_ - self.revisions = revisions_ - self.rotate_policy = rotate_policy_ - self.update_time = update_time_ - self.uri = uri_ - self.value = value_ - self.version = version_ + self.addrs = addrs_ + self.ca_cert = ca_cert_ + self.controller_alias = controller_alias_ + self.controller_tag = controller_tag_ self.unknown_fields = unknown_fields -class ListSecretResults(Type): +class ExternalControllerInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ExternalControllerInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ExternalControllerInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ExternalControllerInfo)): + raise Exception("Expected result_ to be a ExternalControllerInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ExternalControllerInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ListSecretResult] + results : typing.Sequence[~ExternalControllerInfoResult] ''' - results_ = [ListSecretResult.from_json(o) for o in results or []] + results_ = [ExternalControllerInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -8746,418 +9628,401 @@ def __init__(self, results=None, **unknown_fields): -class ListSecretsArgs(Type): - _toSchema = {'filter_': 'filter', 'show_secrets': 'show-secrets'} - _toPy = {'filter': 'filter_', 'show-secrets': 'show_secrets'} - def __init__(self, filter_=None, show_secrets=None, **unknown_fields): +class FanConfigEntry(Type): + _toSchema = {'overlay': 'overlay', 'underlay': 'underlay'} + _toPy = {'overlay': 'overlay', 'underlay': 'underlay'} + def __init__(self, overlay=None, underlay=None, **unknown_fields): ''' - filter_ : SecretsFilter - show_secrets : bool + overlay : str + underlay : str ''' - filter__ = SecretsFilter.from_json(filter_) if filter_ else None - show_secrets_ = show_secrets + overlay_ = overlay + underlay_ = underlay # Validate arguments against known Juju API types. - if filter__ is not None and not isinstance(filter__, (dict, SecretsFilter)): - raise Exception("Expected filter__ to be a SecretsFilter, received: {}".format(type(filter__))) + if overlay_ is not None and not isinstance(overlay_, (bytes, str)): + raise Exception("Expected overlay_ to be a str, received: {}".format(type(overlay_))) - if show_secrets_ is not None and not isinstance(show_secrets_, bool): - raise Exception("Expected show_secrets_ to be a bool, received: {}".format(type(show_secrets_))) + if underlay_ is not None and not isinstance(underlay_, (bytes, str)): + raise Exception("Expected underlay_ to be a str, received: {}".format(type(underlay_))) - self.filter_ = filter__ - self.show_secrets = show_secrets_ + self.overlay = overlay_ + self.underlay = underlay_ self.unknown_fields = unknown_fields -class ListSpacesResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class FanConfigResult(Type): + _toSchema = {'fans': 'fans'} + _toPy = {'fans': 'fans'} + def __init__(self, fans=None, **unknown_fields): ''' - results : typing.Sequence[~Space] + fans : typing.Sequence[~FanConfigEntry] ''' - results_ = [Space.from_json(o) for o in results or []] + fans_ = [FanConfigEntry.from_json(o) for o in fans or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if fans_ is not None and not isinstance(fans_, (bytes, str, list)): + raise Exception("Expected fans_ to be a Sequence, received: {}".format(type(fans_))) - self.results = results_ + self.fans = fans_ self.unknown_fields = unknown_fields -class ListSubnetsResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class Filesystem(Type): + _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'volume_tag': 'volume-tag'} + _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'volume-tag': 'volume_tag'} + def __init__(self, filesystem_tag=None, info=None, volume_tag=None, **unknown_fields): ''' - results : typing.Sequence[~Subnet] + filesystem_tag : str + info : FilesystemInfo + volume_tag : str ''' - results_ = [Subnet.from_json(o) for o in results or []] + filesystem_tag_ = filesystem_tag + info_ = FilesystemInfo.from_json(info) if info else None + volume_tag_ = volume_tag # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) - self.results = results_ + if info_ is not None and not isinstance(info_, (dict, FilesystemInfo)): + raise Exception("Expected info_ to be a FilesystemInfo, received: {}".format(type(info_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.filesystem_tag = filesystem_tag_ + self.info = info_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class LoginRequest(Type): - _toSchema = {'auth_tag': 'auth-tag', 'bakery_version': 'bakery-version', 'cli_args': 'cli-args', 'client_version': 'client-version', 'credentials': 'credentials', 'macaroons': 'macaroons', 'nonce': 'nonce', 'token': 'token', 'user_data': 'user-data'} - _toPy = {'auth-tag': 'auth_tag', 'bakery-version': 'bakery_version', 'cli-args': 'cli_args', 'client-version': 'client_version', 'credentials': 'credentials', 'macaroons': 'macaroons', 'nonce': 'nonce', 'token': 'token', 'user-data': 'user_data'} - def __init__(self, auth_tag=None, bakery_version=None, cli_args=None, client_version=None, credentials=None, macaroons=None, nonce=None, token=None, user_data=None, **unknown_fields): +class FilesystemAttachment(Type): + _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'machine_tag': 'machine-tag'} + _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'machine-tag': 'machine_tag'} + def __init__(self, filesystem_tag=None, info=None, machine_tag=None, **unknown_fields): ''' - auth_tag : str - bakery_version : int - cli_args : str - client_version : str - credentials : str - macaroons : typing.Sequence[~Macaroon] - nonce : str - token : str - user_data : str + filesystem_tag : str + info : FilesystemAttachmentInfo + machine_tag : str ''' - auth_tag_ = auth_tag - bakery_version_ = bakery_version - cli_args_ = cli_args - client_version_ = client_version - credentials_ = credentials - macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] - nonce_ = nonce - token_ = token - user_data_ = user_data + filesystem_tag_ = filesystem_tag + info_ = FilesystemAttachmentInfo.from_json(info) if info else None + machine_tag_ = machine_tag # Validate arguments against known Juju API types. - if auth_tag_ is not None and not isinstance(auth_tag_, (bytes, str)): - raise Exception("Expected auth_tag_ to be a str, received: {}".format(type(auth_tag_))) + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) - if bakery_version_ is not None and not isinstance(bakery_version_, int): - raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + if info_ is not None and not isinstance(info_, (dict, FilesystemAttachmentInfo)): + raise Exception("Expected info_ to be a FilesystemAttachmentInfo, received: {}".format(type(info_))) - if cli_args_ is not None and not isinstance(cli_args_, (bytes, str)): - raise Exception("Expected cli_args_ to be a str, received: {}".format(type(cli_args_))) + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) - if client_version_ is not None and not isinstance(client_version_, (bytes, str)): - raise Exception("Expected client_version_ to be a str, received: {}".format(type(client_version_))) + self.filesystem_tag = filesystem_tag_ + self.info = info_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields - if credentials_ is not None and not isinstance(credentials_, (bytes, str)): - raise Exception("Expected credentials_ to be a str, received: {}".format(type(credentials_))) - if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): - raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) - if nonce_ is not None and not isinstance(nonce_, (bytes, str)): - raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) +class FilesystemAttachmentDetails(Type): + _toSchema = {'filesystemattachmentinfo': 'FilesystemAttachmentInfo', 'life': 'life', 'mount_point': 'mount-point', 'read_only': 'read-only'} + _toPy = {'FilesystemAttachmentInfo': 'filesystemattachmentinfo', 'life': 'life', 'mount-point': 'mount_point', 'read-only': 'read_only'} + def __init__(self, filesystemattachmentinfo=None, life=None, mount_point=None, read_only=None, **unknown_fields): + ''' + filesystemattachmentinfo : FilesystemAttachmentInfo + life : str + mount_point : str + read_only : bool + ''' + filesystemattachmentinfo_ = FilesystemAttachmentInfo.from_json(filesystemattachmentinfo) if filesystemattachmentinfo else None + life_ = life + mount_point_ = mount_point + read_only_ = read_only - if token_ is not None and not isinstance(token_, (bytes, str)): - raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) + # Validate arguments against known Juju API types. + if filesystemattachmentinfo_ is not None and not isinstance(filesystemattachmentinfo_, (dict, FilesystemAttachmentInfo)): + raise Exception("Expected filesystemattachmentinfo_ to be a FilesystemAttachmentInfo, received: {}".format(type(filesystemattachmentinfo_))) - if user_data_ is not None and not isinstance(user_data_, (bytes, str)): - raise Exception("Expected user_data_ to be a str, received: {}".format(type(user_data_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - self.auth_tag = auth_tag_ - self.bakery_version = bakery_version_ - self.cli_args = cli_args_ - self.client_version = client_version_ - self.credentials = credentials_ - self.macaroons = macaroons_ - self.nonce = nonce_ - self.token = token_ - self.user_data = user_data_ + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.filesystemattachmentinfo = filesystemattachmentinfo_ + self.life = life_ + self.mount_point = mount_point_ + self.read_only = read_only_ self.unknown_fields = unknown_fields -class LoginResult(Type): - _toSchema = {'bakery_discharge_required': 'bakery-discharge-required', 'controller_tag': 'controller-tag', 'discharge_required': 'discharge-required', 'discharge_required_error': 'discharge-required-error', 'facades': 'facades', 'model_tag': 'model-tag', 'public_dns_name': 'public-dns-name', 'server_version': 'server-version', 'servers': 'servers', 'user_info': 'user-info'} - _toPy = {'bakery-discharge-required': 'bakery_discharge_required', 'controller-tag': 'controller_tag', 'discharge-required': 'discharge_required', 'discharge-required-error': 'discharge_required_error', 'facades': 'facades', 'model-tag': 'model_tag', 'public-dns-name': 'public_dns_name', 'server-version': 'server_version', 'servers': 'servers', 'user-info': 'user_info'} - def __init__(self, bakery_discharge_required=None, controller_tag=None, discharge_required=None, discharge_required_error=None, facades=None, model_tag=None, public_dns_name=None, server_version=None, servers=None, user_info=None, **unknown_fields): +class FilesystemAttachmentInfo(Type): + _toSchema = {'mount_point': 'mount-point', 'read_only': 'read-only'} + _toPy = {'mount-point': 'mount_point', 'read-only': 'read_only'} + def __init__(self, mount_point=None, read_only=None, **unknown_fields): ''' - bakery_discharge_required : Macaroon - controller_tag : str - discharge_required : Macaroon - discharge_required_error : str - facades : typing.Sequence[~FacadeVersions] - model_tag : str - public_dns_name : str - server_version : str - servers : typing.Sequence[~HostPort] - user_info : AuthUserInfo + mount_point : str + read_only : bool ''' - bakery_discharge_required_ = Macaroon.from_json(bakery_discharge_required) if bakery_discharge_required else None - controller_tag_ = controller_tag - discharge_required_ = Macaroon.from_json(discharge_required) if discharge_required else None - discharge_required_error_ = discharge_required_error - facades_ = [FacadeVersions.from_json(o) for o in facades or []] - model_tag_ = model_tag - public_dns_name_ = public_dns_name - server_version_ = server_version - servers_ = [HostPort.from_json(o) for o in servers or []] - user_info_ = AuthUserInfo.from_json(user_info) if user_info else None + mount_point_ = mount_point + read_only_ = read_only # Validate arguments against known Juju API types. - if bakery_discharge_required_ is not None and not isinstance(bakery_discharge_required_, (dict, Macaroon)): - raise Exception("Expected bakery_discharge_required_ to be a Macaroon, received: {}".format(type(bakery_discharge_required_))) - - if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): - raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) - if discharge_required_ is not None and not isinstance(discharge_required_, (dict, Macaroon)): - raise Exception("Expected discharge_required_ to be a Macaroon, received: {}".format(type(discharge_required_))) + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) - if discharge_required_error_ is not None and not isinstance(discharge_required_error_, (bytes, str)): - raise Exception("Expected discharge_required_error_ to be a str, received: {}".format(type(discharge_required_error_))) + self.mount_point = mount_point_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields - if facades_ is not None and not isinstance(facades_, (bytes, str, list)): - raise Exception("Expected facades_ to be a Sequence, received: {}".format(type(facades_))) - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) - if public_dns_name_ is not None and not isinstance(public_dns_name_, (bytes, str)): - raise Exception("Expected public_dns_name_ to be a str, received: {}".format(type(public_dns_name_))) +class FilesystemAttachmentParams(Type): + _toSchema = {'filesystem_id': 'filesystem-id', 'filesystem_tag': 'filesystem-tag', 'instance_id': 'instance-id', 'machine_tag': 'machine-tag', 'mount_point': 'mount-point', 'provider': 'provider', 'read_only': 'read-only'} + _toPy = {'filesystem-id': 'filesystem_id', 'filesystem-tag': 'filesystem_tag', 'instance-id': 'instance_id', 'machine-tag': 'machine_tag', 'mount-point': 'mount_point', 'provider': 'provider', 'read-only': 'read_only'} + def __init__(self, filesystem_id=None, filesystem_tag=None, instance_id=None, machine_tag=None, mount_point=None, provider=None, read_only=None, **unknown_fields): + ''' + filesystem_id : str + filesystem_tag : str + instance_id : str + machine_tag : str + mount_point : str + provider : str + read_only : bool + ''' + filesystem_id_ = filesystem_id + filesystem_tag_ = filesystem_tag + instance_id_ = instance_id + machine_tag_ = machine_tag + mount_point_ = mount_point + provider_ = provider + read_only_ = read_only - if server_version_ is not None and not isinstance(server_version_, (bytes, str)): - raise Exception("Expected server_version_ to be a str, received: {}".format(type(server_version_))) + # Validate arguments against known Juju API types. + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) - if servers_ is not None and not isinstance(servers_, (bytes, str, list)): - raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) - if user_info_ is not None and not isinstance(user_info_, (dict, AuthUserInfo)): - raise Exception("Expected user_info_ to be a AuthUserInfo, received: {}".format(type(user_info_))) + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) - self.bakery_discharge_required = bakery_discharge_required_ - self.controller_tag = controller_tag_ - self.discharge_required = discharge_required_ - self.discharge_required_error = discharge_required_error_ - self.facades = facades_ - self.model_tag = model_tag_ - self.public_dns_name = public_dns_name_ - self.server_version = server_version_ - self.servers = servers_ - self.user_info = user_info_ - self.unknown_fields = unknown_fields + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) -class Macaroon(Type): - _toSchema = {} - _toPy = {} - def __init__(self, **unknown_fields): - ''' + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) - ''' + self.filesystem_id = filesystem_id_ + self.filesystem_tag = filesystem_tag_ + self.instance_id = instance_id_ + self.machine_tag = machine_tag_ + self.mount_point = mount_point_ + self.provider = provider_ + self.read_only = read_only_ self.unknown_fields = unknown_fields -class MachineHardware(Type): - _toSchema = {'arch': 'arch', 'availability_zone': 'availability-zone', 'cores': 'cores', 'cpu_power': 'cpu-power', 'mem': 'mem', 'root_disk': 'root-disk', 'tags': 'tags', 'virt_type': 'virt-type'} - _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cores': 'cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'tags': 'tags', 'virt-type': 'virt_type'} - def __init__(self, arch=None, availability_zone=None, cores=None, cpu_power=None, mem=None, root_disk=None, tags=None, virt_type=None, **unknown_fields): +class FilesystemAttachmentParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - arch : str - availability_zone : str - cores : int - cpu_power : int - mem : int - root_disk : int - tags : typing.Sequence[str] - virt_type : str + error : Error + result : FilesystemAttachmentParams ''' - arch_ = arch - availability_zone_ = availability_zone - cores_ = cores - cpu_power_ = cpu_power - mem_ = mem - root_disk_ = root_disk - tags_ = tags - virt_type_ = virt_type + error_ = Error.from_json(error) if error else None + result_ = FilesystemAttachmentParams.from_json(result) if result else None # Validate arguments against known Juju API types. - if arch_ is not None and not isinstance(arch_, (bytes, str)): - raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if availability_zone_ is not None and not isinstance(availability_zone_, (bytes, str)): - raise Exception("Expected availability_zone_ to be a str, received: {}".format(type(availability_zone_))) + if result_ is not None and not isinstance(result_, (dict, FilesystemAttachmentParams)): + raise Exception("Expected result_ to be a FilesystemAttachmentParams, received: {}".format(type(result_))) - if cores_ is not None and not isinstance(cores_, int): - raise Exception("Expected cores_ to be a int, received: {}".format(type(cores_))) - - if cpu_power_ is not None and not isinstance(cpu_power_, int): - raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields - if mem_ is not None and not isinstance(mem_, int): - raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) - if root_disk_ is not None and not isinstance(root_disk_, int): - raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) - if tags_ is not None and not isinstance(tags_, (bytes, str, list)): - raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) +class FilesystemAttachmentParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemAttachmentParamsResult] + ''' + results_ = [FilesystemAttachmentParamsResult.from_json(o) for o in results or []] - 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_))) + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.arch = arch_ - self.availability_zone = availability_zone_ - self.cores = cores_ - self.cpu_power = cpu_power_ - self.mem = mem_ - self.root_disk = root_disk_ - self.tags = tags_ - self.virt_type = virt_type_ + self.results = results_ self.unknown_fields = unknown_fields -class MachineStatus(Type): - _toSchema = {'agent_status': 'agent-status', 'base': 'base', 'constraints': 'constraints', 'containers': 'containers', 'display_name': 'display-name', 'dns_name': 'dns-name', 'hardware': 'hardware', 'has_vote': 'has-vote', 'hostname': 'hostname', 'id_': 'id', 'instance_id': 'instance-id', 'instance_status': 'instance-status', 'ip_addresses': 'ip-addresses', 'jobs': 'jobs', 'lxd_profiles': 'lxd-profiles', 'modification_status': 'modification-status', 'network_interfaces': 'network-interfaces', 'primary_controller_machine': 'primary-controller-machine', 'wants_vote': 'wants-vote'} - _toPy = {'agent-status': 'agent_status', 'base': 'base', 'constraints': 'constraints', 'containers': 'containers', 'display-name': 'display_name', 'dns-name': 'dns_name', 'hardware': 'hardware', 'has-vote': 'has_vote', 'hostname': 'hostname', 'id': 'id_', 'instance-id': 'instance_id', 'instance-status': 'instance_status', 'ip-addresses': 'ip_addresses', 'jobs': 'jobs', 'lxd-profiles': 'lxd_profiles', 'modification-status': 'modification_status', 'network-interfaces': 'network_interfaces', 'primary-controller-machine': 'primary_controller_machine', 'wants-vote': 'wants_vote'} - def __init__(self, agent_status=None, base=None, constraints=None, containers=None, display_name=None, dns_name=None, hardware=None, has_vote=None, hostname=None, id_=None, instance_id=None, instance_status=None, ip_addresses=None, jobs=None, lxd_profiles=None, modification_status=None, network_interfaces=None, primary_controller_machine=None, wants_vote=None, **unknown_fields): +class FilesystemAttachmentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - agent_status : DetailedStatus - base : Base - constraints : str - containers : typing.Mapping[str, ~MachineStatus] - display_name : str - dns_name : str - hardware : str - has_vote : bool - hostname : str - id_ : str - instance_id : str - instance_status : DetailedStatus - ip_addresses : typing.Sequence[str] - jobs : typing.Sequence[str] - lxd_profiles : typing.Mapping[str, ~LXDProfile] - modification_status : DetailedStatus - network_interfaces : typing.Mapping[str, ~NetworkInterface] - primary_controller_machine : bool - wants_vote : bool + error : Error + result : FilesystemAttachment ''' - agent_status_ = DetailedStatus.from_json(agent_status) if agent_status else None - base_ = Base.from_json(base) if base else None - constraints_ = constraints - containers_ = {k: MachineStatus.from_json(v) for k, v in (containers or dict()).items()} - display_name_ = display_name - dns_name_ = dns_name - hardware_ = hardware - has_vote_ = has_vote - hostname_ = hostname - id__ = id_ - instance_id_ = instance_id - instance_status_ = DetailedStatus.from_json(instance_status) if instance_status else None - ip_addresses_ = ip_addresses - jobs_ = jobs - lxd_profiles_ = {k: LXDProfile.from_json(v) for k, v in (lxd_profiles or dict()).items()} - modification_status_ = DetailedStatus.from_json(modification_status) if modification_status else None - network_interfaces_ = {k: NetworkInterface.from_json(v) for k, v in (network_interfaces or dict()).items()} - primary_controller_machine_ = primary_controller_machine - wants_vote_ = wants_vote + error_ = Error.from_json(error) if error else None + result_ = FilesystemAttachment.from_json(result) if result else None # Validate arguments against known Juju API types. - if agent_status_ is not None and not isinstance(agent_status_, (dict, DetailedStatus)): - raise Exception("Expected agent_status_ to be a DetailedStatus, received: {}".format(type(agent_status_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if base_ is not None and not isinstance(base_, (dict, Base)): - raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) + if result_ is not None and not isinstance(result_, (dict, FilesystemAttachment)): + raise Exception("Expected result_ to be a FilesystemAttachment, received: {}".format(type(result_))) - if constraints_ is not None and not isinstance(constraints_, (bytes, str)): - raise Exception("Expected constraints_ to be a str, received: {}".format(type(constraints_))) + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields - if containers_ is not None and not isinstance(containers_, dict): - raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) - if display_name_ is not None and not isinstance(display_name_, (bytes, str)): - raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) - if dns_name_ is not None and not isinstance(dns_name_, (bytes, str)): - raise Exception("Expected dns_name_ to be a str, received: {}".format(type(dns_name_))) +class FilesystemAttachmentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemAttachmentResult] + ''' + results_ = [FilesystemAttachmentResult.from_json(o) for o in results or []] - if hardware_ is not None and not isinstance(hardware_, (bytes, str)): - raise Exception("Expected hardware_ to be a str, received: {}".format(type(hardware_))) + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if has_vote_ is not None and not isinstance(has_vote_, bool): - raise Exception("Expected has_vote_ to be a bool, received: {}".format(type(has_vote_))) + self.results = results_ + self.unknown_fields = unknown_fields - if hostname_ is not None and not isinstance(hostname_, (bytes, str)): - raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): - raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) +class FilesystemAttachments(Type): + _toSchema = {'filesystem_attachments': 'filesystem-attachments'} + _toPy = {'filesystem-attachments': 'filesystem_attachments'} + def __init__(self, filesystem_attachments=None, **unknown_fields): + ''' + filesystem_attachments : typing.Sequence[~FilesystemAttachment] + ''' + filesystem_attachments_ = [FilesystemAttachment.from_json(o) for o in filesystem_attachments or []] - if instance_status_ is not None and not isinstance(instance_status_, (dict, DetailedStatus)): - raise Exception("Expected instance_status_ to be a DetailedStatus, received: {}".format(type(instance_status_))) + # Validate arguments against known Juju API types. + if filesystem_attachments_ is not None and not isinstance(filesystem_attachments_, (bytes, str, list)): + raise Exception("Expected filesystem_attachments_ to be a Sequence, received: {}".format(type(filesystem_attachments_))) - if ip_addresses_ is not None and not isinstance(ip_addresses_, (bytes, str, list)): - raise Exception("Expected ip_addresses_ to be a Sequence, received: {}".format(type(ip_addresses_))) + self.filesystem_attachments = filesystem_attachments_ + self.unknown_fields = unknown_fields - if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): - raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) - if lxd_profiles_ is not None and not isinstance(lxd_profiles_, dict): - raise Exception("Expected lxd_profiles_ to be a Mapping, received: {}".format(type(lxd_profiles_))) - if modification_status_ is not None and not isinstance(modification_status_, (dict, DetailedStatus)): - raise Exception("Expected modification_status_ to be a DetailedStatus, received: {}".format(type(modification_status_))) +class FilesystemDetails(Type): + _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'life': 'life', 'machine_attachments': 'machine-attachments', 'status': 'status', 'storage': 'storage', 'unit_attachments': 'unit-attachments', 'volume_tag': 'volume-tag'} + _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'life': 'life', 'machine-attachments': 'machine_attachments', 'status': 'status', 'storage': 'storage', 'unit-attachments': 'unit_attachments', 'volume-tag': 'volume_tag'} + def __init__(self, filesystem_tag=None, info=None, life=None, machine_attachments=None, status=None, storage=None, unit_attachments=None, volume_tag=None, **unknown_fields): + ''' + filesystem_tag : str + info : FilesystemInfo + life : str + machine_attachments : typing.Mapping[str, ~FilesystemAttachmentDetails] + status : EntityStatus + storage : StorageDetails + unit_attachments : typing.Mapping[str, ~FilesystemAttachmentDetails] + volume_tag : str + ''' + filesystem_tag_ = filesystem_tag + info_ = FilesystemInfo.from_json(info) if info else None + life_ = life + machine_attachments_ = {k: FilesystemAttachmentDetails.from_json(v) for k, v in (machine_attachments or dict()).items()} + status_ = EntityStatus.from_json(status) if status else None + storage_ = StorageDetails.from_json(storage) if storage else None + unit_attachments_ = {k: FilesystemAttachmentDetails.from_json(v) for k, v in (unit_attachments or dict()).items()} + volume_tag_ = volume_tag - if network_interfaces_ is not None and not isinstance(network_interfaces_, dict): - raise Exception("Expected network_interfaces_ to be a Mapping, received: {}".format(type(network_interfaces_))) + # Validate arguments against known Juju API types. + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) - if primary_controller_machine_ is not None and not isinstance(primary_controller_machine_, bool): - raise Exception("Expected primary_controller_machine_ to be a bool, received: {}".format(type(primary_controller_machine_))) + if info_ is not None and not isinstance(info_, (dict, FilesystemInfo)): + raise Exception("Expected info_ to be a FilesystemInfo, received: {}".format(type(info_))) - if wants_vote_ is not None and not isinstance(wants_vote_, bool): - raise Exception("Expected wants_vote_ to be a bool, received: {}".format(type(wants_vote_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - self.agent_status = agent_status_ - self.base = base_ - self.constraints = constraints_ - self.containers = containers_ - self.display_name = display_name_ - self.dns_name = dns_name_ - self.hardware = hardware_ - self.has_vote = has_vote_ - self.hostname = hostname_ - self.id_ = id__ - self.instance_id = instance_id_ - self.instance_status = instance_status_ - self.ip_addresses = ip_addresses_ - self.jobs = jobs_ - self.lxd_profiles = lxd_profiles_ - self.modification_status = modification_status_ - self.network_interfaces = network_interfaces_ - self.primary_controller_machine = primary_controller_machine_ - self.wants_vote = wants_vote_ + if machine_attachments_ is not None and not isinstance(machine_attachments_, dict): + raise Exception("Expected machine_attachments_ to be a Mapping, received: {}".format(type(machine_attachments_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if storage_ is not None and not isinstance(storage_, (dict, StorageDetails)): + raise Exception("Expected storage_ to be a StorageDetails, received: {}".format(type(storage_))) + + if unit_attachments_ is not None and not isinstance(unit_attachments_, dict): + raise Exception("Expected unit_attachments_ to be a Mapping, received: {}".format(type(unit_attachments_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.filesystem_tag = filesystem_tag_ + self.info = info_ + self.life = life_ + self.machine_attachments = machine_attachments_ + self.status = status_ + self.storage = storage_ + self.unit_attachments = unit_attachments_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class MapResult(Type): +class FilesystemDetailsListResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - result : typing.Mapping[str, typing.Any] + result : typing.Sequence[~FilesystemDetails] ''' error_ = Error.from_json(error) if error else None - result_ = result + result_ = [FilesystemDetails.from_json(o) for o in result or []] # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, dict): - raise Exception("Expected result_ to be a Mapping, received: {}".format(type(result_))) + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) self.error = error_ self.result = result_ @@ -9165,14 +10030,14 @@ def __init__(self, error=None, result=None, **unknown_fields): -class MapResults(Type): +class FilesystemDetailsListResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~MapResult] + results : typing.Sequence[~FilesystemDetailsListResult] ''' - results_ = [MapResult.from_json(o) for o in results or []] + results_ = [FilesystemDetailsListResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -9183,164 +10048,158 @@ def __init__(self, results=None, **unknown_fields): -class MetadataImageIds(Type): - _toSchema = {'image_ids': 'image-ids'} - _toPy = {'image-ids': 'image_ids'} - def __init__(self, image_ids=None, **unknown_fields): +class FilesystemFilter(Type): + _toSchema = {'machines': 'machines'} + _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): ''' - image_ids : typing.Sequence[str] + machines : typing.Sequence[str] ''' - image_ids_ = image_ids + machines_ = machines # Validate arguments against known Juju API types. - if image_ids_ is not None and not isinstance(image_ids_, (bytes, str, list)): - raise Exception("Expected image_ids_ to be a Sequence, received: {}".format(type(image_ids_))) + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) - self.image_ids = image_ids_ + self.machines = machines_ self.unknown_fields = unknown_fields -class MetadataSaveParams(Type): - _toSchema = {'metadata': 'metadata'} - _toPy = {'metadata': 'metadata'} - def __init__(self, metadata=None, **unknown_fields): +class FilesystemFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' - metadata : typing.Sequence[~CloudImageMetadataList] + filters : typing.Sequence[~FilesystemFilter] ''' - metadata_ = [CloudImageMetadataList.from_json(o) for o in metadata or []] + filters_ = [FilesystemFilter.from_json(o) for o in filters or []] # Validate arguments against known Juju API types. - if metadata_ is not None and not isinstance(metadata_, (bytes, str, list)): - raise Exception("Expected metadata_ to be a Sequence, received: {}".format(type(metadata_))) + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) - self.metadata = metadata_ + self.filters = filters_ self.unknown_fields = unknown_fields -class MeterStatus(Type): - _toSchema = {'color': 'color', 'message': 'message'} - _toPy = {'color': 'color', 'message': 'message'} - def __init__(self, color=None, message=None, **unknown_fields): +class FilesystemInfo(Type): + _toSchema = {'filesystem_id': 'filesystem-id', 'pool': 'pool', 'size': 'size'} + _toPy = {'filesystem-id': 'filesystem_id', 'pool': 'pool', 'size': 'size'} + def __init__(self, filesystem_id=None, pool=None, size=None, **unknown_fields): ''' - color : str - message : str + filesystem_id : str + pool : str + size : int ''' - color_ = color - message_ = message + filesystem_id_ = filesystem_id + pool_ = pool + size_ = size # Validate arguments against known Juju API types. - if color_ is not None and not isinstance(color_, (bytes, str)): - raise Exception("Expected color_ to be a str, received: {}".format(type(color_))) + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) - self.color = color_ - self.message = message_ + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + self.filesystem_id = filesystem_id_ + self.pool = pool_ + self.size = size_ self.unknown_fields = unknown_fields -class MeterStatusParam(Type): - _toSchema = {'code': 'code', 'info': 'info', 'tag': 'tag'} - _toPy = {'code': 'code', 'info': 'info', 'tag': 'tag'} - def __init__(self, code=None, info=None, tag=None, **unknown_fields): +class FilesystemParams(Type): + _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'filesystem_tag': 'filesystem-tag', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume_tag': 'volume-tag'} + _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'filesystem-tag': 'filesystem_tag', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume-tag': 'volume_tag'} + def __init__(self, attachment=None, attributes=None, filesystem_tag=None, provider=None, size=None, tags=None, volume_tag=None, **unknown_fields): ''' - code : str - info : str - tag : str + attachment : FilesystemAttachmentParams + attributes : typing.Mapping[str, typing.Any] + filesystem_tag : str + provider : str + size : int + tags : typing.Mapping[str, str] + volume_tag : str ''' - code_ = code - info_ = info - tag_ = tag + attachment_ = FilesystemAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + filesystem_tag_ = filesystem_tag + provider_ = provider + size_ = size + tags_ = tags + volume_tag_ = volume_tag # Validate arguments against known Juju API types. - if code_ is not None and not isinstance(code_, (bytes, str)): - raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) - - if info_ is not None and not isinstance(info_, (bytes, str)): - raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + if attachment_ is not None and not isinstance(attachment_, (dict, FilesystemAttachmentParams)): + raise Exception("Expected attachment_ to be a FilesystemAttachmentParams, received: {}".format(type(attachment_))) - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) - self.code = code_ - self.info = info_ - self.tag = tag_ - self.unknown_fields = unknown_fields + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) -class MeterStatusParams(Type): - _toSchema = {'statues': 'statues'} - _toPy = {'statues': 'statues'} - def __init__(self, statues=None, **unknown_fields): - ''' - statues : typing.Sequence[~MeterStatusParam] - ''' - statues_ = [MeterStatusParam.from_json(o) for o in statues or []] + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) - # Validate arguments against known Juju API types. - if statues_ is not None and not isinstance(statues_, (bytes, str, list)): - raise Exception("Expected statues_ to be a Sequence, received: {}".format(type(statues_))) + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) - self.statues = statues_ + self.attachment = attachment_ + self.attributes = attributes_ + self.filesystem_tag = filesystem_tag_ + self.provider = provider_ + self.size = size_ + self.tags = tags_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class MetricResult(Type): - _toSchema = {'key': 'key', 'labels': 'labels', 'time': 'time', 'unit': 'unit', 'value': 'value'} - _toPy = {'key': 'key', 'labels': 'labels', 'time': 'time', 'unit': 'unit', 'value': 'value'} - def __init__(self, key=None, labels=None, time=None, unit=None, value=None, **unknown_fields): +class FilesystemParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - key : str - labels : typing.Mapping[str, str] - time : str - unit : str - value : str + error : Error + result : FilesystemParams ''' - key_ = key - labels_ = labels - time_ = time - unit_ = unit - value_ = value + error_ = Error.from_json(error) if error else None + result_ = FilesystemParams.from_json(result) if result else None # Validate arguments against known Juju API types. - if key_ is not None and not isinstance(key_, (bytes, str)): - raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) - - if labels_ is not None and not isinstance(labels_, dict): - raise Exception("Expected labels_ to be a Mapping, received: {}".format(type(labels_))) - - if time_ is not None and not isinstance(time_, (bytes, str)): - raise Exception("Expected time_ to be a str, received: {}".format(type(time_))) - - if unit_ is not None and not isinstance(unit_, (bytes, str)): - raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if value_ is not None and not isinstance(value_, (bytes, str)): - raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + if result_ is not None and not isinstance(result_, (dict, FilesystemParams)): + raise Exception("Expected result_ to be a FilesystemParams, received: {}".format(type(result_))) - self.key = key_ - self.labels = labels_ - self.time = time_ - self.unit = unit_ - self.value = value_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class MetricResults(Type): +class FilesystemParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~EntityMetrics] + results : typing.Sequence[~FilesystemParamsResult] ''' - results_ = [EntityMetrics.from_json(o) for o in results or []] + results_ = [FilesystemParamsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -9351,368 +10210,416 @@ def __init__(self, results=None, **unknown_fields): -class MigrationSpec(Type): - _toSchema = {'model_tag': 'model-tag', 'target_info': 'target-info'} - _toPy = {'model-tag': 'model_tag', 'target-info': 'target_info'} - def __init__(self, model_tag=None, target_info=None, **unknown_fields): +class FilesystemResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - model_tag : str - target_info : MigrationTargetInfo + error : Error + result : Filesystem ''' - model_tag_ = model_tag - target_info_ = MigrationTargetInfo.from_json(target_info) if target_info else None + error_ = Error.from_json(error) if error else None + result_ = Filesystem.from_json(result) if result else None # Validate arguments against known Juju API types. - if 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if target_info_ is not None and not isinstance(target_info_, (dict, MigrationTargetInfo)): - raise Exception("Expected target_info_ to be a MigrationTargetInfo, received: {}".format(type(target_info_))) + if result_ is not None and not isinstance(result_, (dict, Filesystem)): + raise Exception("Expected result_ to be a Filesystem, received: {}".format(type(result_))) - self.model_tag = model_tag_ - self.target_info = target_info_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class MigrationTargetInfo(Type): - _toSchema = {'addrs': 'addrs', 'auth_tag': 'auth-tag', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'macaroons': 'macaroons', 'password': 'password'} - _toPy = {'addrs': 'addrs', 'auth-tag': 'auth_tag', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'macaroons': 'macaroons', 'password': 'password'} - def __init__(self, addrs=None, auth_tag=None, ca_cert=None, controller_alias=None, controller_tag=None, macaroons=None, password=None, **unknown_fields): +class FilesystemResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - addrs : typing.Sequence[str] - auth_tag : str - ca_cert : str - controller_alias : str - controller_tag : str - macaroons : str - password : str + results : typing.Sequence[~FilesystemResult] ''' - addrs_ = addrs - auth_tag_ = auth_tag - ca_cert_ = ca_cert - controller_alias_ = controller_alias - controller_tag_ = controller_tag - macaroons_ = macaroons - password_ = password + results_ = [FilesystemResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): - raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) - - if auth_tag_ is not None and not isinstance(auth_tag_, (bytes, str)): - raise Exception("Expected auth_tag_ to be a str, received: {}".format(type(auth_tag_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): - raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + self.results = results_ + self.unknown_fields = unknown_fields - if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): - raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) - if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): - raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) - if macaroons_ is not None and not isinstance(macaroons_, (bytes, str)): - raise Exception("Expected macaroons_ to be a str, received: {}".format(type(macaroons_))) +class Filesystems(Type): + _toSchema = {'filesystems': 'filesystems'} + _toPy = {'filesystems': 'filesystems'} + def __init__(self, filesystems=None, **unknown_fields): + ''' + filesystems : typing.Sequence[~Filesystem] + ''' + filesystems_ = [Filesystem.from_json(o) for o in filesystems or []] - if password_ is not None and not isinstance(password_, (bytes, str)): - raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + # Validate arguments against known Juju API types. + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) - self.addrs = addrs_ - self.auth_tag = auth_tag_ - self.ca_cert = ca_cert_ - self.controller_alias = controller_alias_ - self.controller_tag = controller_tag_ - self.macaroons = macaroons_ - self.password = password_ + self.filesystems = filesystems_ self.unknown_fields = unknown_fields -class Model(Type): - _toSchema = {'name': 'name', 'owner_tag': 'owner-tag', 'type_': 'type', 'uuid': 'uuid'} - _toPy = {'name': 'name', 'owner-tag': 'owner_tag', 'type': 'type_', 'uuid': 'uuid'} - def __init__(self, name=None, owner_tag=None, type_=None, uuid=None, **unknown_fields): +class FindToolsParams(Type): + _toSchema = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'number': 'number', 'os_type': 'os-type'} + _toPy = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'number': 'number', 'os-type': 'os_type'} + def __init__(self, agentstream=None, arch=None, major=None, number=None, os_type=None, **unknown_fields): ''' - name : str - owner_tag : str - type_ : str - uuid : str + agentstream : str + arch : str + major : int + number : Number + os_type : str ''' - name_ = name - owner_tag_ = owner_tag - type__ = type_ - uuid_ = uuid + agentstream_ = agentstream + arch_ = arch + major_ = major + number_ = Number.from_json(number) if number else None + os_type_ = os_type # Validate arguments against known Juju API types. - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if agentstream_ is not None and not isinstance(agentstream_, (bytes, str)): + raise Exception("Expected agentstream_ to be a str, received: {}".format(type(agentstream_))) - 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 arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if major_ is not None and not isinstance(major_, int): + raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) - if uuid_ is not None and not isinstance(uuid_, (bytes, str)): - raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + if number_ is not None and not isinstance(number_, (dict, Number)): + raise Exception("Expected number_ to be a Number, received: {}".format(type(number_))) - self.name = name_ - self.owner_tag = owner_tag_ - self.type_ = type__ - self.uuid = uuid_ - self.unknown_fields = unknown_fields - - - -class ModelAccess(Type): - _toSchema = {'access': 'access', 'model': 'model'} - _toPy = {'access': 'access', 'model': 'model'} - def __init__(self, access=None, model=None, **unknown_fields): - ''' - access : str - model : str - ''' - access_ = access - model_ = model - - # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if model_ is not None and not isinstance(model_, (bytes, str)): - raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + if os_type_ is not None and not isinstance(os_type_, (bytes, str)): + raise Exception("Expected os_type_ to be a str, received: {}".format(type(os_type_))) - self.access = access_ - self.model = model_ + self.agentstream = agentstream_ + self.arch = arch_ + self.major = major_ + self.number = number_ + self.os_type = os_type_ self.unknown_fields = unknown_fields -class ModelApplicationInfo(Type): - _toSchema = {'name': 'name'} - _toPy = {'name': 'name'} - def __init__(self, name=None, **unknown_fields): +class FindToolsResult(Type): + _toSchema = {'error': 'error', 'list_': 'list'} + _toPy = {'error': 'error', 'list': 'list_'} + def __init__(self, error=None, list_=None, **unknown_fields): ''' - name : str + error : Error + list_ : typing.Sequence[~Tools] ''' - name_ = name + error_ = Error.from_json(error) if error else None + list__ = [Tools.from_json(o) for o in list_ or []] # Validate arguments against known Juju API types. - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.name = name_ + if list__ is not None and not isinstance(list__, (bytes, str, list)): + raise Exception("Expected list__ to be a Sequence, received: {}".format(type(list__))) + + self.error = error_ + self.list_ = list__ self.unknown_fields = unknown_fields -class ModelBlockInfo(Type): - _toSchema = {'blocks': 'blocks', 'model_uuid': 'model-uuid', 'name': 'name', 'owner_tag': 'owner-tag'} - _toPy = {'blocks': 'blocks', 'model-uuid': 'model_uuid', 'name': 'name', 'owner-tag': 'owner_tag'} - def __init__(self, blocks=None, model_uuid=None, name=None, owner_tag=None, **unknown_fields): +class FirewallRule(Type): + _toSchema = {'known_service': 'known-service', 'whitelist_cidrs': 'whitelist-cidrs'} + _toPy = {'known-service': 'known_service', 'whitelist-cidrs': 'whitelist_cidrs'} + def __init__(self, known_service=None, whitelist_cidrs=None, **unknown_fields): ''' - blocks : typing.Sequence[str] - model_uuid : str - name : str - owner_tag : str + known_service : str + whitelist_cidrs : typing.Sequence[str] ''' - blocks_ = blocks - model_uuid_ = model_uuid - name_ = name - owner_tag_ = owner_tag + known_service_ = known_service + whitelist_cidrs_ = whitelist_cidrs # Validate arguments against known Juju API types. - if blocks_ is not None and not isinstance(blocks_, (bytes, str, list)): - raise Exception("Expected blocks_ to be a Sequence, received: {}".format(type(blocks_))) - - if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): - raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if known_service_ is not None and not isinstance(known_service_, (bytes, str)): + raise Exception("Expected known_service_ to be a str, received: {}".format(type(known_service_))) - if 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 whitelist_cidrs_ is not None and not isinstance(whitelist_cidrs_, (bytes, str, list)): + raise Exception("Expected whitelist_cidrs_ to be a Sequence, received: {}".format(type(whitelist_cidrs_))) - self.blocks = blocks_ - self.model_uuid = model_uuid_ - self.name = name_ - self.owner_tag = owner_tag_ + self.known_service = known_service_ + self.whitelist_cidrs = whitelist_cidrs_ self.unknown_fields = unknown_fields -class ModelBlockInfoList(Type): - _toSchema = {'models': 'models'} - _toPy = {'models': 'models'} - def __init__(self, models=None, **unknown_fields): +class FirewallRuleArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - models : typing.Sequence[~ModelBlockInfo] + args : typing.Sequence[~FirewallRule] ''' - models_ = [ModelBlockInfo.from_json(o) for o in models or []] + args_ = [FirewallRule.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if models_ is not None and not isinstance(models_, (bytes, str, list)): - raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.models = models_ + self.args = args_ self.unknown_fields = unknown_fields -class ModelConfigResults(Type): - _toSchema = {'config': 'config'} - _toPy = {'config': 'config'} - def __init__(self, config=None, **unknown_fields): +class FullStatus(Type): + _toSchema = {'applications': 'applications', 'branches': 'branches', 'controller_timestamp': 'controller-timestamp', 'filesystems': 'filesystems', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote_applications': 'remote-applications', 'storage': 'storage', 'volumes': 'volumes'} + _toPy = {'applications': 'applications', 'branches': 'branches', 'controller-timestamp': 'controller_timestamp', 'filesystems': 'filesystems', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote-applications': 'remote_applications', 'storage': 'storage', 'volumes': 'volumes'} + def __init__(self, applications=None, branches=None, controller_timestamp=None, filesystems=None, machines=None, model=None, offers=None, relations=None, remote_applications=None, storage=None, volumes=None, **unknown_fields): ''' - config : typing.Mapping[str, ~ConfigValue] + applications : typing.Mapping[str, ~ApplicationStatus] + branches : typing.Mapping[str, ~BranchStatus] + controller_timestamp : str + filesystems : typing.Sequence[~FilesystemDetails] + machines : typing.Mapping[str, ~MachineStatus] + model : ModelStatusInfo + offers : typing.Mapping[str, ~ApplicationOfferStatus] + relations : typing.Sequence[~RelationStatus] + remote_applications : typing.Mapping[str, ~RemoteApplicationStatus] + storage : typing.Sequence[~StorageDetails] + volumes : typing.Sequence[~VolumeDetails] ''' - config_ = {k: ConfigValue.from_json(v) for k, v in (config or dict()).items()} + applications_ = {k: ApplicationStatus.from_json(v) for k, v in (applications or dict()).items()} + branches_ = {k: BranchStatus.from_json(v) for k, v in (branches or dict()).items()} + controller_timestamp_ = controller_timestamp + filesystems_ = [FilesystemDetails.from_json(o) for o in filesystems or []] + machines_ = {k: MachineStatus.from_json(v) for k, v in (machines or dict()).items()} + model_ = ModelStatusInfo.from_json(model) if model else None + offers_ = {k: ApplicationOfferStatus.from_json(v) for k, v in (offers or dict()).items()} + relations_ = [RelationStatus.from_json(o) for o in relations or []] + remote_applications_ = {k: RemoteApplicationStatus.from_json(v) for k, v in (remote_applications or dict()).items()} + storage_ = [StorageDetails.from_json(o) for o in storage or []] + volumes_ = [VolumeDetails.from_json(o) for o in volumes or []] # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if applications_ is not None and not isinstance(applications_, dict): + raise Exception("Expected applications_ to be a Mapping, received: {}".format(type(applications_))) - self.config = config_ - self.unknown_fields = unknown_fields + if branches_ is not None and not isinstance(branches_, dict): + raise Exception("Expected branches_ to be a Mapping, received: {}".format(type(branches_))) + if controller_timestamp_ is not None and not isinstance(controller_timestamp_, (bytes, str)): + raise Exception("Expected controller_timestamp_ to be a str, received: {}".format(type(controller_timestamp_))) + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) -class ModelCreateArgs(Type): - _toSchema = {'cloud_tag': 'cloud-tag', 'config': 'config', 'credential': 'credential', 'name': 'name', 'owner_tag': 'owner-tag', 'region': 'region'} - _toPy = {'cloud-tag': 'cloud_tag', 'config': 'config', 'credential': 'credential', 'name': 'name', 'owner-tag': 'owner_tag', 'region': 'region'} - def __init__(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None, **unknown_fields): - ''' - cloud_tag : str - config : typing.Mapping[str, typing.Any] - credential : str - name : str - owner_tag : str - region : str - ''' - cloud_tag_ = cloud_tag - config_ = config - credential_ = credential - name_ = name - owner_tag_ = owner_tag - region_ = region + if machines_ is not None and not isinstance(machines_, dict): + raise Exception("Expected machines_ to be a Mapping, received: {}".format(type(machines_))) - # Validate arguments against known Juju API types. - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if model_ is not None and not isinstance(model_, (dict, ModelStatusInfo)): + raise Exception("Expected model_ to be a ModelStatusInfo, received: {}".format(type(model_))) - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if offers_ is not None and not isinstance(offers_, dict): + raise Exception("Expected offers_ to be a Mapping, received: {}".format(type(offers_))) - if credential_ is not None and not isinstance(credential_, (bytes, str)): - raise Exception("Expected credential_ to be a str, received: {}".format(type(credential_))) + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if remote_applications_ is not None and not isinstance(remote_applications_, dict): + raise Exception("Expected remote_applications_ to be a Mapping, received: {}".format(type(remote_applications_))) - if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): - raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + if storage_ is not None and not isinstance(storage_, (bytes, str, list)): + raise Exception("Expected storage_ to be a Sequence, received: {}".format(type(storage_))) - if region_ is not None and not isinstance(region_, (bytes, str)): - raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) - self.cloud_tag = cloud_tag_ - self.config = config_ - self.credential = credential_ - self.name = name_ - self.owner_tag = owner_tag_ - self.region = region_ + self.applications = applications_ + self.branches = branches_ + self.controller_timestamp = controller_timestamp_ + self.filesystems = filesystems_ + self.machines = machines_ + self.model = model_ + self.offers = offers_ + self.relations = relations_ + self.remote_applications = remote_applications_ + self.storage = storage_ + self.volumes = volumes_ self.unknown_fields = unknown_fields -class ModelDefaultValues(Type): - _toSchema = {'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'config': 'config'} - _toPy = {'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'config': 'config'} - def __init__(self, cloud_region=None, cloud_tag=None, config=None, **unknown_fields): +class Generation(Type): + _toSchema = {'applications': 'applications', 'branch': 'branch', 'completed': 'completed', 'completed_by': 'completed-by', 'created': 'created', 'created_by': 'created-by', 'generation_id': 'generation-id'} + _toPy = {'applications': 'applications', 'branch': 'branch', 'completed': 'completed', 'completed-by': 'completed_by', 'created': 'created', 'created-by': 'created_by', 'generation-id': 'generation_id'} + def __init__(self, applications=None, branch=None, completed=None, completed_by=None, created=None, created_by=None, generation_id=None, **unknown_fields): ''' - cloud_region : str - cloud_tag : str - config : typing.Mapping[str, typing.Any] + applications : typing.Sequence[~GenerationApplication] + branch : str + completed : int + completed_by : str + created : int + created_by : str + generation_id : int ''' - cloud_region_ = cloud_region - cloud_tag_ = cloud_tag - config_ = config + applications_ = [GenerationApplication.from_json(o) for o in applications or []] + branch_ = branch + completed_ = completed + completed_by_ = completed_by + created_ = created + created_by_ = created_by + generation_id_ = generation_id # Validate arguments against known Juju API types. - if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): - raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if branch_ is not None and not isinstance(branch_, (bytes, str)): + raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) - if config_ is not None and not isinstance(config_, dict): + if completed_ is not None and not isinstance(completed_, int): + raise Exception("Expected completed_ to be a int, received: {}".format(type(completed_))) + + if completed_by_ is not None and not isinstance(completed_by_, (bytes, str)): + raise Exception("Expected completed_by_ to be a str, received: {}".format(type(completed_by_))) + + if created_ is not None and not isinstance(created_, int): + raise Exception("Expected created_ to be a int, received: {}".format(type(created_))) + + if created_by_ is not None and not isinstance(created_by_, (bytes, str)): + raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) + + if generation_id_ is not None and not isinstance(generation_id_, int): + raise Exception("Expected generation_id_ to be a int, received: {}".format(type(generation_id_))) + + self.applications = applications_ + self.branch = branch_ + self.completed = completed_ + self.completed_by = completed_by_ + self.created = created_ + self.created_by = created_by_ + self.generation_id = generation_id_ + self.unknown_fields = unknown_fields + + + +class GenerationApplication(Type): + _toSchema = {'application': 'application', 'config': 'config', 'pending': 'pending', 'progress': 'progress', 'tracking': 'tracking'} + _toPy = {'application': 'application', 'config': 'config', 'pending': 'pending', 'progress': 'progress', 'tracking': 'tracking'} + def __init__(self, application=None, config=None, pending=None, progress=None, tracking=None, **unknown_fields): + ''' + application : str + config : typing.Mapping[str, typing.Any] + pending : typing.Sequence[str] + progress : str + tracking : typing.Sequence[str] + ''' + application_ = application + config_ = config + pending_ = pending + progress_ = progress + tracking_ = tracking + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if config_ is not None and not isinstance(config_, dict): raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - self.cloud_region = cloud_region_ - self.cloud_tag = cloud_tag_ + if pending_ is not None and not isinstance(pending_, (bytes, str, list)): + raise Exception("Expected pending_ to be a Sequence, received: {}".format(type(pending_))) + + if progress_ is not None and not isinstance(progress_, (bytes, str)): + raise Exception("Expected progress_ to be a str, received: {}".format(type(progress_))) + + if tracking_ is not None and not isinstance(tracking_, (bytes, str, list)): + raise Exception("Expected tracking_ to be a Sequence, received: {}".format(type(tracking_))) + + self.application = application_ self.config = config_ + self.pending = pending_ + self.progress = progress_ + self.tracking = tracking_ self.unknown_fields = unknown_fields -class ModelDefaults(Type): - _toSchema = {'controller': 'controller', 'default': 'default', 'regions': 'regions'} - _toPy = {'controller': 'controller', 'default': 'default', 'regions': 'regions'} - def __init__(self, controller=None, default=None, regions=None, **unknown_fields): +class GenerationId(Type): + _toSchema = {'generation_id': 'generation-id'} + _toPy = {'generation-id': 'generation_id'} + def __init__(self, generation_id=None, **unknown_fields): ''' - controller : Any - default : Any - regions : typing.Sequence[~RegionDefaults] + generation_id : int ''' - controller_ = controller - default_ = default - regions_ = [RegionDefaults.from_json(o) for o in regions or []] + generation_id_ = generation_id # Validate arguments against known Juju API types. - if regions_ is not None and not isinstance(regions_, (bytes, str, list)): - raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) + if generation_id_ is not None and not isinstance(generation_id_, int): + raise Exception("Expected generation_id_ to be a int, received: {}".format(type(generation_id_))) - self.controller = controller_ - self.default = default_ - self.regions = regions_ + self.generation_id = generation_id_ self.unknown_fields = unknown_fields -class ModelDefaultsResult(Type): - _toSchema = {'config': 'config', 'error': 'error'} - _toPy = {'config': 'config', 'error': 'error'} - def __init__(self, config=None, error=None, **unknown_fields): +class GenerationResult(Type): + _toSchema = {'error': 'error', 'generation': 'generation'} + _toPy = {'error': 'error', 'generation': 'generation'} + def __init__(self, error=None, generation=None, **unknown_fields): ''' - config : typing.Mapping[str, ~ModelDefaults] error : Error + generation : Generation ''' - config_ = {k: ModelDefaults.from_json(v) for k, v in (config or dict()).items()} error_ = Error.from_json(error) if error else None + generation_ = Generation.from_json(generation) if generation else None # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.config = config_ + if generation_ is not None and not isinstance(generation_, (dict, Generation)): + raise Exception("Expected generation_ to be a Generation, received: {}".format(type(generation_))) + self.error = error_ + self.generation = generation_ self.unknown_fields = unknown_fields -class ModelDefaultsResults(Type): +class GetConstraintsResults(Type): + _toSchema = {'constraints': 'constraints'} + _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): + ''' + constraints : Value + ''' + constraints_ = Value.from_json(constraints) if constraints else None + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + self.constraints = constraints_ + self.unknown_fields = unknown_fields + + + +class GetLeadershipSettingsBulkResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ModelDefaultsResult] + results : typing.Sequence[~GetLeadershipSettingsResult] ''' - results_ = [ModelDefaultsResult.from_json(o) for o in results or []] + results_ = [GetLeadershipSettingsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -9723,997 +10630,11349 @@ def __init__(self, results=None, **unknown_fields): -class ModelEntityCount(Type): - _toSchema = {'count': 'count', 'entity': 'entity'} - _toPy = {'count': 'count', 'entity': 'entity'} - def __init__(self, count=None, entity=None, **unknown_fields): +class GetLeadershipSettingsResult(Type): + _toSchema = {'error': 'error', 'settings': 'settings'} + _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): ''' - count : int - entity : str + error : Error + settings : typing.Mapping[str, str] ''' - count_ = count - entity_ = entity + error_ = Error.from_json(error) if error else None + settings_ = settings # Validate arguments against known Juju API types. - if count_ is not None and not isinstance(count_, int): - raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if entity_ is not None and not isinstance(entity_, (bytes, str)): - raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) - self.count = count_ - self.entity = entity_ + self.error = error_ + self.settings = settings_ self.unknown_fields = unknown_fields -class ModelFilesystemInfo(Type): - _toSchema = {'detachable': 'detachable', 'id_': 'id', 'message': 'message', 'provider_id': 'provider-id', 'status': 'status'} - _toPy = {'detachable': 'detachable', 'id': 'id_', 'message': 'message', 'provider-id': 'provider_id', 'status': 'status'} - def __init__(self, detachable=None, id_=None, message=None, provider_id=None, status=None, **unknown_fields): +class GetRemoteSecretAccessArg(Type): + _toSchema = {'application_token': 'application-token', 'unit_id': 'unit-id', 'uri': 'uri'} + _toPy = {'application-token': 'application_token', 'unit-id': 'unit_id', 'uri': 'uri'} + def __init__(self, application_token=None, unit_id=None, uri=None, **unknown_fields): ''' - detachable : bool - id_ : str - message : str - provider_id : str - status : str + application_token : str + unit_id : int + uri : str ''' - detachable_ = detachable - id__ = id_ - message_ = message - provider_id_ = provider_id - status_ = status + application_token_ = application_token + unit_id_ = unit_id + uri_ = uri # Validate arguments against known Juju API types. - if detachable_ is not None and not isinstance(detachable_, bool): - raise Exception("Expected detachable_ to be a bool, received: {}".format(type(detachable_))) - - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + if unit_id_ is not None and not isinstance(unit_id_, int): + raise Exception("Expected unit_id_ to be a int, received: {}".format(type(unit_id_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) - self.detachable = detachable_ - self.id_ = id__ - self.message = message_ - self.provider_id = provider_id_ - self.status = status_ + self.application_token = application_token_ + self.unit_id = unit_id_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModelInfo(Type): - _toSchema = {'agent_version': 'agent-version', 'cloud_credential_tag': 'cloud-credential-tag', 'cloud_credential_validity': 'cloud-credential-validity', 'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'controller_uuid': 'controller-uuid', 'default_base': 'default-base', 'default_series': 'default-series', 'is_controller': 'is-controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', 'secret_backends': 'secret-backends', 'sla': 'sla', 'status': 'status', 'supported_features': 'supported-features', 'type_': 'type', 'users': 'users', 'uuid': 'uuid'} - _toPy = {'agent-version': 'agent_version', 'cloud-credential-tag': 'cloud_credential_tag', 'cloud-credential-validity': 'cloud_credential_validity', 'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'controller-uuid': 'controller_uuid', 'default-base': 'default_base', 'default-series': 'default_series', 'is-controller': 'is_controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', 'secret-backends': 'secret_backends', 'sla': 'sla', 'status': 'status', 'supported-features': 'supported_features', 'type': 'type_', 'users': 'users', 'uuid': 'uuid'} - def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_credential_validity=None, cloud_region=None, cloud_tag=None, controller_uuid=None, default_base=None, default_series=None, is_controller=None, life=None, machines=None, migration=None, name=None, owner_tag=None, provider_type=None, secret_backends=None, sla=None, status=None, supported_features=None, type_=None, users=None, uuid=None, **unknown_fields): +class GetRemoteSecretAccessArgs(Type): + _toSchema = {'relations': 'relations'} + _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): ''' - agent_version : Number - cloud_credential_tag : str - cloud_credential_validity : bool - cloud_region : str - cloud_tag : str - controller_uuid : str - default_base : str - default_series : str - is_controller : bool - life : str - machines : typing.Sequence[~ModelMachineInfo] - migration : ModelMigrationStatus - name : str - owner_tag : str - provider_type : str - secret_backends : typing.Sequence[~SecretBackendResult] - sla : ModelSLAInfo - status : EntityStatus - supported_features : typing.Sequence[~SupportedFeature] - type_ : str - users : typing.Sequence[~ModelUserInfo] - uuid : str + relations : typing.Sequence[~GetRemoteSecretAccessArg] ''' - agent_version_ = Number.from_json(agent_version) if agent_version else None - cloud_credential_tag_ = cloud_credential_tag - cloud_credential_validity_ = cloud_credential_validity - cloud_region_ = cloud_region - cloud_tag_ = cloud_tag - controller_uuid_ = controller_uuid - default_base_ = default_base - default_series_ = default_series - is_controller_ = is_controller - life_ = life - machines_ = [ModelMachineInfo.from_json(o) for o in machines or []] - migration_ = ModelMigrationStatus.from_json(migration) if migration else None - name_ = name - owner_tag_ = owner_tag - provider_type_ = provider_type - secret_backends_ = [SecretBackendResult.from_json(o) for o in secret_backends or []] - sla_ = ModelSLAInfo.from_json(sla) if sla else None - status_ = EntityStatus.from_json(status) if status else None - supported_features_ = [SupportedFeature.from_json(o) for o in supported_features or []] - type__ = type_ - users_ = [ModelUserInfo.from_json(o) for o in users or []] - uuid_ = uuid + relations_ = [GetRemoteSecretAccessArg.from_json(o) for o in relations or []] # Validate arguments against known Juju API types. - if agent_version_ is not None and not isinstance(agent_version_, (dict, Number)): - raise Exception("Expected agent_version_ to be a Number, received: {}".format(type(agent_version_))) + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) - if cloud_credential_tag_ is not None and not isinstance(cloud_credential_tag_, (bytes, str)): - raise Exception("Expected cloud_credential_tag_ to be a str, received: {}".format(type(cloud_credential_tag_))) + self.relations = relations_ + self.unknown_fields = unknown_fields - if cloud_credential_validity_ is not None and not isinstance(cloud_credential_validity_, bool): - raise Exception("Expected cloud_credential_validity_ to be a bool, received: {}".format(type(cloud_credential_validity_))) - if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): - raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) +class GetRemoteSecretContentArg(Type): + _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'source_controller_uuid': 'source-controller-uuid', 'unit_id': 'unit-id', 'uri': 'uri'} + _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'source-controller-uuid': 'source_controller_uuid', 'unit-id': 'unit_id', 'uri': 'uri'} + def __init__(self, application_token=None, bakery_version=None, macaroons=None, peek=None, refresh=None, revision=None, source_controller_uuid=None, unit_id=None, uri=None, **unknown_fields): + ''' + application_token : str + bakery_version : int + macaroons : typing.Sequence[~Macaroon] + peek : bool + refresh : bool + revision : int + source_controller_uuid : str + unit_id : int + uri : str + ''' + application_token_ = application_token + bakery_version_ = bakery_version + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + peek_ = peek + refresh_ = refresh + revision_ = revision + source_controller_uuid_ = source_controller_uuid + unit_id_ = unit_id + uri_ = uri - if controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): - raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) - - if default_base_ is not None and not isinstance(default_base_, (bytes, str)): - raise Exception("Expected default_base_ to be a str, received: {}".format(type(default_base_))) - - if default_series_ is not None and not isinstance(default_series_, (bytes, str)): - raise Exception("Expected default_series_ to be a str, received: {}".format(type(default_series_))) - - if is_controller_ is not None and not isinstance(is_controller_, bool): - raise Exception("Expected is_controller_ to be a bool, received: {}".format(type(is_controller_))) + # Validate arguments against known Juju API types. + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) - if machines_ is not None and not isinstance(machines_, (bytes, str, list)): - raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) - if migration_ is not None and not isinstance(migration_, (dict, ModelMigrationStatus)): - raise Exception("Expected migration_ to be a ModelMigrationStatus, received: {}".format(type(migration_))) + if peek_ is not None and not isinstance(peek_, bool): + raise Exception("Expected peek_ to be a bool, received: {}".format(type(peek_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if refresh_ is not None and not isinstance(refresh_, bool): + raise Exception("Expected refresh_ to be a bool, received: {}".format(type(refresh_))) - 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 revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - if provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): - raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) + if source_controller_uuid_ is not None and not isinstance(source_controller_uuid_, (bytes, str)): + raise Exception("Expected source_controller_uuid_ to be a str, received: {}".format(type(source_controller_uuid_))) - if secret_backends_ is not None and not isinstance(secret_backends_, (bytes, str, list)): - raise Exception("Expected secret_backends_ to be a Sequence, received: {}".format(type(secret_backends_))) + if unit_id_ is not None and not isinstance(unit_id_, int): + raise Exception("Expected unit_id_ to be a int, received: {}".format(type(unit_id_))) - if sla_ is not None and not isinstance(sla_, (dict, ModelSLAInfo)): - raise Exception("Expected sla_ to be a ModelSLAInfo, received: {}".format(type(sla_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) - if status_ is not None and not isinstance(status_, (dict, EntityStatus)): - raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.macaroons = macaroons_ + self.peek = peek_ + self.refresh = refresh_ + self.revision = revision_ + self.source_controller_uuid = source_controller_uuid_ + self.unit_id = unit_id_ + self.uri = uri_ + self.unknown_fields = unknown_fields - if supported_features_ is not None and not isinstance(supported_features_, (bytes, str, list)): - raise Exception("Expected supported_features_ to be a Sequence, received: {}".format(type(supported_features_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - if users_ is not None and not isinstance(users_, (bytes, str, list)): - raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) +class GetRemoteSecretContentArgs(Type): + _toSchema = {'relations': 'relations'} + _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): + ''' + relations : typing.Sequence[~GetRemoteSecretContentArg] + ''' + relations_ = [GetRemoteSecretContentArg.from_json(o) for o in relations or []] - if uuid_ is not None and not isinstance(uuid_, (bytes, str)): - raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + # Validate arguments against known Juju API types. + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) - self.agent_version = agent_version_ - self.cloud_credential_tag = cloud_credential_tag_ - self.cloud_credential_validity = cloud_credential_validity_ - self.cloud_region = cloud_region_ - self.cloud_tag = cloud_tag_ - self.controller_uuid = controller_uuid_ - self.default_base = default_base_ - self.default_series = default_series_ - self.is_controller = is_controller_ - self.life = life_ - self.machines = machines_ - self.migration = migration_ - self.name = name_ - self.owner_tag = owner_tag_ - self.provider_type = provider_type_ - self.secret_backends = secret_backends_ - self.sla = sla_ - self.status = status_ - self.supported_features = supported_features_ - self.type_ = type__ - self.users = users_ - self.uuid = uuid_ + self.relations = relations_ self.unknown_fields = unknown_fields -class ModelInfoResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class GetSecretConsumerInfoArgs(Type): + _toSchema = {'consumer_tag': 'consumer-tag', 'uris': 'uris'} + _toPy = {'consumer-tag': 'consumer_tag', 'uris': 'uris'} + def __init__(self, consumer_tag=None, uris=None, **unknown_fields): ''' - error : Error - result : ModelInfo + consumer_tag : str + uris : typing.Sequence[str] ''' - error_ = Error.from_json(error) if error else None - result_ = ModelInfo.from_json(result) if result else None + consumer_tag_ = consumer_tag + uris_ = uris # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if 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 result_ is not None and not isinstance(result_, (dict, ModelInfo)): - raise Exception("Expected result_ to be a ModelInfo, received: {}".format(type(result_))) + if uris_ is not None and not isinstance(uris_, (bytes, str, list)): + raise Exception("Expected uris_ to be a Sequence, received: {}".format(type(uris_))) - self.error = error_ - self.result = result_ + self.consumer_tag = consumer_tag_ + self.uris = uris_ self.unknown_fields = unknown_fields -class ModelInfoResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class GetSecretContentArg(Type): + _toSchema = {'label': 'label', 'peek': 'peek', 'refresh': 'refresh', 'uri': 'uri'} + _toPy = {'label': 'label', 'peek': 'peek', 'refresh': 'refresh', 'uri': 'uri'} + def __init__(self, label=None, peek=None, refresh=None, uri=None, **unknown_fields): ''' - results : typing.Sequence[~ModelInfoResult] + label : str + peek : bool + refresh : bool + uri : str ''' - results_ = [ModelInfoResult.from_json(o) for o in results or []] + label_ = label + peek_ = peek + refresh_ = refresh + uri_ = uri # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - self.results = results_ + if peek_ is not None and not isinstance(peek_, bool): + raise Exception("Expected peek_ to be a bool, received: {}".format(type(peek_))) + + if refresh_ is not None and not isinstance(refresh_, bool): + raise Exception("Expected refresh_ to be a bool, received: {}".format(type(refresh_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.label = label_ + self.peek = peek_ + self.refresh = refresh_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModelInstanceTypesConstraint(Type): - _toSchema = {'value': 'value'} - _toPy = {'value': 'value'} - def __init__(self, value=None, **unknown_fields): +class GetSecretContentArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - value : Value + args : typing.Sequence[~GetSecretContentArg] ''' - value_ = Value.from_json(value) if value else None + args_ = [GetSecretContentArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if value_ is not None and not isinstance(value_, (dict, Value)): - raise Exception("Expected value_ to be a Value, received: {}".format(type(value_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.value = value_ + self.args = args_ self.unknown_fields = unknown_fields -class ModelInstanceTypesConstraints(Type): - _toSchema = {'constraints': 'constraints'} - _toPy = {'constraints': 'constraints'} - def __init__(self, constraints=None, **unknown_fields): +class GetTokenArg(Type): + _toSchema = {'tag': 'tag'} + _toPy = {'tag': 'tag'} + def __init__(self, tag=None, **unknown_fields): ''' - constraints : typing.Sequence[~ModelInstanceTypesConstraint] + tag : str ''' - constraints_ = [ModelInstanceTypesConstraint.from_json(o) for o in constraints or []] + tag_ = tag # Validate arguments against known Juju API types. - if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): - raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - self.constraints = constraints_ + self.tag = tag_ self.unknown_fields = unknown_fields -class ModelMachineInfo(Type): - _toSchema = {'display_name': 'display-name', 'ha_primary': 'ha-primary', 'hardware': 'hardware', 'has_vote': 'has-vote', 'id_': 'id', 'instance_id': 'instance-id', 'message': 'message', 'status': 'status', 'wants_vote': 'wants-vote'} - _toPy = {'display-name': 'display_name', 'ha-primary': 'ha_primary', 'hardware': 'hardware', 'has-vote': 'has_vote', 'id': 'id_', 'instance-id': 'instance_id', 'message': 'message', 'status': 'status', 'wants-vote': 'wants_vote'} - def __init__(self, display_name=None, ha_primary=None, hardware=None, has_vote=None, id_=None, instance_id=None, message=None, status=None, wants_vote=None, **unknown_fields): +class GetTokenArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - display_name : str - ha_primary : bool - hardware : MachineHardware - has_vote : bool - id_ : str - instance_id : str - message : str - status : str - wants_vote : bool + args : typing.Sequence[~GetTokenArg] ''' - display_name_ = display_name - ha_primary_ = ha_primary - hardware_ = MachineHardware.from_json(hardware) if hardware else None - has_vote_ = has_vote - id__ = id_ - instance_id_ = instance_id - message_ = message - status_ = status - wants_vote_ = wants_vote + args_ = [GetTokenArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if display_name_ is not None and not isinstance(display_name_, (bytes, str)): - raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) - - if ha_primary_ is not None and not isinstance(ha_primary_, bool): - raise Exception("Expected ha_primary_ to be a bool, received: {}".format(type(ha_primary_))) - - if hardware_ is not None and not isinstance(hardware_, (dict, MachineHardware)): - raise Exception("Expected hardware_ to be a MachineHardware, received: {}".format(type(hardware_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - if has_vote_ is not None and not isinstance(has_vote_, bool): - raise Exception("Expected has_vote_ to be a bool, received: {}".format(type(has_vote_))) + self.args = args_ + self.unknown_fields = unknown_fields - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): - raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) +class GoalState(Type): + _toSchema = {'relations': 'relations', 'units': 'units'} + _toPy = {'relations': 'relations', 'units': 'units'} + def __init__(self, relations=None, units=None, **unknown_fields): + ''' + relations : typing.Mapping[str, typing.Any] + units : typing.Mapping[str, ~GoalStateStatus] + ''' + relations_ = relations + units_ = {k: GoalStateStatus.from_json(v) for k, v in (units or dict()).items()} - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + # Validate arguments against known Juju API types. + if relations_ is not None and not isinstance(relations_, dict): + raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) - if wants_vote_ is not None and not isinstance(wants_vote_, bool): - raise Exception("Expected wants_vote_ to be a bool, received: {}".format(type(wants_vote_))) + if units_ is not None and not isinstance(units_, dict): + raise Exception("Expected units_ to be a Mapping, received: {}".format(type(units_))) - self.display_name = display_name_ - self.ha_primary = ha_primary_ - self.hardware = hardware_ - self.has_vote = has_vote_ - self.id_ = id__ - self.instance_id = instance_id_ - self.message = message_ - self.status = status_ - self.wants_vote = wants_vote_ + self.relations = relations_ + self.units = units_ self.unknown_fields = unknown_fields -class ModelMigrationStatus(Type): - _toSchema = {'end': 'end', 'start': 'start', 'status': 'status'} - _toPy = {'end': 'end', 'start': 'start', 'status': 'status'} - def __init__(self, end=None, start=None, status=None, **unknown_fields): +class GoalStateResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - end : str - start : str - status : str + error : Error + result : GoalState ''' - end_ = end - start_ = start - status_ = status + error_ = Error.from_json(error) if error else None + result_ = GoalState.from_json(result) if result else None # Validate arguments against known Juju API types. - if end_ is not None and not isinstance(end_, (bytes, str)): - raise Exception("Expected end_ to be a str, received: {}".format(type(end_))) - - if start_ is not None and not isinstance(start_, (bytes, str)): - raise Exception("Expected start_ to be a str, received: {}".format(type(start_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if result_ is not None and not isinstance(result_, (dict, GoalState)): + raise Exception("Expected result_ to be a GoalState, received: {}".format(type(result_))) - self.end = end_ - self.start = start_ - self.status = status_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class ModelParam(Type): - _toSchema = {'model_tag': 'model-tag'} - _toPy = {'model-tag': 'model_tag'} - def __init__(self, model_tag=None, **unknown_fields): +class GoalStateResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - model_tag : str + results : typing.Sequence[~GoalStateResult] ''' - model_tag_ = model_tag + results_ = [GoalStateResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.model_tag = model_tag_ + self.results = results_ self.unknown_fields = unknown_fields -class ModelSLA(Type): - _toSchema = {'creds': 'creds', 'level': 'level', 'modelslainfo': 'ModelSLAInfo', 'owner': 'owner'} - _toPy = {'ModelSLAInfo': 'modelslainfo', 'creds': 'creds', 'level': 'level', 'owner': 'owner'} - def __init__(self, modelslainfo=None, creds=None, level=None, owner=None, **unknown_fields): +class GoalStateStatus(Type): + _toSchema = {'since': 'since', 'status': 'status'} + _toPy = {'since': 'since', 'status': 'status'} + def __init__(self, since=None, status=None, **unknown_fields): ''' - modelslainfo : ModelSLAInfo - creds : typing.Sequence[int] - level : str - owner : str + since : str + status : str ''' - modelslainfo_ = ModelSLAInfo.from_json(modelslainfo) if modelslainfo else None - creds_ = creds - level_ = level - owner_ = owner + since_ = since + status_ = status # Validate arguments against known Juju API types. - if modelslainfo_ is not None and not isinstance(modelslainfo_, (dict, ModelSLAInfo)): - raise Exception("Expected modelslainfo_ to be a ModelSLAInfo, received: {}".format(type(modelslainfo_))) - - if creds_ is not None and not isinstance(creds_, (bytes, str, list)): - raise Exception("Expected creds_ to be a Sequence, received: {}".format(type(creds_))) - - if level_ is not None and not isinstance(level_, (bytes, str)): - raise Exception("Expected level_ to be a str, received: {}".format(type(level_))) + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) - if owner_ is not None and not isinstance(owner_, (bytes, str)): - raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - self.modelslainfo = modelslainfo_ - self.creds = creds_ - self.level = level_ - self.owner = owner_ + self.since = since_ + self.status = status_ self.unknown_fields = unknown_fields -class ModelSLAInfo(Type): - _toSchema = {'level': 'level', 'owner': 'owner'} - _toPy = {'level': 'level', 'owner': 'owner'} - def __init__(self, level=None, owner=None, **unknown_fields): +class GrantRevokeSecretArg(Type): + _toSchema = {'role': 'role', 'scope_tag': 'scope-tag', 'subject_tags': 'subject-tags', 'uri': 'uri'} + _toPy = {'role': 'role', 'scope-tag': 'scope_tag', 'subject-tags': 'subject_tags', 'uri': 'uri'} + def __init__(self, role=None, scope_tag=None, subject_tags=None, uri=None, **unknown_fields): ''' - level : str - owner : str + role : str + scope_tag : str + subject_tags : typing.Sequence[str] + uri : str ''' - level_ = level - owner_ = owner + role_ = role + scope_tag_ = scope_tag + subject_tags_ = subject_tags + uri_ = uri # Validate arguments against known Juju API types. - if level_ is not None and not isinstance(level_, (bytes, str)): - raise Exception("Expected level_ to be a str, received: {}".format(type(level_))) + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) - if owner_ is not None and not isinstance(owner_, (bytes, str)): - raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + if scope_tag_ is not None and not isinstance(scope_tag_, (bytes, str)): + raise Exception("Expected scope_tag_ to be a str, received: {}".format(type(scope_tag_))) - self.level = level_ - self.owner = owner_ + if subject_tags_ is not None and not isinstance(subject_tags_, (bytes, str, list)): + raise Exception("Expected subject_tags_ to be a Sequence, received: {}".format(type(subject_tags_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.role = role_ + self.scope_tag = scope_tag_ + self.subject_tags = subject_tags_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModelSequencesResult(Type): - _toSchema = {'sequences': 'sequences'} - _toPy = {'sequences': 'sequences'} - def __init__(self, sequences=None, **unknown_fields): +class GrantRevokeSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - sequences : typing.Mapping[str, int] + args : typing.Sequence[~GrantRevokeSecretArg] ''' - sequences_ = sequences + args_ = [GrantRevokeSecretArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if sequences_ is not None and not isinstance(sequences_, dict): - raise Exception("Expected sequences_ to be a Mapping, received: {}".format(type(sequences_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.sequences = sequences_ + self.args = args_ self.unknown_fields = unknown_fields -class ModelSet(Type): - _toSchema = {'config': 'config'} - _toPy = {'config': 'config'} - def __init__(self, config=None, **unknown_fields): +class GrantRevokeUserSecretArg(Type): + _toSchema = {'applications': 'applications', 'label': 'label', 'uri': 'uri'} + _toPy = {'applications': 'applications', 'label': 'label', 'uri': 'uri'} + def __init__(self, applications=None, label=None, uri=None, **unknown_fields): ''' - config : typing.Mapping[str, typing.Any] + applications : typing.Sequence[str] + label : str + uri : str ''' - config_ = config + applications_ = applications + label_ = label + uri_ = uri # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - self.config = config_ + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.applications = applications_ + self.label = label_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModelStatus(Type): - _toSchema = {'application_count': 'application-count', 'applications': 'applications', 'error': 'error', 'filesystems': 'filesystems', 'hosted_machine_count': 'hosted-machine-count', 'life': 'life', 'machines': 'machines', 'model_tag': 'model-tag', 'owner_tag': 'owner-tag', 'type_': 'type', 'unit_count': 'unit-count', 'volumes': 'volumes'} - _toPy = {'application-count': 'application_count', 'applications': 'applications', 'error': 'error', 'filesystems': 'filesystems', 'hosted-machine-count': 'hosted_machine_count', 'life': 'life', 'machines': 'machines', 'model-tag': 'model_tag', 'owner-tag': 'owner_tag', 'type': 'type_', 'unit-count': 'unit_count', 'volumes': 'volumes'} - def __init__(self, application_count=None, applications=None, error=None, filesystems=None, hosted_machine_count=None, life=None, machines=None, model_tag=None, owner_tag=None, type_=None, unit_count=None, volumes=None, **unknown_fields): +class HardwareCharacteristics(Type): + _toSchema = {'arch': 'arch', 'availability_zone': 'availability-zone', 'cpu_cores': 'cpu-cores', 'cpu_power': 'cpu-power', 'mem': 'mem', 'root_disk': 'root-disk', 'root_disk_source': 'root-disk-source', 'tags': 'tags', 'virt_type': 'virt-type'} + _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cpu-cores': 'cpu_cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'root-disk-source': 'root_disk_source', 'tags': 'tags', 'virt-type': 'virt_type'} + def __init__(self, arch=None, availability_zone=None, cpu_cores=None, cpu_power=None, mem=None, root_disk=None, root_disk_source=None, tags=None, virt_type=None, **unknown_fields): ''' - application_count : int - applications : typing.Sequence[~ModelApplicationInfo] - error : Error - filesystems : typing.Sequence[~ModelFilesystemInfo] - hosted_machine_count : int - life : str - machines : typing.Sequence[~ModelMachineInfo] - model_tag : str - owner_tag : str - type_ : str - unit_count : int - volumes : typing.Sequence[~ModelVolumeInfo] + arch : str + availability_zone : str + cpu_cores : int + cpu_power : int + mem : int + root_disk : int + root_disk_source : str + tags : typing.Sequence[str] + virt_type : str ''' - application_count_ = application_count - applications_ = [ModelApplicationInfo.from_json(o) for o in applications or []] - error_ = Error.from_json(error) if error else None - filesystems_ = [ModelFilesystemInfo.from_json(o) for o in filesystems or []] - hosted_machine_count_ = hosted_machine_count - life_ = life - machines_ = [ModelMachineInfo.from_json(o) for o in machines or []] - model_tag_ = model_tag - owner_tag_ = owner_tag - type__ = type_ - unit_count_ = unit_count - volumes_ = [ModelVolumeInfo.from_json(o) for o in volumes or []] + arch_ = arch + availability_zone_ = availability_zone + cpu_cores_ = cpu_cores + cpu_power_ = cpu_power + mem_ = mem + root_disk_ = root_disk + root_disk_source_ = root_disk_source + tags_ = tags + virt_type_ = virt_type # Validate arguments against known Juju API types. - if application_count_ is not None and not isinstance(application_count_, int): - raise Exception("Expected application_count_ to be a int, received: {}".format(type(application_count_))) + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if availability_zone_ is not None and not isinstance(availability_zone_, (bytes, str)): + raise Exception("Expected availability_zone_ to be a str, received: {}".format(type(availability_zone_))) - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if cpu_cores_ is not None and not isinstance(cpu_cores_, int): + raise Exception("Expected cpu_cores_ to be a int, received: {}".format(type(cpu_cores_))) - if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): - raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + if cpu_power_ is not None and not isinstance(cpu_power_, int): + raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) - if hosted_machine_count_ is not None and not isinstance(hosted_machine_count_, int): - raise Exception("Expected hosted_machine_count_ to be a int, received: {}".format(type(hosted_machine_count_))) + if mem_ is not None and not isinstance(mem_, int): + raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) - if machines_ is not None and not isinstance(machines_, (bytes, str, list)): - raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + if root_disk_source_ is not None and not isinstance(root_disk_source_, (bytes, str)): + raise Exception("Expected root_disk_source_ to be a str, received: {}".format(type(root_disk_source_))) - if 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 tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) - 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 virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): + raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + self.arch = arch_ + self.availability_zone = availability_zone_ + self.cpu_cores = cpu_cores_ + self.cpu_power = cpu_power_ + self.mem = mem_ + self.root_disk = root_disk_ + self.root_disk_source = root_disk_source_ + self.tags = tags_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields - if unit_count_ is not None and not isinstance(unit_count_, int): - raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) - if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): - raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) - self.application_count = application_count_ - self.applications = applications_ +class History(Type): + _toSchema = {'error': 'error', 'statuses': 'statuses'} + _toPy = {'error': 'error', 'statuses': 'statuses'} + def __init__(self, error=None, statuses=None, **unknown_fields): + ''' + error : Error + statuses : typing.Sequence[~DetailedStatus] + ''' + error_ = Error.from_json(error) if error else None + statuses_ = [DetailedStatus.from_json(o) for o in statuses or []] + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if statuses_ is not None and not isinstance(statuses_, (bytes, str, list)): + raise Exception("Expected statuses_ to be a Sequence, received: {}".format(type(statuses_))) + self.error = error_ - self.filesystems = filesystems_ - self.hosted_machine_count = hosted_machine_count_ - self.life = life_ - self.machines = machines_ - self.model_tag = model_tag_ - self.owner_tag = owner_tag_ - self.type_ = type__ - self.unit_count = unit_count_ - self.volumes = volumes_ + self.statuses = statuses_ self.unknown_fields = unknown_fields -class ModelStatusInfo(Type): - _toSchema = {'available_version': 'available-version', 'cloud_tag': 'cloud-tag', 'meter_status': 'meter-status', 'model_status': 'model-status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type_': 'type', 'version': 'version'} - _toPy = {'available-version': 'available_version', 'cloud-tag': 'cloud_tag', 'meter-status': 'meter_status', 'model-status': 'model_status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type': 'type_', 'version': 'version'} - def __init__(self, available_version=None, cloud_tag=None, meter_status=None, model_status=None, name=None, region=None, sla=None, type_=None, version=None, **unknown_fields): +class HostNetworkChange(Type): + _toSchema = {'error': 'error', 'new_bridges': 'new-bridges', 'reconfigure_delay': 'reconfigure-delay'} + _toPy = {'error': 'error', 'new-bridges': 'new_bridges', 'reconfigure-delay': 'reconfigure_delay'} + def __init__(self, error=None, new_bridges=None, reconfigure_delay=None, **unknown_fields): ''' - available_version : str - cloud_tag : str - meter_status : MeterStatus - model_status : DetailedStatus - name : str - region : str - sla : str + error : Error + new_bridges : typing.Sequence[~DeviceBridgeInfo] + reconfigure_delay : int + ''' + error_ = Error.from_json(error) if error else None + new_bridges_ = [DeviceBridgeInfo.from_json(o) for o in new_bridges or []] + reconfigure_delay_ = reconfigure_delay + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if new_bridges_ is not None and not isinstance(new_bridges_, (bytes, str, list)): + raise Exception("Expected new_bridges_ to be a Sequence, received: {}".format(type(new_bridges_))) + + if reconfigure_delay_ is not None and not isinstance(reconfigure_delay_, int): + raise Exception("Expected reconfigure_delay_ to be a int, received: {}".format(type(reconfigure_delay_))) + + self.error = error_ + self.new_bridges = new_bridges_ + self.reconfigure_delay = reconfigure_delay_ + self.unknown_fields = unknown_fields + + + +class HostNetworkChangeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~HostNetworkChange] + ''' + results_ = [HostNetworkChange.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class HostPort(Type): + _toSchema = {'address': 'Address', 'cidr': 'cidr', 'config_type': 'config-type', 'is_secondary': 'is-secondary', 'port': 'port', 'scope': 'scope', 'space_id': 'space-id', 'space_name': 'space-name', 'type_': 'type', 'value': 'value'} + _toPy = {'Address': 'address', 'cidr': 'cidr', 'config-type': 'config_type', 'is-secondary': 'is_secondary', 'port': 'port', 'scope': 'scope', 'space-id': 'space_id', 'space-name': 'space_name', 'type': 'type_', 'value': 'value'} + def __init__(self, address=None, cidr=None, config_type=None, is_secondary=None, port=None, scope=None, space_id=None, space_name=None, type_=None, value=None, **unknown_fields): + ''' + address : Address + cidr : str + config_type : str + is_secondary : bool + port : int + scope : str + space_id : str + space_name : str type_ : str - version : str + value : str ''' - available_version_ = available_version - cloud_tag_ = cloud_tag - meter_status_ = MeterStatus.from_json(meter_status) if meter_status else None - model_status_ = DetailedStatus.from_json(model_status) if model_status else None + address_ = Address.from_json(address) if address else None + cidr_ = cidr + config_type_ = config_type + is_secondary_ = is_secondary + port_ = port + scope_ = scope + space_id_ = space_id + space_name_ = space_name + type__ = type_ + value_ = value + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (dict, Address)): + raise Exception("Expected address_ to be a Address, received: {}".format(type(address_))) + + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if config_type_ is not None and not isinstance(config_type_, (bytes, str)): + raise Exception("Expected config_type_ to be a str, received: {}".format(type(config_type_))) + + if is_secondary_ is not None and not isinstance(is_secondary_, bool): + raise Exception("Expected is_secondary_ to be a bool, received: {}".format(type(is_secondary_))) + + if port_ is not None and not isinstance(port_, int): + raise Exception("Expected port_ to be a int, received: {}".format(type(port_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + if space_id_ is not None and not isinstance(space_id_, (bytes, str)): + raise Exception("Expected space_id_ to be a str, received: {}".format(type(space_id_))) + + if space_name_ is not None and not isinstance(space_name_, (bytes, str)): + raise Exception("Expected space_name_ to be a str, received: {}".format(type(space_name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.address = address_ + self.cidr = cidr_ + self.config_type = config_type_ + self.is_secondary = is_secondary_ + self.port = port_ + self.scope = scope_ + self.space_id = space_id_ + self.space_name = space_name_ + self.type_ = type__ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class HostedModelConfig(Type): + _toSchema = {'cloud_spec': 'cloud-spec', 'config': 'config', 'error': 'error', 'name': 'name', 'owner': 'owner'} + _toPy = {'cloud-spec': 'cloud_spec', 'config': 'config', 'error': 'error', 'name': 'name', 'owner': 'owner'} + def __init__(self, cloud_spec=None, config=None, error=None, name=None, owner=None, **unknown_fields): + ''' + cloud_spec : CloudSpec + config : typing.Mapping[str, typing.Any] + error : Error + name : str + owner : str + ''' + cloud_spec_ = CloudSpec.from_json(cloud_spec) if cloud_spec else None + config_ = config + error_ = Error.from_json(error) if error else None name_ = name + owner_ = owner + + # Validate arguments against known Juju API types. + if cloud_spec_ is not None and not isinstance(cloud_spec_, (dict, CloudSpec)): + raise Exception("Expected cloud_spec_ to be a CloudSpec, received: {}".format(type(cloud_spec_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_ is not None and not isinstance(owner_, (bytes, str)): + raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + + self.cloud_spec = cloud_spec_ + self.config = config_ + self.error = error_ + self.name = name_ + self.owner = owner_ + self.unknown_fields = unknown_fields + + + +class HostedModelConfigsResults(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~HostedModelConfig] + ''' + models_ = [HostedModelConfig.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = unknown_fields + + + +class ImageMetadataFilter(Type): + _toSchema = {'arches': 'arches', 'region': 'region', 'root_storage_type': 'root-storage-type', 'stream': 'stream', 'versions': 'versions', 'virt_type': 'virt-type'} + _toPy = {'arches': 'arches', 'region': 'region', 'root-storage-type': 'root_storage_type', 'stream': 'stream', 'versions': 'versions', 'virt-type': 'virt_type'} + def __init__(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None, **unknown_fields): + ''' + arches : typing.Sequence[str] + region : str + root_storage_type : str + stream : str + versions : typing.Sequence[str] + virt_type : str + ''' + arches_ = arches region_ = region - sla_ = sla - type__ = type_ - version_ = version + root_storage_type_ = root_storage_type + stream_ = stream + versions_ = versions + virt_type_ = virt_type + + # Validate arguments against known Juju API types. + if arches_ is not None and not isinstance(arches_, (bytes, str, list)): + raise Exception("Expected arches_ to be a Sequence, received: {}".format(type(arches_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if root_storage_type_ is not None and not isinstance(root_storage_type_, (bytes, str)): + raise Exception("Expected root_storage_type_ to be a str, received: {}".format(type(root_storage_type_))) + + if 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_))) + + self.arches = arches_ + self.region = region_ + self.root_storage_type = root_storage_type_ + self.stream = stream_ + self.versions = versions_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields + + + +class ImportStorageDetails(Type): + _toSchema = {'storage_tag': 'storage-tag'} + _toPy = {'storage-tag': 'storage_tag'} + def __init__(self, storage_tag=None, **unknown_fields): + ''' + storage_tag : str + ''' + storage_tag_ = storage_tag + + # Validate arguments against known Juju API types. + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + self.storage_tag = storage_tag_ + self.unknown_fields = unknown_fields + + + +class ImportStorageParams(Type): + _toSchema = {'kind': 'kind', 'pool': 'pool', 'provider_id': 'provider-id', 'storage_name': 'storage-name'} + _toPy = {'kind': 'kind', 'pool': 'pool', 'provider-id': 'provider_id', 'storage-name': 'storage_name'} + def __init__(self, kind=None, pool=None, provider_id=None, storage_name=None, **unknown_fields): + ''' + kind : int + pool : str + provider_id : str + storage_name : str + ''' + kind_ = kind + pool_ = pool + provider_id_ = provider_id + storage_name_ = storage_name + + # Validate arguments against known Juju API types. + if kind_ is not None and not isinstance(kind_, int): + raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if storage_name_ is not None and not isinstance(storage_name_, (bytes, str)): + raise Exception("Expected storage_name_ to be a str, received: {}".format(type(storage_name_))) + + self.kind = kind_ + self.pool = pool_ + self.provider_id = provider_id_ + self.storage_name = storage_name_ + self.unknown_fields = unknown_fields + + + +class ImportStorageResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ImportStorageDetails + ''' + error_ = Error.from_json(error) if error else None + result_ = ImportStorageDetails.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ImportStorageDetails)): + raise Exception("Expected result_ to be a ImportStorageDetails, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ImportStorageResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ImportStorageResult] + ''' + results_ = [ImportStorageResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class IngressNetworksChangeEvent(Type): + _toSchema = {'bakery_version': 'bakery-version', 'ingress_required': 'ingress-required', 'macaroons': 'macaroons', 'networks': 'networks', 'relation_token': 'relation-token'} + _toPy = {'bakery-version': 'bakery_version', 'ingress-required': 'ingress_required', 'macaroons': 'macaroons', 'networks': 'networks', 'relation-token': 'relation_token'} + def __init__(self, bakery_version=None, ingress_required=None, macaroons=None, networks=None, relation_token=None, **unknown_fields): + ''' + bakery_version : int + ingress_required : bool + macaroons : typing.Sequence[~Macaroon] + networks : typing.Sequence[str] + relation_token : str + ''' + bakery_version_ = bakery_version + ingress_required_ = ingress_required + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + networks_ = networks + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if ingress_required_ is not None and not isinstance(ingress_required_, bool): + raise Exception("Expected ingress_required_ to be a bool, received: {}".format(type(ingress_required_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if networks_ is not None and not isinstance(networks_, (bytes, str, list)): + raise Exception("Expected networks_ to be a Sequence, received: {}".format(type(networks_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.bakery_version = bakery_version_ + self.ingress_required = ingress_required_ + self.macaroons = macaroons_ + self.networks = networks_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class IngressNetworksChanges(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~IngressNetworksChangeEvent] + ''' + changes_ = [IngressNetworksChangeEvent.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class IngressRule(Type): + _toSchema = {'port_range': 'port-range', 'source_cidrs': 'source-cidrs'} + _toPy = {'port-range': 'port_range', 'source-cidrs': 'source_cidrs'} + def __init__(self, port_range=None, source_cidrs=None, **unknown_fields): + ''' + port_range : PortRange + source_cidrs : typing.Sequence[str] + ''' + port_range_ = PortRange.from_json(port_range) if port_range else None + source_cidrs_ = source_cidrs + + # Validate arguments against known Juju API types. + if port_range_ is not None and not isinstance(port_range_, (dict, PortRange)): + raise Exception("Expected port_range_ to be a PortRange, received: {}".format(type(port_range_))) + + if source_cidrs_ is not None and not isinstance(source_cidrs_, (bytes, str, list)): + raise Exception("Expected source_cidrs_ to be a Sequence, received: {}".format(type(source_cidrs_))) + + self.port_range = port_range_ + self.source_cidrs = source_cidrs_ + self.unknown_fields = unknown_fields + + + +class IngressRulesResult(Type): + _toSchema = {'error': 'error', 'rules': 'rules'} + _toPy = {'error': 'error', 'rules': 'rules'} + def __init__(self, error=None, rules=None, **unknown_fields): + ''' + error : Error + rules : typing.Sequence[~IngressRule] + ''' + error_ = Error.from_json(error) if error else None + rules_ = [IngressRule.from_json(o) for o in rules or []] + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if rules_ is not None and not isinstance(rules_, (bytes, str, list)): + raise Exception("Expected rules_ to be a Sequence, received: {}".format(type(rules_))) + + self.error = error_ + self.rules = rules_ + self.unknown_fields = unknown_fields + + + +class InitiateMigrationArgs(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Sequence[~MigrationSpec] + ''' + specs_ = [MigrationSpec.from_json(o) for o in specs or []] + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + + self.specs = specs_ + self.unknown_fields = unknown_fields + + + +class InitiateMigrationResult(Type): + _toSchema = {'error': 'error', 'migration_id': 'migration-id', 'model_tag': 'model-tag'} + _toPy = {'error': 'error', 'migration-id': 'migration_id', 'model-tag': 'model_tag'} + def __init__(self, error=None, migration_id=None, model_tag=None, **unknown_fields): + ''' + error : Error + migration_id : str + model_tag : str + ''' + error_ = Error.from_json(error) if error else None + migration_id_ = migration_id + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if migration_id_ is not None and not isinstance(migration_id_, (bytes, str)): + raise Exception("Expected migration_id_ to be a str, received: {}".format(type(migration_id_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + self.error = error_ + self.migration_id = migration_id_ + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + +class InitiateMigrationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~InitiateMigrationResult] + ''' + results_ = [InitiateMigrationResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class InstanceInfo(Type): + _toSchema = {'characteristics': 'characteristics', 'charm_profiles': 'charm-profiles', 'display_name': 'display-name', 'instance_id': 'instance-id', 'network_config': 'network-config', 'nonce': 'nonce', 'tag': 'tag', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} + _toPy = {'characteristics': 'characteristics', 'charm-profiles': 'charm_profiles', 'display-name': 'display_name', 'instance-id': 'instance_id', 'network-config': 'network_config', 'nonce': 'nonce', 'tag': 'tag', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, characteristics=None, charm_profiles=None, display_name=None, instance_id=None, network_config=None, nonce=None, tag=None, volume_attachments=None, volumes=None, **unknown_fields): + ''' + characteristics : HardwareCharacteristics + charm_profiles : typing.Sequence[str] + display_name : str + instance_id : str + network_config : typing.Sequence[~NetworkConfig] + nonce : str + tag : str + volume_attachments : typing.Mapping[str, ~VolumeAttachmentInfo] + volumes : typing.Sequence[~Volume] + ''' + characteristics_ = HardwareCharacteristics.from_json(characteristics) if characteristics else None + charm_profiles_ = charm_profiles + display_name_ = display_name + instance_id_ = instance_id + network_config_ = [NetworkConfig.from_json(o) for o in network_config or []] + nonce_ = nonce + tag_ = tag + volume_attachments_ = {k: VolumeAttachmentInfo.from_json(v) for k, v in (volume_attachments or dict()).items()} + volumes_ = [Volume.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if characteristics_ is not None and not isinstance(characteristics_, (dict, HardwareCharacteristics)): + raise Exception("Expected characteristics_ to be a HardwareCharacteristics, received: {}".format(type(characteristics_))) + + if charm_profiles_ is not None and not isinstance(charm_profiles_, (bytes, str, list)): + raise Exception("Expected charm_profiles_ to be a Sequence, received: {}".format(type(charm_profiles_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if network_config_ is not None and not isinstance(network_config_, (bytes, str, list)): + raise Exception("Expected network_config_ to be a Sequence, received: {}".format(type(network_config_))) + + if nonce_ is not None and not isinstance(nonce_, (bytes, str)): + raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if volume_attachments_ is not None and not isinstance(volume_attachments_, dict): + raise Exception("Expected volume_attachments_ to be a Mapping, received: {}".format(type(volume_attachments_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.characteristics = characteristics_ + self.charm_profiles = charm_profiles_ + self.display_name = display_name_ + self.instance_id = instance_id_ + self.network_config = network_config_ + self.nonce = nonce_ + self.tag = tag_ + self.volume_attachments = volume_attachments_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class InstanceType(Type): + _toSchema = {'arches': 'arches', 'cost': 'cost', 'cpu_cores': 'cpu-cores', 'memory': 'memory', 'name': 'name', 'root_disk': 'root-disk', 'virt_type': 'virt-type'} + _toPy = {'arches': 'arches', 'cost': 'cost', 'cpu-cores': 'cpu_cores', 'memory': 'memory', 'name': 'name', 'root-disk': 'root_disk', 'virt-type': 'virt_type'} + def __init__(self, arches=None, cost=None, cpu_cores=None, memory=None, name=None, root_disk=None, virt_type=None, **unknown_fields): + ''' + arches : typing.Sequence[str] + cost : int + cpu_cores : int + memory : int + name : str + root_disk : int + virt_type : str + ''' + arches_ = arches + cost_ = cost + cpu_cores_ = cpu_cores + memory_ = memory + name_ = name + root_disk_ = root_disk + virt_type_ = virt_type + + # Validate arguments against known Juju API types. + if arches_ is not None and not isinstance(arches_, (bytes, str, list)): + raise Exception("Expected arches_ to be a Sequence, received: {}".format(type(arches_))) + + if cost_ is not None and not isinstance(cost_, int): + raise Exception("Expected cost_ to be a int, received: {}".format(type(cost_))) + + if cpu_cores_ is not None and not isinstance(cpu_cores_, int): + raise Exception("Expected cpu_cores_ to be a int, received: {}".format(type(cpu_cores_))) + + if memory_ is not None and not isinstance(memory_, int): + raise Exception("Expected memory_ to be a int, received: {}".format(type(memory_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + + if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): + raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + + self.arches = arches_ + self.cost = cost_ + self.cpu_cores = cpu_cores_ + self.memory = memory_ + self.name = name_ + self.root_disk = root_disk_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields + + + +class InstanceTypesResult(Type): + _toSchema = {'cost_currency': 'cost-currency', 'cost_divisor': 'cost-divisor', 'cost_unit': 'cost-unit', 'error': 'error', 'instance_types': 'instance-types'} + _toPy = {'cost-currency': 'cost_currency', 'cost-divisor': 'cost_divisor', 'cost-unit': 'cost_unit', 'error': 'error', 'instance-types': 'instance_types'} + def __init__(self, cost_currency=None, cost_divisor=None, cost_unit=None, error=None, instance_types=None, **unknown_fields): + ''' + cost_currency : str + cost_divisor : int + cost_unit : str + error : Error + instance_types : typing.Sequence[~InstanceType] + ''' + cost_currency_ = cost_currency + cost_divisor_ = cost_divisor + cost_unit_ = cost_unit + error_ = Error.from_json(error) if error else None + instance_types_ = [InstanceType.from_json(o) for o in instance_types or []] + + # Validate arguments against known Juju API types. + if cost_currency_ is not None and not isinstance(cost_currency_, (bytes, str)): + raise Exception("Expected cost_currency_ to be a str, received: {}".format(type(cost_currency_))) + + if cost_divisor_ is not None and not isinstance(cost_divisor_, int): + raise Exception("Expected cost_divisor_ to be a int, received: {}".format(type(cost_divisor_))) + + if cost_unit_ is not None and not isinstance(cost_unit_, (bytes, str)): + raise Exception("Expected cost_unit_ to be a str, received: {}".format(type(cost_unit_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if instance_types_ is not None and not isinstance(instance_types_, (bytes, str, list)): + raise Exception("Expected instance_types_ to be a Sequence, received: {}".format(type(instance_types_))) + + self.cost_currency = cost_currency_ + self.cost_divisor = cost_divisor_ + self.cost_unit = cost_unit_ + self.error = error_ + self.instance_types = instance_types_ + self.unknown_fields = unknown_fields + + + +class InstanceTypesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~InstanceTypesResult] + ''' + results_ = [InstanceTypesResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class InstancesInfo(Type): + _toSchema = {'machines': 'machines'} + _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): + ''' + machines : typing.Sequence[~InstanceInfo] + ''' + machines_ = [InstanceInfo.from_json(o) for o in machines or []] + + # Validate arguments against known Juju API types. + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + self.machines = machines_ + self.unknown_fields = unknown_fields + + + +class IntResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : int + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, int): + raise Exception("Expected result_ to be a int, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class IntResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~IntResult] + ''' + results_ = [IntResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class InterfaceAddress(Type): + _toSchema = {'cidr': 'cidr', 'hostname': 'hostname', 'value': 'value'} + _toPy = {'cidr': 'cidr', 'hostname': 'hostname', 'value': 'value'} + def __init__(self, cidr=None, hostname=None, value=None, **unknown_fields): + ''' + cidr : str + hostname : str + value : str + ''' + cidr_ = cidr + hostname_ = hostname + value_ = value + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.cidr = cidr_ + self.hostname = hostname_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class InvalidateCredentialArg(Type): + _toSchema = {'reason': 'reason'} + _toPy = {'reason': 'reason'} + def __init__(self, reason=None, **unknown_fields): + ''' + reason : str + ''' + reason_ = reason + + # Validate arguments against known Juju API types. + if reason_ is not None and not isinstance(reason_, (bytes, str)): + raise Exception("Expected reason_ to be a str, received: {}".format(type(reason_))) + + self.reason = reason_ + self.unknown_fields = unknown_fields + + + +class IsMasterResult(Type): + _toSchema = {'master': 'master'} + _toPy = {'master': 'master'} + def __init__(self, master=None, **unknown_fields): + ''' + master : bool + ''' + master_ = master + + # Validate arguments against known Juju API types. + if master_ is not None and not isinstance(master_, bool): + raise Exception("Expected master_ to be a bool, received: {}".format(type(master_))) + + self.master = master_ + self.unknown_fields = unknown_fields + + + +class IsMeteredResult(Type): + _toSchema = {'metered': 'metered'} + _toPy = {'metered': 'metered'} + def __init__(self, metered=None, **unknown_fields): + ''' + metered : bool + ''' + metered_ = metered + + # Validate arguments against known Juju API types. + if metered_ is not None and not isinstance(metered_, bool): + raise Exception("Expected metered_ to be a bool, received: {}".format(type(metered_))) + + self.metered = metered_ + self.unknown_fields = unknown_fields + + + +class IssueOperatorCertificateResult(Type): + _toSchema = {'ca_cert': 'ca-cert', 'cert': 'cert', 'error': 'error', 'private_key': 'private-key'} + _toPy = {'ca-cert': 'ca_cert', 'cert': 'cert', 'error': 'error', 'private-key': 'private_key'} + def __init__(self, ca_cert=None, cert=None, error=None, private_key=None, **unknown_fields): + ''' + ca_cert : str + cert : str + error : Error + private_key : str + ''' + ca_cert_ = ca_cert + cert_ = cert + error_ = Error.from_json(error) if error else None + private_key_ = private_key + + # Validate arguments against known Juju API types. + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if cert_ is not None and not isinstance(cert_, (bytes, str)): + raise Exception("Expected cert_ to be a str, received: {}".format(type(cert_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if private_key_ is not None and not isinstance(private_key_, (bytes, str)): + raise Exception("Expected private_key_ to be a str, received: {}".format(type(private_key_))) + + self.ca_cert = ca_cert_ + self.cert = cert_ + self.error = error_ + self.private_key = private_key_ + self.unknown_fields = unknown_fields + + + +class IssueOperatorCertificateResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~IssueOperatorCertificateResult] + ''' + results_ = [IssueOperatorCertificateResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class JobsResult(Type): + _toSchema = {'error': 'error', 'jobs': 'jobs'} + _toPy = {'error': 'error', 'jobs': 'jobs'} + def __init__(self, error=None, jobs=None, **unknown_fields): + ''' + error : Error + jobs : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + jobs_ = jobs + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + self.error = error_ + self.jobs = jobs_ + self.unknown_fields = unknown_fields + + + +class JobsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~JobsResult] + ''' + results_ = [JobsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class KnownServiceArgs(Type): + _toSchema = {'known_services': 'known-services'} + _toPy = {'known-services': 'known_services'} + def __init__(self, known_services=None, **unknown_fields): + ''' + known_services : typing.Sequence[str] + ''' + known_services_ = known_services + + # Validate arguments against known Juju API types. + if known_services_ is not None and not isinstance(known_services_, (bytes, str, list)): + raise Exception("Expected known_services_ to be a Sequence, received: {}".format(type(known_services_))) + + self.known_services = known_services_ + self.unknown_fields = unknown_fields + + + +class KubernetesDeploymentInfo(Type): + _toSchema = {'deployment_type': 'deployment-type', 'service_type': 'service-type'} + _toPy = {'deployment-type': 'deployment_type', 'service-type': 'service_type'} + def __init__(self, deployment_type=None, service_type=None, **unknown_fields): + ''' + deployment_type : str + service_type : str + ''' + deployment_type_ = deployment_type + service_type_ = service_type + + # Validate arguments against known Juju API types. + if deployment_type_ is not None and not isinstance(deployment_type_, (bytes, str)): + raise Exception("Expected deployment_type_ to be a str, received: {}".format(type(deployment_type_))) + + if service_type_ is not None and not isinstance(service_type_, (bytes, str)): + raise Exception("Expected service_type_ to be a str, received: {}".format(type(service_type_))) + + self.deployment_type = deployment_type_ + self.service_type = service_type_ + self.unknown_fields = unknown_fields + + + +class KubernetesDeviceParams(Type): + _toSchema = {'attributes': 'Attributes', 'count': 'Count', 'type_': 'Type'} + _toPy = {'Attributes': 'attributes', 'Count': 'count', 'Type': 'type_'} + def __init__(self, attributes=None, count=None, type_=None, **unknown_fields): + ''' + attributes : typing.Mapping[str, str] + count : int + type_ : str + ''' + attributes_ = attributes + count_ = count + type__ = type_ + + # Validate arguments against known Juju API types. + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.attributes = attributes_ + self.count = count_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class KubernetesFilesystemAttachmentParams(Type): + _toSchema = {'mount_point': 'mount-point', 'provider': 'provider', 'read_only': 'read-only'} + _toPy = {'mount-point': 'mount_point', 'provider': 'provider', 'read-only': 'read_only'} + def __init__(self, mount_point=None, provider=None, read_only=None, **unknown_fields): + ''' + mount_point : str + provider : str + read_only : bool + ''' + mount_point_ = mount_point + provider_ = provider + read_only_ = read_only + + # Validate arguments against known Juju API types. + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.mount_point = mount_point_ + self.provider = provider_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +class KubernetesFilesystemInfo(Type): + _toSchema = {'data': 'data', 'filesystem_id': 'filesystem-id', 'info': 'info', 'mount_point': 'mount-point', 'pool': 'pool', 'read_only': 'read-only', 'size': 'size', 'status': 'status', 'storagename': 'storagename', 'volume': 'volume'} + _toPy = {'data': 'data', 'filesystem-id': 'filesystem_id', 'info': 'info', 'mount-point': 'mount_point', 'pool': 'pool', 'read-only': 'read_only', 'size': 'size', 'status': 'status', 'storagename': 'storagename', 'volume': 'volume'} + def __init__(self, data=None, filesystem_id=None, info=None, mount_point=None, pool=None, read_only=None, size=None, status=None, storagename=None, volume=None, **unknown_fields): + ''' + data : typing.Mapping[str, typing.Any] + filesystem_id : str + info : str + mount_point : str + pool : str + read_only : bool + size : int + status : str + storagename : str + volume : KubernetesVolumeInfo + ''' + data_ = data + filesystem_id_ = filesystem_id + info_ = info + mount_point_ = mount_point + pool_ = pool + read_only_ = read_only + size_ = size + status_ = status + storagename_ = storagename + volume_ = KubernetesVolumeInfo.from_json(volume) if volume else None + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if storagename_ is not None and not isinstance(storagename_, (bytes, str)): + raise Exception("Expected storagename_ to be a str, received: {}".format(type(storagename_))) + + if volume_ is not None and not isinstance(volume_, (dict, KubernetesVolumeInfo)): + raise Exception("Expected volume_ to be a KubernetesVolumeInfo, received: {}".format(type(volume_))) + + self.data = data_ + self.filesystem_id = filesystem_id_ + self.info = info_ + self.mount_point = mount_point_ + self.pool = pool_ + self.read_only = read_only_ + self.size = size_ + self.status = status_ + self.storagename = storagename_ + self.volume = volume_ + self.unknown_fields = unknown_fields + + + +class KubernetesFilesystemParams(Type): + _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} + _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} + def __init__(self, attachment=None, attributes=None, provider=None, size=None, storagename=None, tags=None, **unknown_fields): + ''' + attachment : KubernetesFilesystemAttachmentParams + attributes : typing.Mapping[str, typing.Any] + provider : str + size : int + storagename : str + tags : typing.Mapping[str, str] + ''' + attachment_ = KubernetesFilesystemAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + provider_ = provider + size_ = size + storagename_ = storagename + tags_ = tags + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, KubernetesFilesystemAttachmentParams)): + raise Exception("Expected attachment_ to be a KubernetesFilesystemAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if storagename_ is not None and not isinstance(storagename_, (bytes, str)): + raise Exception("Expected storagename_ to be a str, received: {}".format(type(storagename_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.provider = provider_ + self.size = size_ + self.storagename = storagename_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +class KubernetesProvisioningInfo(Type): + _toSchema = {'charm_modified_version': 'charm-modified-version', 'constraints': 'constraints', 'deployment_info': 'deployment-info', 'devices': 'devices', 'filesystems': 'filesystems', 'image_repo': 'image-repo', 'pod_spec': 'pod-spec', 'raw_k8s_spec': 'raw-k8s-spec', 'tags': 'tags', 'volumes': 'volumes'} + _toPy = {'charm-modified-version': 'charm_modified_version', 'constraints': 'constraints', 'deployment-info': 'deployment_info', 'devices': 'devices', 'filesystems': 'filesystems', 'image-repo': 'image_repo', 'pod-spec': 'pod_spec', 'raw-k8s-spec': 'raw_k8s_spec', 'tags': 'tags', 'volumes': 'volumes'} + def __init__(self, charm_modified_version=None, constraints=None, deployment_info=None, devices=None, filesystems=None, image_repo=None, pod_spec=None, raw_k8s_spec=None, tags=None, volumes=None, **unknown_fields): + ''' + charm_modified_version : int + constraints : Value + deployment_info : KubernetesDeploymentInfo + devices : typing.Sequence[~KubernetesDeviceParams] + filesystems : typing.Sequence[~KubernetesFilesystemParams] + image_repo : DockerImageInfo + pod_spec : str + raw_k8s_spec : str + tags : typing.Mapping[str, str] + volumes : typing.Sequence[~KubernetesVolumeParams] + ''' + charm_modified_version_ = charm_modified_version + constraints_ = Value.from_json(constraints) if constraints else None + deployment_info_ = KubernetesDeploymentInfo.from_json(deployment_info) if deployment_info else None + devices_ = [KubernetesDeviceParams.from_json(o) for o in devices or []] + filesystems_ = [KubernetesFilesystemParams.from_json(o) for o in filesystems or []] + image_repo_ = DockerImageInfo.from_json(image_repo) if image_repo else None + pod_spec_ = pod_spec + raw_k8s_spec_ = raw_k8s_spec + tags_ = tags + volumes_ = [KubernetesVolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if charm_modified_version_ is not None and not isinstance(charm_modified_version_, int): + raise Exception("Expected charm_modified_version_ to be a int, received: {}".format(type(charm_modified_version_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if deployment_info_ is not None and not isinstance(deployment_info_, (dict, KubernetesDeploymentInfo)): + raise Exception("Expected deployment_info_ to be a KubernetesDeploymentInfo, received: {}".format(type(deployment_info_))) + + if devices_ is not None and not isinstance(devices_, (bytes, str, list)): + raise Exception("Expected devices_ to be a Sequence, received: {}".format(type(devices_))) + + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + + if image_repo_ is not None and not isinstance(image_repo_, (dict, DockerImageInfo)): + raise Exception("Expected image_repo_ to be a DockerImageInfo, received: {}".format(type(image_repo_))) + + if pod_spec_ is not None and not isinstance(pod_spec_, (bytes, str)): + raise Exception("Expected pod_spec_ to be a str, received: {}".format(type(pod_spec_))) + + if raw_k8s_spec_ is not None and not isinstance(raw_k8s_spec_, (bytes, str)): + raise Exception("Expected raw_k8s_spec_ to be a str, received: {}".format(type(raw_k8s_spec_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.charm_modified_version = charm_modified_version_ + self.constraints = constraints_ + self.deployment_info = deployment_info_ + self.devices = devices_ + self.filesystems = filesystems_ + self.image_repo = image_repo_ + self.pod_spec = pod_spec_ + self.raw_k8s_spec = raw_k8s_spec_ + self.tags = tags_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class KubernetesProvisioningInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : KubernetesProvisioningInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = KubernetesProvisioningInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, KubernetesProvisioningInfo)): + raise Exception("Expected result_ to be a KubernetesProvisioningInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class KubernetesProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~KubernetesProvisioningInfoResult] + ''' + results_ = [KubernetesProvisioningInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class KubernetesUpgradeArg(Type): + _toSchema = {'agent_tag': 'agent-tag', 'version': 'version'} + _toPy = {'agent-tag': 'agent_tag', 'version': 'version'} + def __init__(self, agent_tag=None, version=None, **unknown_fields): + ''' + agent_tag : str + version : Number + ''' + agent_tag_ = agent_tag + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if agent_tag_ is not None and not isinstance(agent_tag_, (bytes, str)): + raise Exception("Expected agent_tag_ to be a str, received: {}".format(type(agent_tag_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.agent_tag = agent_tag_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class KubernetesVolumeAttachmentParams(Type): + _toSchema = {'provider': 'provider', 'read_only': 'read-only'} + _toPy = {'provider': 'provider', 'read-only': 'read_only'} + def __init__(self, provider=None, read_only=None, **unknown_fields): + ''' + provider : str + read_only : bool + ''' + provider_ = provider + read_only_ = read_only + + # Validate arguments against known Juju API types. + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.provider = provider_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +class KubernetesVolumeInfo(Type): + _toSchema = {'data': 'data', 'info': 'info', 'persistent': 'persistent', 'pool': 'pool', 'size': 'size', 'status': 'status', 'volume_id': 'volume-id'} + _toPy = {'data': 'data', 'info': 'info', 'persistent': 'persistent', 'pool': 'pool', 'size': 'size', 'status': 'status', 'volume-id': 'volume_id'} + def __init__(self, data=None, info=None, persistent=None, pool=None, size=None, status=None, volume_id=None, **unknown_fields): + ''' + data : typing.Mapping[str, typing.Any] + info : str + persistent : bool + pool : str + size : int + status : str + volume_id : str + ''' + data_ = data + info_ = info + persistent_ = persistent + pool_ = pool + size_ = size + status_ = status + volume_id_ = volume_id + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if persistent_ is not None and not isinstance(persistent_, bool): + raise Exception("Expected persistent_ to be a bool, received: {}".format(type(persistent_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) + + self.data = data_ + self.info = info_ + self.persistent = persistent_ + self.pool = pool_ + self.size = size_ + self.status = status_ + self.volume_id = volume_id_ + self.unknown_fields = unknown_fields + + + +class KubernetesVolumeParams(Type): + _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} + _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} + def __init__(self, attachment=None, attributes=None, provider=None, size=None, storagename=None, tags=None, **unknown_fields): + ''' + attachment : KubernetesVolumeAttachmentParams + attributes : typing.Mapping[str, typing.Any] + provider : str + size : int + storagename : str + tags : typing.Mapping[str, str] + ''' + attachment_ = KubernetesVolumeAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + provider_ = provider + size_ = size + storagename_ = storagename + tags_ = tags + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, KubernetesVolumeAttachmentParams)): + raise Exception("Expected attachment_ to be a KubernetesVolumeAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if storagename_ is not None and not isinstance(storagename_, (bytes, str)): + raise Exception("Expected storagename_ to be a str, received: {}".format(type(storagename_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.provider = provider_ + self.size = size_ + self.storagename = storagename_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +class LXDProfile(Type): + _toSchema = {'config': 'config', 'description': 'description', 'devices': 'devices'} + _toPy = {'config': 'config', 'description': 'description', 'devices': 'devices'} + def __init__(self, config=None, description=None, devices=None, **unknown_fields): + ''' + config : typing.Mapping[str, str] + description : str + devices : typing.Mapping[str, typing.Any] + ''' + config_ = config + description_ = description + devices_ = devices + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + + self.config = config_ + self.description = description_ + self.devices = devices_ + self.unknown_fields = unknown_fields + + + +class LatestSecretRevisionChanges(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~SecretRevisionChange] + ''' + changes_ = [SecretRevisionChange.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class LeaseOperationCommand(Type): + _toSchema = {'duration': 'duration', 'holder': 'holder', 'lease': 'lease', 'model_uuid': 'model-uuid', 'namespace': 'namespace', 'new_time': 'new-time', 'old_time': 'old-time', 'operation': 'operation', 'pin_entity': 'pin-entity', 'version': 'version'} + _toPy = {'duration': 'duration', 'holder': 'holder', 'lease': 'lease', 'model-uuid': 'model_uuid', 'namespace': 'namespace', 'new-time': 'new_time', 'old-time': 'old_time', 'operation': 'operation', 'pin-entity': 'pin_entity', 'version': 'version'} + def __init__(self, duration=None, holder=None, lease=None, model_uuid=None, namespace=None, new_time=None, old_time=None, operation=None, pin_entity=None, version=None, **unknown_fields): + ''' + duration : int + holder : str + lease : str + model_uuid : str + namespace : str + new_time : str + old_time : str + operation : str + pin_entity : str + version : int + ''' + duration_ = duration + holder_ = holder + lease_ = lease + model_uuid_ = model_uuid + namespace_ = namespace + new_time_ = new_time + old_time_ = old_time + operation_ = operation + pin_entity_ = pin_entity + version_ = version + + # Validate arguments against known Juju API types. + if duration_ is not None and not isinstance(duration_, int): + raise Exception("Expected duration_ to be a int, received: {}".format(type(duration_))) + + if holder_ is not None and not isinstance(holder_, (bytes, str)): + raise Exception("Expected holder_ to be a str, received: {}".format(type(holder_))) + + if lease_ is not None and not isinstance(lease_, (bytes, str)): + raise Exception("Expected lease_ to be a str, received: {}".format(type(lease_))) + + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + if namespace_ is not None and not isinstance(namespace_, (bytes, str)): + raise Exception("Expected namespace_ to be a str, received: {}".format(type(namespace_))) + + if new_time_ is not None and not isinstance(new_time_, (bytes, str)): + raise Exception("Expected new_time_ to be a str, received: {}".format(type(new_time_))) + + if old_time_ is not None and not isinstance(old_time_, (bytes, str)): + raise Exception("Expected old_time_ to be a str, received: {}".format(type(old_time_))) + + if operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + if pin_entity_ is not None and not isinstance(pin_entity_, (bytes, str)): + raise Exception("Expected pin_entity_ to be a str, received: {}".format(type(pin_entity_))) + + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + + self.duration = duration_ + self.holder = holder_ + self.lease = lease_ + self.model_uuid = model_uuid_ + self.namespace = namespace_ + self.new_time = new_time_ + self.old_time = old_time_ + self.operation = operation_ + self.pin_entity = pin_entity_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class LeaseOperationsV2(Type): + _toSchema = {'commands': 'commands'} + _toPy = {'commands': 'commands'} + def __init__(self, commands=None, **unknown_fields): + ''' + commands : typing.Sequence[~LeaseOperationCommand] + ''' + commands_ = [LeaseOperationCommand.from_json(o) for o in commands or []] + + # Validate arguments against known Juju API types. + if commands_ is not None and not isinstance(commands_, (bytes, str, list)): + raise Exception("Expected commands_ to be a Sequence, received: {}".format(type(commands_))) + + self.commands = commands_ + self.unknown_fields = unknown_fields + + + +class LifeResult(Type): + _toSchema = {'error': 'error', 'life': 'life'} + _toPy = {'error': 'error', 'life': 'life'} + def __init__(self, error=None, life=None, **unknown_fields): + ''' + error : Error + life : str + ''' + error_ = Error.from_json(error) if error else None + life_ = life + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + self.error = error_ + self.life = life_ + self.unknown_fields = unknown_fields + + + +class LifeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~LifeResult] + ''' + results_ = [LifeResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ListCloudImageMetadataResult(Type): + _toSchema = {'result': 'result'} + _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): + ''' + result : typing.Sequence[~CloudImageMetadata] + ''' + result_ = [CloudImageMetadata.from_json(o) for o in result or []] + + # Validate arguments against known Juju API types. + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ListCloudInfo(Type): + _toSchema = {'clouddetails': 'CloudDetails', 'user_access': 'user-access'} + _toPy = {'CloudDetails': 'clouddetails', 'user-access': 'user_access'} + def __init__(self, clouddetails=None, user_access=None, **unknown_fields): + ''' + clouddetails : CloudDetails + user_access : str + ''' + clouddetails_ = CloudDetails.from_json(clouddetails) if clouddetails else None + user_access_ = user_access + + # Validate arguments against known Juju API types. + if clouddetails_ is not None and not isinstance(clouddetails_, (dict, CloudDetails)): + raise Exception("Expected clouddetails_ to be a CloudDetails, received: {}".format(type(clouddetails_))) + + if user_access_ is not None and not isinstance(user_access_, (bytes, str)): + raise Exception("Expected user_access_ to be a str, received: {}".format(type(user_access_))) + + self.clouddetails = clouddetails_ + self.user_access = user_access_ + self.unknown_fields = unknown_fields + + + +class ListCloudInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ListCloudInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ListCloudInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ListCloudInfo)): + raise Exception("Expected result_ to be a ListCloudInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ListCloudInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ListCloudInfoResult] + ''' + results_ = [ListCloudInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ListCloudsRequest(Type): + _toSchema = {'all_': 'all', 'user_tag': 'user-tag'} + _toPy = {'all': 'all_', 'user-tag': 'user_tag'} + def __init__(self, all_=None, user_tag=None, **unknown_fields): + ''' + all_ : bool + user_tag : str + ''' + all__ = all_ + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.all_ = all__ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ListFirewallRulesResults(Type): + _toSchema = {'rules': 'Rules'} + _toPy = {'Rules': 'rules'} + def __init__(self, rules=None, **unknown_fields): + ''' + rules : typing.Sequence[~FirewallRule] + ''' + rules_ = [FirewallRule.from_json(o) for o in rules or []] + + # Validate arguments against known Juju API types. + if rules_ is not None and not isinstance(rules_, (bytes, str, list)): + raise Exception("Expected rules_ to be a Sequence, received: {}".format(type(rules_))) + + self.rules = rules_ + self.unknown_fields = unknown_fields + + + +class ListResourcesArgs(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~Entity] + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + +class ListSSHKeys(Type): + _toSchema = {'entities': 'entities', 'mode': 'mode'} + _toPy = {'entities': 'entities', 'mode': 'mode'} + def __init__(self, entities=None, mode=None, **unknown_fields): + ''' + entities : Entities + mode : bool + ''' + entities_ = Entities.from_json(entities) if entities else None + mode_ = mode + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (dict, Entities)): + raise Exception("Expected entities_ to be a Entities, received: {}".format(type(entities_))) + + if mode_ is not None and not isinstance(mode_, bool): + raise Exception("Expected mode_ to be a bool, received: {}".format(type(mode_))) + + self.entities = entities_ + self.mode = mode_ + self.unknown_fields = unknown_fields + + + +class ListSecretBackendsArgs(Type): + _toSchema = {'names': 'names', 'reveal': 'reveal'} + _toPy = {'names': 'names', 'reveal': 'reveal'} + def __init__(self, names=None, reveal=None, **unknown_fields): + ''' + names : typing.Sequence[str] + reveal : bool + ''' + names_ = names + reveal_ = reveal + + # Validate arguments against known Juju API types. + if names_ is not None and not isinstance(names_, (bytes, str, list)): + raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) + + if reveal_ is not None and not isinstance(reveal_, bool): + raise Exception("Expected reveal_ to be a bool, received: {}".format(type(reveal_))) + + self.names = names_ + self.reveal = reveal_ + self.unknown_fields = unknown_fields + + + +class ListSecretBackendsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SecretBackendResult] + ''' + results_ = [SecretBackendResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ListSecretResult(Type): + _toSchema = {'access': 'access', 'create_time': 'create-time', 'description': 'description', 'label': 'label', 'latest_expire_time': 'latest-expire-time', 'latest_revision': 'latest-revision', 'next_rotate_time': 'next-rotate-time', 'owner_tag': 'owner-tag', 'revisions': 'revisions', 'rotate_policy': 'rotate-policy', 'update_time': 'update-time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + _toPy = {'access': 'access', 'create-time': 'create_time', 'description': 'description', 'label': 'label', 'latest-expire-time': 'latest_expire_time', 'latest-revision': 'latest_revision', 'next-rotate-time': 'next_rotate_time', 'owner-tag': 'owner_tag', 'revisions': 'revisions', 'rotate-policy': 'rotate_policy', 'update-time': 'update_time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + def __init__(self, access=None, create_time=None, description=None, label=None, latest_expire_time=None, latest_revision=None, next_rotate_time=None, owner_tag=None, revisions=None, rotate_policy=None, update_time=None, uri=None, value=None, version=None, **unknown_fields): + ''' + access : typing.Sequence[~AccessInfo] + create_time : str + description : str + label : str + latest_expire_time : str + latest_revision : int + next_rotate_time : str + owner_tag : str + revisions : typing.Sequence[~SecretRevision] + rotate_policy : str + update_time : str + uri : str + value : SecretValueResult + version : int + ''' + access_ = [AccessInfo.from_json(o) for o in access or []] + create_time_ = create_time + description_ = description + label_ = label + latest_expire_time_ = latest_expire_time + latest_revision_ = latest_revision + next_rotate_time_ = next_rotate_time + owner_tag_ = owner_tag + revisions_ = [SecretRevision.from_json(o) for o in revisions or []] + rotate_policy_ = rotate_policy + update_time_ = update_time + uri_ = uri + value_ = SecretValueResult.from_json(value) if value else None + version_ = version + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str, list)): + raise Exception("Expected access_ to be a Sequence, received: {}".format(type(access_))) + + if create_time_ is not None and not isinstance(create_time_, (bytes, str)): + raise Exception("Expected create_time_ to be a str, received: {}".format(type(create_time_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if latest_expire_time_ is not None and not isinstance(latest_expire_time_, (bytes, str)): + raise Exception("Expected latest_expire_time_ to be a str, received: {}".format(type(latest_expire_time_))) + + if latest_revision_ is not None and not isinstance(latest_revision_, int): + raise Exception("Expected latest_revision_ to be a int, received: {}".format(type(latest_revision_))) + + if next_rotate_time_ is not None and not isinstance(next_rotate_time_, (bytes, str)): + raise Exception("Expected next_rotate_time_ to be a str, received: {}".format(type(next_rotate_time_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if revisions_ is not None and not isinstance(revisions_, (bytes, str, list)): + raise Exception("Expected revisions_ to be a Sequence, received: {}".format(type(revisions_))) + + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) + + if update_time_ is not None and not isinstance(update_time_, (bytes, str)): + raise Exception("Expected update_time_ to be a str, received: {}".format(type(update_time_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + if value_ is not None and not isinstance(value_, (dict, SecretValueResult)): + raise Exception("Expected value_ to be a SecretValueResult, received: {}".format(type(value_))) + + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + + self.access = access_ + self.create_time = create_time_ + self.description = description_ + self.label = label_ + self.latest_expire_time = latest_expire_time_ + self.latest_revision = latest_revision_ + self.next_rotate_time = next_rotate_time_ + self.owner_tag = owner_tag_ + self.revisions = revisions_ + self.rotate_policy = rotate_policy_ + self.update_time = update_time_ + self.uri = uri_ + self.value = value_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class ListSecretResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ListSecretResult] + ''' + results_ = [ListSecretResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ListSecretsArgs(Type): + _toSchema = {'filter_': 'filter', 'show_secrets': 'show-secrets'} + _toPy = {'filter': 'filter_', 'show-secrets': 'show_secrets'} + def __init__(self, filter_=None, show_secrets=None, **unknown_fields): + ''' + filter_ : SecretsFilter + show_secrets : bool + ''' + filter__ = SecretsFilter.from_json(filter_) if filter_ else None + show_secrets_ = show_secrets + + # Validate arguments against known Juju API types. + 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_))) + + self.filter_ = filter__ + self.show_secrets = show_secrets_ + self.unknown_fields = unknown_fields + + + +class ListSpacesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Space] + ''' + results_ = [Space.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ListSubnetsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Subnet] + ''' + results_ = [Subnet.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ListUnitResourcesArgs(Type): + _toSchema = {'resource_names': 'resource-names'} + _toPy = {'resource-names': 'resource_names'} + def __init__(self, resource_names=None, **unknown_fields): + ''' + resource_names : typing.Sequence[str] + ''' + resource_names_ = resource_names + + # Validate arguments against known Juju API types. + if resource_names_ is not None and not isinstance(resource_names_, (bytes, str, list)): + raise Exception("Expected resource_names_ to be a Sequence, received: {}".format(type(resource_names_))) + + self.resource_names = resource_names_ + self.unknown_fields = unknown_fields + + + +class LogForwardingGetLastSentParams(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): + ''' + ids : typing.Sequence[~LogForwardingID] + ''' + ids_ = [LogForwardingID.from_json(o) for o in ids or []] + + # Validate arguments against known Juju API types. + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + + self.ids = ids_ + self.unknown_fields = unknown_fields + + + +class LogForwardingGetLastSentResult(Type): + _toSchema = {'err': 'err', 'record_id': 'record-id', 'record_timestamp': 'record-timestamp'} + _toPy = {'err': 'err', 'record-id': 'record_id', 'record-timestamp': 'record_timestamp'} + def __init__(self, err=None, record_id=None, record_timestamp=None, **unknown_fields): + ''' + err : Error + record_id : int + record_timestamp : int + ''' + err_ = Error.from_json(err) if err else None + record_id_ = record_id + record_timestamp_ = record_timestamp + + # Validate arguments against known Juju API types. + if err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + if record_id_ is not None and not isinstance(record_id_, int): + raise Exception("Expected record_id_ to be a int, received: {}".format(type(record_id_))) + + if record_timestamp_ is not None and not isinstance(record_timestamp_, int): + raise Exception("Expected record_timestamp_ to be a int, received: {}".format(type(record_timestamp_))) + + self.err = err_ + self.record_id = record_id_ + self.record_timestamp = record_timestamp_ + self.unknown_fields = unknown_fields + + + +class LogForwardingGetLastSentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~LogForwardingGetLastSentResult] + ''' + results_ = [LogForwardingGetLastSentResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class LogForwardingID(Type): + _toSchema = {'model': 'model', 'sink': 'sink'} + _toPy = {'model': 'model', 'sink': 'sink'} + def __init__(self, model=None, sink=None, **unknown_fields): + ''' + model : str + sink : str + ''' + model_ = model + sink_ = sink + + # Validate arguments against known Juju API types. + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + if sink_ is not None and not isinstance(sink_, (bytes, str)): + raise Exception("Expected sink_ to be a str, received: {}".format(type(sink_))) + + self.model = model_ + self.sink = sink_ + self.unknown_fields = unknown_fields + + + +class LogForwardingSetLastSentParam(Type): + _toSchema = {'logforwardingid': 'LogForwardingID', 'model': 'model', 'record_id': 'record-id', 'record_timestamp': 'record-timestamp', 'sink': 'sink'} + _toPy = {'LogForwardingID': 'logforwardingid', 'model': 'model', 'record-id': 'record_id', 'record-timestamp': 'record_timestamp', 'sink': 'sink'} + def __init__(self, logforwardingid=None, model=None, record_id=None, record_timestamp=None, sink=None, **unknown_fields): + ''' + logforwardingid : LogForwardingID + model : str + record_id : int + record_timestamp : int + sink : str + ''' + logforwardingid_ = LogForwardingID.from_json(logforwardingid) if logforwardingid else None + model_ = model + record_id_ = record_id + record_timestamp_ = record_timestamp + sink_ = sink + + # Validate arguments against known Juju API types. + if logforwardingid_ is not None and not isinstance(logforwardingid_, (dict, LogForwardingID)): + raise Exception("Expected logforwardingid_ to be a LogForwardingID, received: {}".format(type(logforwardingid_))) + + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + if record_id_ is not None and not isinstance(record_id_, int): + raise Exception("Expected record_id_ to be a int, received: {}".format(type(record_id_))) + + if record_timestamp_ is not None and not isinstance(record_timestamp_, int): + raise Exception("Expected record_timestamp_ to be a int, received: {}".format(type(record_timestamp_))) + + if sink_ is not None and not isinstance(sink_, (bytes, str)): + raise Exception("Expected sink_ to be a str, received: {}".format(type(sink_))) + + self.logforwardingid = logforwardingid_ + self.model = model_ + self.record_id = record_id_ + self.record_timestamp = record_timestamp_ + self.sink = sink_ + self.unknown_fields = unknown_fields + + + +class LogForwardingSetLastSentParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~LogForwardingSetLastSentParam] + ''' + params_ = [LogForwardingSetLastSentParam.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = unknown_fields + + + +class LoginRequest(Type): + _toSchema = {'auth_tag': 'auth-tag', 'bakery_version': 'bakery-version', 'cli_args': 'cli-args', 'client_version': 'client-version', 'credentials': 'credentials', 'macaroons': 'macaroons', 'nonce': 'nonce', 'token': 'token', 'user_data': 'user-data'} + _toPy = {'auth-tag': 'auth_tag', 'bakery-version': 'bakery_version', 'cli-args': 'cli_args', 'client-version': 'client_version', 'credentials': 'credentials', 'macaroons': 'macaroons', 'nonce': 'nonce', 'token': 'token', 'user-data': 'user_data'} + def __init__(self, auth_tag=None, bakery_version=None, cli_args=None, client_version=None, credentials=None, macaroons=None, nonce=None, token=None, user_data=None, **unknown_fields): + ''' + auth_tag : str + bakery_version : int + cli_args : str + client_version : str + credentials : str + macaroons : typing.Sequence[~Macaroon] + nonce : str + token : str + user_data : str + ''' + auth_tag_ = auth_tag + bakery_version_ = bakery_version + cli_args_ = cli_args + client_version_ = client_version + credentials_ = credentials + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + nonce_ = nonce + token_ = token + user_data_ = user_data + + # Validate arguments against known Juju API types. + if auth_tag_ is not None and not isinstance(auth_tag_, (bytes, str)): + raise Exception("Expected auth_tag_ to be a str, received: {}".format(type(auth_tag_))) + + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if cli_args_ is not None and not isinstance(cli_args_, (bytes, str)): + raise Exception("Expected cli_args_ to be a str, received: {}".format(type(cli_args_))) + + if client_version_ is not None and not isinstance(client_version_, (bytes, str)): + raise Exception("Expected client_version_ to be a str, received: {}".format(type(client_version_))) + + if credentials_ is not None and not isinstance(credentials_, (bytes, str)): + raise Exception("Expected credentials_ to be a str, received: {}".format(type(credentials_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if nonce_ is not None and not isinstance(nonce_, (bytes, str)): + raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) + + if token_ is not None and not isinstance(token_, (bytes, str)): + raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) + + if user_data_ is not None and not isinstance(user_data_, (bytes, str)): + raise Exception("Expected user_data_ to be a str, received: {}".format(type(user_data_))) + + self.auth_tag = auth_tag_ + self.bakery_version = bakery_version_ + self.cli_args = cli_args_ + self.client_version = client_version_ + self.credentials = credentials_ + self.macaroons = macaroons_ + self.nonce = nonce_ + self.token = token_ + self.user_data = user_data_ + self.unknown_fields = unknown_fields + + + +class LoginResult(Type): + _toSchema = {'bakery_discharge_required': 'bakery-discharge-required', 'controller_tag': 'controller-tag', 'discharge_required': 'discharge-required', 'discharge_required_error': 'discharge-required-error', 'facades': 'facades', 'model_tag': 'model-tag', 'public_dns_name': 'public-dns-name', 'server_version': 'server-version', 'servers': 'servers', 'user_info': 'user-info'} + _toPy = {'bakery-discharge-required': 'bakery_discharge_required', 'controller-tag': 'controller_tag', 'discharge-required': 'discharge_required', 'discharge-required-error': 'discharge_required_error', 'facades': 'facades', 'model-tag': 'model_tag', 'public-dns-name': 'public_dns_name', 'server-version': 'server_version', 'servers': 'servers', 'user-info': 'user_info'} + def __init__(self, bakery_discharge_required=None, controller_tag=None, discharge_required=None, discharge_required_error=None, facades=None, model_tag=None, public_dns_name=None, server_version=None, servers=None, user_info=None, **unknown_fields): + ''' + bakery_discharge_required : Macaroon + controller_tag : str + discharge_required : Macaroon + discharge_required_error : str + facades : typing.Sequence[~FacadeVersions] + model_tag : str + public_dns_name : str + server_version : str + servers : typing.Sequence[~HostPort] + user_info : AuthUserInfo + ''' + bakery_discharge_required_ = Macaroon.from_json(bakery_discharge_required) if bakery_discharge_required else None + controller_tag_ = controller_tag + discharge_required_ = Macaroon.from_json(discharge_required) if discharge_required else None + discharge_required_error_ = discharge_required_error + facades_ = [FacadeVersions.from_json(o) for o in facades or []] + model_tag_ = model_tag + public_dns_name_ = public_dns_name + server_version_ = server_version + servers_ = [HostPort.from_json(o) for o in servers or []] + user_info_ = AuthUserInfo.from_json(user_info) if user_info else None + + # Validate arguments against known Juju API types. + if bakery_discharge_required_ is not None and not isinstance(bakery_discharge_required_, (dict, Macaroon)): + raise Exception("Expected bakery_discharge_required_ to be a Macaroon, received: {}".format(type(bakery_discharge_required_))) + + if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): + raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) + + if discharge_required_ is not None and not isinstance(discharge_required_, (dict, Macaroon)): + raise Exception("Expected discharge_required_ to be a Macaroon, received: {}".format(type(discharge_required_))) + + if discharge_required_error_ is not None and not isinstance(discharge_required_error_, (bytes, str)): + raise Exception("Expected discharge_required_error_ to be a str, received: {}".format(type(discharge_required_error_))) + + if facades_ is not None and not isinstance(facades_, (bytes, str, list)): + raise Exception("Expected facades_ to be a Sequence, received: {}".format(type(facades_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if public_dns_name_ is not None and not isinstance(public_dns_name_, (bytes, str)): + raise Exception("Expected public_dns_name_ to be a str, received: {}".format(type(public_dns_name_))) + + if server_version_ is not None and not isinstance(server_version_, (bytes, str)): + raise Exception("Expected server_version_ to be a str, received: {}".format(type(server_version_))) + + if servers_ is not None and not isinstance(servers_, (bytes, str, list)): + raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + + if user_info_ is not None and not isinstance(user_info_, (dict, AuthUserInfo)): + raise Exception("Expected user_info_ to be a AuthUserInfo, received: {}".format(type(user_info_))) + + self.bakery_discharge_required = bakery_discharge_required_ + self.controller_tag = controller_tag_ + self.discharge_required = discharge_required_ + self.discharge_required_error = discharge_required_error_ + self.facades = facades_ + self.model_tag = model_tag_ + self.public_dns_name = public_dns_name_ + self.server_version = server_version_ + self.servers = servers_ + self.user_info = user_info_ + self.unknown_fields = unknown_fields + + + +class LookUpPayloadArg(Type): + _toSchema = {'id_': 'id', 'name': 'name'} + _toPy = {'id': 'id_', 'name': 'name'} + def __init__(self, id_=None, name=None, **unknown_fields): + ''' + id_ : str + name : str + ''' + id__ = id_ + name_ = name + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.id_ = id__ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class LookUpPayloadArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~LookUpPayloadArg] + ''' + args_ = [LookUpPayloadArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class Macaroon(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): + ''' + + ''' + self.unknown_fields = unknown_fields + + + +class MacaroonResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : Macaroon + ''' + error_ = Error.from_json(error) if error else None + result_ = Macaroon.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, Macaroon)): + raise Exception("Expected result_ to be a Macaroon, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class MacaroonResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MacaroonResult] + ''' + results_ = [MacaroonResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MachineAddresses(Type): + _toSchema = {'addresses': 'addresses', 'tag': 'tag'} + _toPy = {'addresses': 'addresses', 'tag': 'tag'} + def __init__(self, addresses=None, tag=None, **unknown_fields): + ''' + addresses : typing.Sequence[~Address] + tag : str + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + tag_ = tag + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.addresses = addresses_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class MachineAddressesResult(Type): + _toSchema = {'addresses': 'addresses', 'error': 'error'} + _toPy = {'addresses': 'addresses', 'error': 'error'} + def __init__(self, addresses=None, error=None, **unknown_fields): + ''' + addresses : typing.Sequence[~Address] + error : Error + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.addresses = addresses_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class MachineAddressesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineAddressesResult] + ''' + results_ = [MachineAddressesResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MachineBlockDevices(Type): + _toSchema = {'block_devices': 'block-devices', 'machine': 'machine'} + _toPy = {'block-devices': 'block_devices', 'machine': 'machine'} + def __init__(self, block_devices=None, machine=None, **unknown_fields): + ''' + block_devices : typing.Sequence[~BlockDevice] + machine : str + ''' + block_devices_ = [BlockDevice.from_json(o) for o in block_devices or []] + machine_ = machine + + # Validate arguments against known Juju API types. + if block_devices_ is not None and not isinstance(block_devices_, (bytes, str, list)): + raise Exception("Expected block_devices_ to be a Sequence, received: {}".format(type(block_devices_))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + self.block_devices = block_devices_ + self.machine = machine_ + self.unknown_fields = unknown_fields + + + +class MachineContainerResult(Type): + _toSchema = {'container_types': 'container-types', 'determined': 'determined', 'error': 'error'} + _toPy = {'container-types': 'container_types', 'determined': 'determined', 'error': 'error'} + def __init__(self, container_types=None, determined=None, error=None, **unknown_fields): + ''' + container_types : typing.Sequence[str] + determined : bool + error : Error + ''' + container_types_ = container_types + determined_ = determined + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if container_types_ is not None and not isinstance(container_types_, (bytes, str, list)): + raise Exception("Expected container_types_ to be a Sequence, received: {}".format(type(container_types_))) + + if determined_ is not None and not isinstance(determined_, bool): + raise Exception("Expected determined_ to be a bool, received: {}".format(type(determined_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.container_types = container_types_ + self.determined = determined_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class MachineContainerResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineContainerResult] + ''' + results_ = [MachineContainerResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MachineContainers(Type): + _toSchema = {'container_types': 'container-types', 'machine_tag': 'machine-tag'} + _toPy = {'container-types': 'container_types', 'machine-tag': 'machine_tag'} + def __init__(self, container_types=None, machine_tag=None, **unknown_fields): + ''' + container_types : typing.Sequence[str] + machine_tag : str + ''' + container_types_ = container_types + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if container_types_ is not None and not isinstance(container_types_, (bytes, str, list)): + raise Exception("Expected container_types_ to be a Sequence, received: {}".format(type(container_types_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.container_types = container_types_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class MachineContainersParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~MachineContainers] + ''' + params_ = [MachineContainers.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = unknown_fields + + + +class MachineHardware(Type): + _toSchema = {'arch': 'arch', 'availability_zone': 'availability-zone', 'cores': 'cores', 'cpu_power': 'cpu-power', 'mem': 'mem', 'root_disk': 'root-disk', 'tags': 'tags', 'virt_type': 'virt-type'} + _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cores': 'cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'tags': 'tags', 'virt-type': 'virt_type'} + def __init__(self, arch=None, availability_zone=None, cores=None, cpu_power=None, mem=None, root_disk=None, tags=None, virt_type=None, **unknown_fields): + ''' + arch : str + availability_zone : str + cores : int + cpu_power : int + mem : int + root_disk : int + tags : typing.Sequence[str] + virt_type : str + ''' + arch_ = arch + availability_zone_ = availability_zone + cores_ = cores + cpu_power_ = cpu_power + mem_ = mem + root_disk_ = root_disk + tags_ = tags + virt_type_ = virt_type + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if availability_zone_ is not None and not isinstance(availability_zone_, (bytes, str)): + raise Exception("Expected availability_zone_ to be a str, received: {}".format(type(availability_zone_))) + + if cores_ is not None and not isinstance(cores_, int): + raise Exception("Expected cores_ to be a int, received: {}".format(type(cores_))) + + if cpu_power_ is not None and not isinstance(cpu_power_, int): + raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) + + if mem_ is not None and not isinstance(mem_, int): + raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) + + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): + raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + + self.arch = arch_ + self.availability_zone = availability_zone_ + self.cores = cores_ + self.cpu_power = cpu_power_ + self.mem = mem_ + self.root_disk = root_disk_ + self.tags = tags_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields + + + +class MachineNetworkConfigResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : typing.Sequence[~NetworkConfig] + ''' + error_ = Error.from_json(error) if error else None + info_ = [NetworkConfig.from_json(o) for o in info or []] + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if info_ is not None and not isinstance(info_, (bytes, str, list)): + raise Exception("Expected info_ to be a Sequence, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class MachineNetworkConfigResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineNetworkConfigResult] + ''' + results_ = [MachineNetworkConfigResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MachineStatus(Type): + _toSchema = {'agent_status': 'agent-status', 'base': 'base', 'constraints': 'constraints', 'containers': 'containers', 'display_name': 'display-name', 'dns_name': 'dns-name', 'hardware': 'hardware', 'has_vote': 'has-vote', 'hostname': 'hostname', 'id_': 'id', 'instance_id': 'instance-id', 'instance_status': 'instance-status', 'ip_addresses': 'ip-addresses', 'jobs': 'jobs', 'lxd_profiles': 'lxd-profiles', 'modification_status': 'modification-status', 'network_interfaces': 'network-interfaces', 'primary_controller_machine': 'primary-controller-machine', 'wants_vote': 'wants-vote'} + _toPy = {'agent-status': 'agent_status', 'base': 'base', 'constraints': 'constraints', 'containers': 'containers', 'display-name': 'display_name', 'dns-name': 'dns_name', 'hardware': 'hardware', 'has-vote': 'has_vote', 'hostname': 'hostname', 'id': 'id_', 'instance-id': 'instance_id', 'instance-status': 'instance_status', 'ip-addresses': 'ip_addresses', 'jobs': 'jobs', 'lxd-profiles': 'lxd_profiles', 'modification-status': 'modification_status', 'network-interfaces': 'network_interfaces', 'primary-controller-machine': 'primary_controller_machine', 'wants-vote': 'wants_vote'} + def __init__(self, agent_status=None, base=None, constraints=None, containers=None, display_name=None, dns_name=None, hardware=None, has_vote=None, hostname=None, id_=None, instance_id=None, instance_status=None, ip_addresses=None, jobs=None, lxd_profiles=None, modification_status=None, network_interfaces=None, primary_controller_machine=None, wants_vote=None, **unknown_fields): + ''' + agent_status : DetailedStatus + base : Base + constraints : str + containers : typing.Mapping[str, ~MachineStatus] + display_name : str + dns_name : str + hardware : str + has_vote : bool + hostname : str + id_ : str + instance_id : str + instance_status : DetailedStatus + ip_addresses : typing.Sequence[str] + jobs : typing.Sequence[str] + lxd_profiles : typing.Mapping[str, ~LXDProfile] + modification_status : DetailedStatus + network_interfaces : typing.Mapping[str, ~NetworkInterface] + primary_controller_machine : bool + wants_vote : bool + ''' + agent_status_ = DetailedStatus.from_json(agent_status) if agent_status else None + base_ = Base.from_json(base) if base else None + constraints_ = constraints + containers_ = {k: MachineStatus.from_json(v) for k, v in (containers or dict()).items()} + display_name_ = display_name + dns_name_ = dns_name + hardware_ = hardware + has_vote_ = has_vote + hostname_ = hostname + id__ = id_ + instance_id_ = instance_id + instance_status_ = DetailedStatus.from_json(instance_status) if instance_status else None + ip_addresses_ = ip_addresses + jobs_ = jobs + lxd_profiles_ = {k: LXDProfile.from_json(v) for k, v in (lxd_profiles or dict()).items()} + modification_status_ = DetailedStatus.from_json(modification_status) if modification_status else None + network_interfaces_ = {k: NetworkInterface.from_json(v) for k, v in (network_interfaces or dict()).items()} + primary_controller_machine_ = primary_controller_machine + wants_vote_ = wants_vote + + # Validate arguments against known Juju API types. + if agent_status_ is not None and not isinstance(agent_status_, (dict, DetailedStatus)): + raise Exception("Expected agent_status_ to be a DetailedStatus, received: {}".format(type(agent_status_))) + + if base_ is not None and not isinstance(base_, (dict, Base)): + raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) + + if constraints_ is not None and not isinstance(constraints_, (bytes, str)): + raise Exception("Expected constraints_ to be a str, received: {}".format(type(constraints_))) + + if containers_ is not None and not isinstance(containers_, dict): + raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if dns_name_ is not None and not isinstance(dns_name_, (bytes, str)): + raise Exception("Expected dns_name_ to be a str, received: {}".format(type(dns_name_))) + + if hardware_ is not None and not isinstance(hardware_, (bytes, str)): + raise Exception("Expected hardware_ to be a str, received: {}".format(type(hardware_))) + + if has_vote_ is not None and not isinstance(has_vote_, bool): + raise Exception("Expected has_vote_ to be a bool, received: {}".format(type(has_vote_))) + + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if instance_status_ is not None and not isinstance(instance_status_, (dict, DetailedStatus)): + raise Exception("Expected instance_status_ to be a DetailedStatus, received: {}".format(type(instance_status_))) + + if ip_addresses_ is not None and not isinstance(ip_addresses_, (bytes, str, list)): + raise Exception("Expected ip_addresses_ to be a Sequence, received: {}".format(type(ip_addresses_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if lxd_profiles_ is not None and not isinstance(lxd_profiles_, dict): + raise Exception("Expected lxd_profiles_ to be a Mapping, received: {}".format(type(lxd_profiles_))) + + if modification_status_ is not None and not isinstance(modification_status_, (dict, DetailedStatus)): + raise Exception("Expected modification_status_ to be a DetailedStatus, received: {}".format(type(modification_status_))) + + if network_interfaces_ is not None and not isinstance(network_interfaces_, dict): + raise Exception("Expected network_interfaces_ to be a Mapping, received: {}".format(type(network_interfaces_))) + + if primary_controller_machine_ is not None and not isinstance(primary_controller_machine_, bool): + raise Exception("Expected primary_controller_machine_ to be a bool, received: {}".format(type(primary_controller_machine_))) + + if wants_vote_ is not None and not isinstance(wants_vote_, bool): + raise Exception("Expected wants_vote_ to be a bool, received: {}".format(type(wants_vote_))) + + self.agent_status = agent_status_ + self.base = base_ + self.constraints = constraints_ + self.containers = containers_ + self.display_name = display_name_ + self.dns_name = dns_name_ + self.hardware = hardware_ + self.has_vote = has_vote_ + self.hostname = hostname_ + self.id_ = id__ + self.instance_id = instance_id_ + self.instance_status = instance_status_ + self.ip_addresses = ip_addresses_ + self.jobs = jobs_ + self.lxd_profiles = lxd_profiles_ + self.modification_status = modification_status_ + self.network_interfaces = network_interfaces_ + self.primary_controller_machine = primary_controller_machine_ + self.wants_vote = wants_vote_ + self.unknown_fields = unknown_fields + + + +class MachineStorageId(Type): + _toSchema = {'attachment_tag': 'attachment-tag', 'machine_tag': 'machine-tag'} + _toPy = {'attachment-tag': 'attachment_tag', 'machine-tag': 'machine_tag'} + def __init__(self, attachment_tag=None, machine_tag=None, **unknown_fields): + ''' + attachment_tag : str + machine_tag : str + ''' + attachment_tag_ = attachment_tag + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if attachment_tag_ is not None and not isinstance(attachment_tag_, (bytes, str)): + raise Exception("Expected attachment_tag_ to be a str, received: {}".format(type(attachment_tag_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.attachment_tag = attachment_tag_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class MachineStorageIds(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): + ''' + ids : typing.Sequence[~MachineStorageId] + ''' + ids_ = [MachineStorageId.from_json(o) for o in ids or []] + + # Validate arguments against known Juju API types. + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + + self.ids = ids_ + self.unknown_fields = unknown_fields + + + +class MachineStorageIdsWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): + ''' + changes : typing.Sequence[~MachineStorageId] + error : Error + watcher_id : str + ''' + changes_ = [MachineStorageId.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class MachineStorageIdsWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineStorageIdsWatchResult] + ''' + results_ = [MachineStorageIdsWatchResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MapResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Mapping[str, typing.Any] + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, dict): + raise Exception("Expected result_ to be a Mapping, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class MapResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MapResult] + ''' + results_ = [MapResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MasterMigrationStatus(Type): + _toSchema = {'migration_id': 'migration-id', 'phase': 'phase', 'phase_changed_time': 'phase-changed-time', 'spec': 'spec'} + _toPy = {'migration-id': 'migration_id', 'phase': 'phase', 'phase-changed-time': 'phase_changed_time', 'spec': 'spec'} + def __init__(self, migration_id=None, phase=None, phase_changed_time=None, spec=None, **unknown_fields): + ''' + migration_id : str + phase : str + phase_changed_time : str + spec : MigrationSpec + ''' + migration_id_ = migration_id + phase_ = phase + phase_changed_time_ = phase_changed_time + spec_ = MigrationSpec.from_json(spec) if spec else None + + # Validate arguments against known Juju API types. + if migration_id_ is not None and not isinstance(migration_id_, (bytes, str)): + raise Exception("Expected migration_id_ to be a str, received: {}".format(type(migration_id_))) + + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + if phase_changed_time_ is not None and not isinstance(phase_changed_time_, (bytes, str)): + raise Exception("Expected phase_changed_time_ to be a str, received: {}".format(type(phase_changed_time_))) + + if spec_ is not None and not isinstance(spec_, (dict, MigrationSpec)): + raise Exception("Expected spec_ to be a MigrationSpec, received: {}".format(type(spec_))) + + self.migration_id = migration_id_ + self.phase = phase_ + self.phase_changed_time = phase_changed_time_ + self.spec = spec_ + self.unknown_fields = unknown_fields + + + +class MergeLeadershipSettingsBulkParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~MergeLeadershipSettingsParam] + ''' + params_ = [MergeLeadershipSettingsParam.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = unknown_fields + + + +class MergeLeadershipSettingsParam(Type): + _toSchema = {'application_tag': 'application-tag', 'settings': 'settings', 'unit_tag': 'unit-tag'} + _toPy = {'application-tag': 'application_tag', 'settings': 'settings', 'unit-tag': 'unit_tag'} + def __init__(self, application_tag=None, settings=None, unit_tag=None, **unknown_fields): + ''' + application_tag : str + settings : typing.Mapping[str, str] + unit_tag : str + ''' + application_tag_ = application_tag + settings_ = settings + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.application_tag = application_tag_ + self.settings = settings_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class MetadataImageIds(Type): + _toSchema = {'image_ids': 'image-ids'} + _toPy = {'image-ids': 'image_ids'} + def __init__(self, image_ids=None, **unknown_fields): + ''' + image_ids : typing.Sequence[str] + ''' + image_ids_ = image_ids + + # Validate arguments against known Juju API types. + if image_ids_ is not None and not isinstance(image_ids_, (bytes, str, list)): + raise Exception("Expected image_ids_ to be a Sequence, received: {}".format(type(image_ids_))) + + self.image_ids = image_ids_ + self.unknown_fields = unknown_fields + + + +class MetadataSaveParams(Type): + _toSchema = {'metadata': 'metadata'} + _toPy = {'metadata': 'metadata'} + def __init__(self, metadata=None, **unknown_fields): + ''' + metadata : typing.Sequence[~CloudImageMetadataList] + ''' + metadata_ = [CloudImageMetadataList.from_json(o) for o in metadata or []] + + # Validate arguments against known Juju API types. + if metadata_ is not None and not isinstance(metadata_, (bytes, str, list)): + raise Exception("Expected metadata_ to be a Sequence, received: {}".format(type(metadata_))) + + self.metadata = metadata_ + self.unknown_fields = unknown_fields + + + +class MeterStatus(Type): + _toSchema = {'color': 'color', 'message': 'message'} + _toPy = {'color': 'color', 'message': 'message'} + def __init__(self, color=None, message=None, **unknown_fields): + ''' + color : str + message : str + ''' + color_ = color + message_ = message + + # Validate arguments against known Juju API types. + if color_ is not None and not isinstance(color_, (bytes, str)): + raise Exception("Expected color_ to be a str, received: {}".format(type(color_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.color = color_ + self.message = message_ + self.unknown_fields = unknown_fields + + + +class MeterStatusParam(Type): + _toSchema = {'code': 'code', 'info': 'info', 'tag': 'tag'} + _toPy = {'code': 'code', 'info': 'info', 'tag': 'tag'} + def __init__(self, code=None, info=None, tag=None, **unknown_fields): + ''' + code : str + info : str + tag : str + ''' + code_ = code + info_ = info + tag_ = tag + + # Validate arguments against known Juju API types. + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.code = code_ + self.info = info_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class MeterStatusParams(Type): + _toSchema = {'statues': 'statues'} + _toPy = {'statues': 'statues'} + def __init__(self, statues=None, **unknown_fields): + ''' + statues : typing.Sequence[~MeterStatusParam] + ''' + statues_ = [MeterStatusParam.from_json(o) for o in statues or []] + + # Validate arguments against known Juju API types. + if statues_ is not None and not isinstance(statues_, (bytes, str, list)): + raise Exception("Expected statues_ to be a Sequence, received: {}".format(type(statues_))) + + self.statues = statues_ + self.unknown_fields = unknown_fields + + + +class MeterStatusResult(Type): + _toSchema = {'code': 'code', 'error': 'error', 'info': 'info'} + _toPy = {'code': 'code', 'error': 'error', 'info': 'info'} + def __init__(self, code=None, error=None, info=None, **unknown_fields): + ''' + code : str + error : Error + info : str + ''' + code_ = code + error_ = Error.from_json(error) if error else None + info_ = info + + # Validate arguments against known Juju API types. + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + self.code = code_ + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class MeterStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MeterStatusResult] + ''' + results_ = [MeterStatusResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class Metric(Type): + _toSchema = {'key': 'key', 'labels': 'labels', 'time': 'time', 'value': 'value'} + _toPy = {'key': 'key', 'labels': 'labels', 'time': 'time', 'value': 'value'} + def __init__(self, key=None, labels=None, time=None, value=None, **unknown_fields): + ''' + key : str + labels : typing.Mapping[str, str] + time : str + value : str + ''' + key_ = key + labels_ = labels + time_ = time + value_ = value + + # Validate arguments against known Juju API types. + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if labels_ is not None and not isinstance(labels_, dict): + raise Exception("Expected labels_ to be a Mapping, received: {}".format(type(labels_))) + + if time_ is not None and not isinstance(time_, (bytes, str)): + raise Exception("Expected time_ to be a str, received: {}".format(type(time_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.key = key_ + self.labels = labels_ + self.time = time_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class MetricBatch(Type): + _toSchema = {'charm_url': 'charm-url', 'created': 'created', 'metrics': 'metrics', 'uuid': 'uuid'} + _toPy = {'charm-url': 'charm_url', 'created': 'created', 'metrics': 'metrics', 'uuid': 'uuid'} + def __init__(self, charm_url=None, created=None, metrics=None, uuid=None, **unknown_fields): + ''' + charm_url : str + created : str + metrics : typing.Sequence[~Metric] + uuid : str + ''' + charm_url_ = charm_url + created_ = created + metrics_ = [Metric.from_json(o) for o in metrics or []] + uuid_ = uuid + + # Validate arguments against known Juju API types. + if charm_url_ is not None and not isinstance(charm_url_, (bytes, str)): + raise Exception("Expected charm_url_ to be a str, received: {}".format(type(charm_url_))) + + if created_ is not None and not isinstance(created_, (bytes, str)): + raise Exception("Expected created_ to be a str, received: {}".format(type(created_))) + + if metrics_ is not None and not isinstance(metrics_, (bytes, str, list)): + raise Exception("Expected metrics_ to be a Sequence, received: {}".format(type(metrics_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.charm_url = charm_url_ + self.created = created_ + self.metrics = metrics_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class MetricBatchParam(Type): + _toSchema = {'batch': 'batch', 'tag': 'tag'} + _toPy = {'batch': 'batch', 'tag': 'tag'} + def __init__(self, batch=None, tag=None, **unknown_fields): + ''' + batch : MetricBatch + tag : str + ''' + batch_ = MetricBatch.from_json(batch) if batch else None + tag_ = tag + + # Validate arguments against known Juju API types. + if batch_ is not None and not isinstance(batch_, (dict, MetricBatch)): + raise Exception("Expected batch_ to be a MetricBatch, received: {}".format(type(batch_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.batch = batch_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class MetricBatchParams(Type): + _toSchema = {'batches': 'batches'} + _toPy = {'batches': 'batches'} + def __init__(self, batches=None, **unknown_fields): + ''' + batches : typing.Sequence[~MetricBatchParam] + ''' + batches_ = [MetricBatchParam.from_json(o) for o in batches or []] + + # Validate arguments against known Juju API types. + if batches_ is not None and not isinstance(batches_, (bytes, str, list)): + raise Exception("Expected batches_ to be a Sequence, received: {}".format(type(batches_))) + + self.batches = batches_ + self.unknown_fields = unknown_fields + + + +class MetricResult(Type): + _toSchema = {'key': 'key', 'labels': 'labels', 'time': 'time', 'unit': 'unit', 'value': 'value'} + _toPy = {'key': 'key', 'labels': 'labels', 'time': 'time', 'unit': 'unit', 'value': 'value'} + def __init__(self, key=None, labels=None, time=None, unit=None, value=None, **unknown_fields): + ''' + key : str + labels : typing.Mapping[str, str] + time : str + unit : str + value : str + ''' + key_ = key + labels_ = labels + time_ = time + unit_ = unit + value_ = value + + # Validate arguments against known Juju API types. + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if labels_ is not None and not isinstance(labels_, dict): + raise Exception("Expected labels_ to be a Mapping, received: {}".format(type(labels_))) + + if time_ is not None and not isinstance(time_, (bytes, str)): + raise Exception("Expected time_ to be a str, received: {}".format(type(time_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.key = key_ + self.labels = labels_ + self.time = time_ + self.unit = unit_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class MetricResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~EntityMetrics] + ''' + results_ = [EntityMetrics.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MigrationModelInfo(Type): + _toSchema = {'agent_version': 'agent-version', 'controller_agent_version': 'controller-agent-version', 'facade_versions': 'facade-versions', 'name': 'name', 'owner_tag': 'owner-tag', 'uuid': 'uuid'} + _toPy = {'agent-version': 'agent_version', 'controller-agent-version': 'controller_agent_version', 'facade-versions': 'facade_versions', 'name': 'name', 'owner-tag': 'owner_tag', 'uuid': 'uuid'} + def __init__(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None, **unknown_fields): + ''' + agent_version : Number + controller_agent_version : Number + facade_versions : typing.Mapping[str, typing.Sequence[int]] + name : str + owner_tag : str + uuid : str + ''' + agent_version_ = Number.from_json(agent_version) if agent_version else None + controller_agent_version_ = Number.from_json(controller_agent_version) if controller_agent_version else None + facade_versions_ = facade_versions + name_ = name + owner_tag_ = owner_tag + uuid_ = uuid + + # Validate arguments against known Juju API types. + if agent_version_ is not None and not isinstance(agent_version_, (dict, Number)): + raise Exception("Expected agent_version_ to be a Number, received: {}".format(type(agent_version_))) + + if controller_agent_version_ is not None and not isinstance(controller_agent_version_, (dict, Number)): + raise Exception("Expected controller_agent_version_ to be a Number, received: {}".format(type(controller_agent_version_))) + + if facade_versions_ is not None and not isinstance(facade_versions_, dict): + raise Exception("Expected facade_versions_ to be a Mapping, received: {}".format(type(facade_versions_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.agent_version = agent_version_ + self.controller_agent_version = controller_agent_version_ + self.facade_versions = facade_versions_ + self.name = name_ + self.owner_tag = owner_tag_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class MigrationSourceInfo(Type): + _toSchema = {'addrs': 'addrs', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'local_related_models': 'local-related-models'} + _toPy = {'addrs': 'addrs', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'local-related-models': 'local_related_models'} + def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_tag=None, local_related_models=None, **unknown_fields): + ''' + addrs : typing.Sequence[str] + ca_cert : str + controller_alias : str + controller_tag : str + local_related_models : typing.Sequence[str] + ''' + addrs_ = addrs + ca_cert_ = ca_cert + controller_alias_ = controller_alias + controller_tag_ = controller_tag + local_related_models_ = local_related_models + + # Validate arguments against known Juju API types. + if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): + raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) + + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): + raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) + + if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): + raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) + + if local_related_models_ is not None and not isinstance(local_related_models_, (bytes, str, list)): + raise Exception("Expected local_related_models_ to be a Sequence, received: {}".format(type(local_related_models_))) + + self.addrs = addrs_ + self.ca_cert = ca_cert_ + self.controller_alias = controller_alias_ + self.controller_tag = controller_tag_ + self.local_related_models = local_related_models_ + self.unknown_fields = unknown_fields + + + +class MigrationSpec(Type): + _toSchema = {'model_tag': 'model-tag', 'target_info': 'target-info'} + _toPy = {'model-tag': 'model_tag', 'target-info': 'target_info'} + def __init__(self, model_tag=None, target_info=None, **unknown_fields): + ''' + model_tag : str + target_info : MigrationTargetInfo + ''' + model_tag_ = model_tag + target_info_ = MigrationTargetInfo.from_json(target_info) if target_info else None + + # Validate arguments against known Juju API types. + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if target_info_ is not None and not isinstance(target_info_, (dict, MigrationTargetInfo)): + raise Exception("Expected target_info_ to be a MigrationTargetInfo, received: {}".format(type(target_info_))) + + self.model_tag = model_tag_ + self.target_info = target_info_ + self.unknown_fields = unknown_fields + + + +class MigrationStatus(Type): + _toSchema = {'attempt': 'attempt', 'migration_id': 'migration-id', 'phase': 'phase', 'source_api_addrs': 'source-api-addrs', 'source_ca_cert': 'source-ca-cert', 'target_api_addrs': 'target-api-addrs', 'target_ca_cert': 'target-ca-cert'} + _toPy = {'attempt': 'attempt', 'migration-id': 'migration_id', 'phase': 'phase', 'source-api-addrs': 'source_api_addrs', 'source-ca-cert': 'source_ca_cert', 'target-api-addrs': 'target_api_addrs', 'target-ca-cert': 'target_ca_cert'} + def __init__(self, attempt=None, migration_id=None, phase=None, source_api_addrs=None, source_ca_cert=None, target_api_addrs=None, target_ca_cert=None, **unknown_fields): + ''' + attempt : int + migration_id : str + phase : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + target_api_addrs : typing.Sequence[str] + target_ca_cert : str + ''' + attempt_ = attempt + migration_id_ = migration_id + phase_ = phase + source_api_addrs_ = source_api_addrs + source_ca_cert_ = source_ca_cert + target_api_addrs_ = target_api_addrs + target_ca_cert_ = target_ca_cert + + # Validate arguments against known Juju API types. + if attempt_ is not None and not isinstance(attempt_, int): + raise Exception("Expected attempt_ to be a int, received: {}".format(type(attempt_))) + + if migration_id_ is not None and not isinstance(migration_id_, (bytes, str)): + raise Exception("Expected migration_id_ to be a str, received: {}".format(type(migration_id_))) + + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + if source_api_addrs_ is not None and not isinstance(source_api_addrs_, (bytes, str, list)): + raise Exception("Expected source_api_addrs_ to be a Sequence, received: {}".format(type(source_api_addrs_))) + + if source_ca_cert_ is not None and not isinstance(source_ca_cert_, (bytes, str)): + raise Exception("Expected source_ca_cert_ to be a str, received: {}".format(type(source_ca_cert_))) + + if target_api_addrs_ is not None and not isinstance(target_api_addrs_, (bytes, str, list)): + raise Exception("Expected target_api_addrs_ to be a Sequence, received: {}".format(type(target_api_addrs_))) + + if target_ca_cert_ is not None and not isinstance(target_ca_cert_, (bytes, str)): + raise Exception("Expected target_ca_cert_ to be a str, received: {}".format(type(target_ca_cert_))) + + self.attempt = attempt_ + self.migration_id = migration_id_ + self.phase = phase_ + self.source_api_addrs = source_api_addrs_ + self.source_ca_cert = source_ca_cert_ + self.target_api_addrs = target_api_addrs_ + self.target_ca_cert = target_ca_cert_ + self.unknown_fields = unknown_fields + + + +class MigrationTargetInfo(Type): + _toSchema = {'addrs': 'addrs', 'auth_tag': 'auth-tag', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'macaroons': 'macaroons', 'password': 'password'} + _toPy = {'addrs': 'addrs', 'auth-tag': 'auth_tag', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'macaroons': 'macaroons', 'password': 'password'} + def __init__(self, addrs=None, auth_tag=None, ca_cert=None, controller_alias=None, controller_tag=None, macaroons=None, password=None, **unknown_fields): + ''' + addrs : typing.Sequence[str] + auth_tag : str + ca_cert : str + controller_alias : str + controller_tag : str + macaroons : str + password : str + ''' + addrs_ = addrs + auth_tag_ = auth_tag + ca_cert_ = ca_cert + controller_alias_ = controller_alias + controller_tag_ = controller_tag + macaroons_ = macaroons + password_ = password + + # Validate arguments against known Juju API types. + if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): + raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) + + if auth_tag_ is not None and not isinstance(auth_tag_, (bytes, str)): + raise Exception("Expected auth_tag_ to be a str, received: {}".format(type(auth_tag_))) + + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): + raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) + + if controller_tag_ is not None and not isinstance(controller_tag_, (bytes, str)): + raise Exception("Expected controller_tag_ to be a str, received: {}".format(type(controller_tag_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str)): + raise Exception("Expected macaroons_ to be a str, received: {}".format(type(macaroons_))) + + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + + self.addrs = addrs_ + self.auth_tag = auth_tag_ + self.ca_cert = ca_cert_ + self.controller_alias = controller_alias_ + self.controller_tag = controller_tag_ + self.macaroons = macaroons_ + self.password = password_ + self.unknown_fields = unknown_fields + + + +class MinionReport(Type): + _toSchema = {'migration_id': 'migration-id', 'phase': 'phase', 'success': 'success'} + _toPy = {'migration-id': 'migration_id', 'phase': 'phase', 'success': 'success'} + def __init__(self, migration_id=None, phase=None, success=None, **unknown_fields): + ''' + migration_id : str + phase : str + success : bool + ''' + migration_id_ = migration_id + phase_ = phase + success_ = success + + # Validate arguments against known Juju API types. + if migration_id_ is not None and not isinstance(migration_id_, (bytes, str)): + raise Exception("Expected migration_id_ to be a str, received: {}".format(type(migration_id_))) + + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + if success_ is not None and not isinstance(success_, bool): + raise Exception("Expected success_ to be a bool, received: {}".format(type(success_))) + + self.migration_id = migration_id_ + self.phase = phase_ + self.success = success_ + self.unknown_fields = unknown_fields + + + +class MinionReports(Type): + _toSchema = {'failed': 'failed', 'migration_id': 'migration-id', 'phase': 'phase', 'success_count': 'success-count', 'unknown_count': 'unknown-count', 'unknown_sample': 'unknown-sample'} + _toPy = {'failed': 'failed', 'migration-id': 'migration_id', 'phase': 'phase', 'success-count': 'success_count', 'unknown-count': 'unknown_count', 'unknown-sample': 'unknown_sample'} + def __init__(self, failed=None, migration_id=None, phase=None, success_count=None, unknown_count=None, unknown_sample=None, **unknown_fields): + ''' + failed : typing.Sequence[str] + migration_id : str + phase : str + success_count : int + unknown_count : int + unknown_sample : typing.Sequence[str] + ''' + failed_ = failed + migration_id_ = migration_id + phase_ = phase + success_count_ = success_count + unknown_count_ = unknown_count + unknown_sample_ = unknown_sample + + # Validate arguments against known Juju API types. + if failed_ is not None and not isinstance(failed_, (bytes, str, list)): + raise Exception("Expected failed_ to be a Sequence, received: {}".format(type(failed_))) + + if migration_id_ is not None and not isinstance(migration_id_, (bytes, str)): + raise Exception("Expected migration_id_ to be a str, received: {}".format(type(migration_id_))) + + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + if success_count_ is not None and not isinstance(success_count_, int): + raise Exception("Expected success_count_ to be a int, received: {}".format(type(success_count_))) + + if unknown_count_ is not None and not isinstance(unknown_count_, int): + raise Exception("Expected unknown_count_ to be a int, received: {}".format(type(unknown_count_))) + + if unknown_sample_ is not None and not isinstance(unknown_sample_, (bytes, str, list)): + raise Exception("Expected unknown_sample_ to be a Sequence, received: {}".format(type(unknown_sample_))) + + self.failed = failed_ + self.migration_id = migration_id_ + self.phase = phase_ + self.success_count = success_count_ + self.unknown_count = unknown_count_ + self.unknown_sample = unknown_sample_ + self.unknown_fields = unknown_fields + + + +class Model(Type): + _toSchema = {'name': 'name', 'owner_tag': 'owner-tag', 'type_': 'type', 'uuid': 'uuid'} + _toPy = {'name': 'name', 'owner-tag': 'owner_tag', 'type': 'type_', 'uuid': 'uuid'} + def __init__(self, name=None, owner_tag=None, type_=None, uuid=None, **unknown_fields): + ''' + name : str + owner_tag : str + type_ : str + uuid : str + ''' + name_ = name + owner_tag_ = owner_tag + type__ = type_ + uuid_ = uuid + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.name = name_ + self.owner_tag = owner_tag_ + self.type_ = type__ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelAbstract(Type): + _toSchema = {'admins': 'admins', 'annotations': 'annotations', 'cloud': 'cloud', 'controller': 'controller', 'credential': 'credential', 'messages': 'messages', 'name': 'name', 'region': 'region', 'removed': 'removed', 'size': 'size', 'status': 'status', 'uuid': 'uuid'} + _toPy = {'admins': 'admins', 'annotations': 'annotations', 'cloud': 'cloud', 'controller': 'controller', 'credential': 'credential', 'messages': 'messages', 'name': 'name', 'region': 'region', 'removed': 'removed', 'size': 'size', 'status': 'status', 'uuid': 'uuid'} + def __init__(self, admins=None, annotations=None, cloud=None, controller=None, credential=None, messages=None, name=None, region=None, removed=None, size=None, status=None, uuid=None, **unknown_fields): + ''' + admins : typing.Sequence[str] + annotations : typing.Mapping[str, str] + cloud : str + controller : str + credential : str + messages : typing.Sequence[~ModelSummaryMessage] + name : str + region : str + removed : bool + size : ModelSummarySize + status : str + uuid : str + ''' + admins_ = admins + annotations_ = annotations + cloud_ = cloud + controller_ = controller + credential_ = credential + messages_ = [ModelSummaryMessage.from_json(o) for o in messages or []] + name_ = name + region_ = region + removed_ = removed + size_ = ModelSummarySize.from_json(size) if size else None + status_ = status + uuid_ = uuid + + # Validate arguments against known Juju API types. + if admins_ is not None and not isinstance(admins_, (bytes, str, list)): + raise Exception("Expected admins_ to be a Sequence, received: {}".format(type(admins_))) + + if annotations_ is not None and not isinstance(annotations_, dict): + raise Exception("Expected annotations_ to be a Mapping, received: {}".format(type(annotations_))) + + if cloud_ is not None and not isinstance(cloud_, (bytes, str)): + raise Exception("Expected cloud_ to be a str, received: {}".format(type(cloud_))) + + if controller_ is not None and not isinstance(controller_, (bytes, str)): + raise Exception("Expected controller_ to be a str, received: {}".format(type(controller_))) + + if credential_ is not None and not isinstance(credential_, (bytes, str)): + raise Exception("Expected credential_ to be a str, received: {}".format(type(credential_))) + + if messages_ is not None and not isinstance(messages_, (bytes, str, list)): + raise Exception("Expected messages_ to be a Sequence, received: {}".format(type(messages_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if removed_ is not None and not isinstance(removed_, bool): + raise Exception("Expected removed_ to be a bool, received: {}".format(type(removed_))) + + if size_ is not None and not isinstance(size_, (dict, ModelSummarySize)): + raise Exception("Expected size_ to be a ModelSummarySize, received: {}".format(type(size_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.admins = admins_ + self.annotations = annotations_ + self.cloud = cloud_ + self.controller = controller_ + self.credential = credential_ + self.messages = messages_ + self.name = name_ + self.region = region_ + self.removed = removed_ + self.size = size_ + self.status = status_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelAccess(Type): + _toSchema = {'access': 'access', 'model': 'model'} + _toPy = {'access': 'access', 'model': 'model'} + def __init__(self, access=None, model=None, **unknown_fields): + ''' + access : str + model : str + ''' + access_ = access + model_ = model + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + self.access = access_ + self.model = model_ + self.unknown_fields = unknown_fields + + + +class ModelApplicationInfo(Type): + _toSchema = {'name': 'name'} + _toPy = {'name': 'name'} + def __init__(self, name=None, **unknown_fields): + ''' + name : str + ''' + name_ = name + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.name = name_ + self.unknown_fields = unknown_fields + + + +class ModelArgs(Type): + _toSchema = {'model_tag': 'model-tag'} + _toPy = {'model-tag': 'model_tag'} + def __init__(self, model_tag=None, **unknown_fields): + ''' + model_tag : str + ''' + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + +class ModelBlockInfo(Type): + _toSchema = {'blocks': 'blocks', 'model_uuid': 'model-uuid', 'name': 'name', 'owner_tag': 'owner-tag'} + _toPy = {'blocks': 'blocks', 'model-uuid': 'model_uuid', 'name': 'name', 'owner-tag': 'owner_tag'} + def __init__(self, blocks=None, model_uuid=None, name=None, owner_tag=None, **unknown_fields): + ''' + blocks : typing.Sequence[str] + model_uuid : str + name : str + owner_tag : str + ''' + blocks_ = blocks + model_uuid_ = model_uuid + name_ = name + owner_tag_ = owner_tag + + # Validate arguments against known Juju API types. + if blocks_ is not None and not isinstance(blocks_, (bytes, str, list)): + raise Exception("Expected blocks_ to be a Sequence, received: {}".format(type(blocks_))) + + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + self.blocks = blocks_ + self.model_uuid = model_uuid_ + self.name = name_ + self.owner_tag = owner_tag_ + self.unknown_fields = unknown_fields + + + +class ModelBlockInfoList(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~ModelBlockInfo] + ''' + models_ = [ModelBlockInfo.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = unknown_fields + + + +class ModelConfigResult(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ModelConfigResults(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, ~ConfigValue] + ''' + config_ = {k: ConfigValue.from_json(v) for k, v in (config or dict()).items()} + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ModelCreateArgs(Type): + _toSchema = {'cloud_tag': 'cloud-tag', 'config': 'config', 'credential': 'credential', 'name': 'name', 'owner_tag': 'owner-tag', 'region': 'region'} + _toPy = {'cloud-tag': 'cloud_tag', 'config': 'config', 'credential': 'credential', 'name': 'name', 'owner-tag': 'owner_tag', 'region': 'region'} + def __init__(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None, **unknown_fields): + ''' + cloud_tag : str + config : typing.Mapping[str, typing.Any] + credential : str + name : str + owner_tag : str + region : str + ''' + cloud_tag_ = cloud_tag + config_ = config + credential_ = credential + name_ = name + owner_tag_ = owner_tag + region_ = region + + # Validate arguments against known Juju API types. + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if credential_ is not None and not isinstance(credential_, (bytes, str)): + raise Exception("Expected credential_ to be a str, received: {}".format(type(credential_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + self.cloud_tag = cloud_tag_ + self.config = config_ + self.credential = credential_ + self.name = name_ + self.owner_tag = owner_tag_ + self.region = region_ + self.unknown_fields = unknown_fields + + + +class ModelCredential(Type): + _toSchema = {'credential_tag': 'credential-tag', 'exists': 'exists', 'model_tag': 'model-tag', 'valid': 'valid'} + _toPy = {'credential-tag': 'credential_tag', 'exists': 'exists', 'model-tag': 'model_tag', 'valid': 'valid'} + def __init__(self, credential_tag=None, exists=None, model_tag=None, valid=None, **unknown_fields): + ''' + credential_tag : str + exists : bool + model_tag : str + valid : bool + ''' + credential_tag_ = credential_tag + exists_ = exists + model_tag_ = model_tag + valid_ = valid + + # Validate arguments against known Juju API types. + if credential_tag_ is not None and not isinstance(credential_tag_, (bytes, str)): + raise Exception("Expected credential_tag_ to be a str, received: {}".format(type(credential_tag_))) + + if exists_ is not None and not isinstance(exists_, bool): + raise Exception("Expected exists_ to be a bool, received: {}".format(type(exists_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if valid_ is not None and not isinstance(valid_, bool): + raise Exception("Expected valid_ to be a bool, received: {}".format(type(valid_))) + + self.credential_tag = credential_tag_ + self.exists = exists_ + self.model_tag = model_tag_ + self.valid = valid_ + self.unknown_fields = unknown_fields + + + +class ModelDefaultValues(Type): + _toSchema = {'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'config': 'config'} + _toPy = {'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'config': 'config'} + def __init__(self, cloud_region=None, cloud_tag=None, config=None, **unknown_fields): + ''' + cloud_region : str + cloud_tag : str + config : typing.Mapping[str, typing.Any] + ''' + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + config_ = config + + # Validate arguments against known Juju API types. + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ModelDefaults(Type): + _toSchema = {'controller': 'controller', 'default': 'default', 'regions': 'regions'} + _toPy = {'controller': 'controller', 'default': 'default', 'regions': 'regions'} + def __init__(self, controller=None, default=None, regions=None, **unknown_fields): + ''' + controller : Any + default : Any + regions : typing.Sequence[~RegionDefaults] + ''' + controller_ = controller + default_ = default + regions_ = [RegionDefaults.from_json(o) for o in regions or []] + + # Validate arguments against known Juju API types. + if regions_ is not None and not isinstance(regions_, (bytes, str, list)): + raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) + + self.controller = controller_ + self.default = default_ + self.regions = regions_ + self.unknown_fields = unknown_fields + + + +class ModelDefaultsResult(Type): + _toSchema = {'config': 'config', 'error': 'error'} + _toPy = {'config': 'config', 'error': 'error'} + def __init__(self, config=None, error=None, **unknown_fields): + ''' + config : typing.Mapping[str, ~ModelDefaults] + error : Error + ''' + config_ = {k: ModelDefaults.from_json(v) for k, v in (config or dict()).items()} + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.config = config_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ModelDefaultsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelDefaultsResult] + ''' + results_ = [ModelDefaultsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ModelEntityCount(Type): + _toSchema = {'count': 'count', 'entity': 'entity'} + _toPy = {'count': 'count', 'entity': 'entity'} + def __init__(self, count=None, entity=None, **unknown_fields): + ''' + count : int + entity : str + ''' + count_ = count + entity_ = entity + + # Validate arguments against known Juju API types. + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + if entity_ is not None and not isinstance(entity_, (bytes, str)): + raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + + self.count = count_ + self.entity = entity_ + self.unknown_fields = unknown_fields + + + +class ModelFilesystemInfo(Type): + _toSchema = {'detachable': 'detachable', 'id_': 'id', 'message': 'message', 'provider_id': 'provider-id', 'status': 'status'} + _toPy = {'detachable': 'detachable', 'id': 'id_', 'message': 'message', 'provider-id': 'provider_id', 'status': 'status'} + def __init__(self, detachable=None, id_=None, message=None, provider_id=None, status=None, **unknown_fields): + ''' + detachable : bool + id_ : str + message : str + provider_id : str + status : str + ''' + detachable_ = detachable + id__ = id_ + message_ = message + provider_id_ = provider_id + status_ = status + + # Validate arguments against known Juju API types. + if detachable_ is not None and not isinstance(detachable_, bool): + raise Exception("Expected detachable_ to be a bool, received: {}".format(type(detachable_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.detachable = detachable_ + self.id_ = id__ + self.message = message_ + self.provider_id = provider_id_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class ModelInfo(Type): + _toSchema = {'agent_version': 'agent-version', 'cloud_credential_tag': 'cloud-credential-tag', 'cloud_credential_validity': 'cloud-credential-validity', 'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'controller_uuid': 'controller-uuid', 'default_base': 'default-base', 'default_series': 'default-series', 'is_controller': 'is-controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', 'secret_backends': 'secret-backends', 'sla': 'sla', 'status': 'status', 'supported_features': 'supported-features', 'type_': 'type', 'users': 'users', 'uuid': 'uuid'} + _toPy = {'agent-version': 'agent_version', 'cloud-credential-tag': 'cloud_credential_tag', 'cloud-credential-validity': 'cloud_credential_validity', 'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'controller-uuid': 'controller_uuid', 'default-base': 'default_base', 'default-series': 'default_series', 'is-controller': 'is_controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', 'secret-backends': 'secret_backends', 'sla': 'sla', 'status': 'status', 'supported-features': 'supported_features', 'type': 'type_', 'users': 'users', 'uuid': 'uuid'} + def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_credential_validity=None, cloud_region=None, cloud_tag=None, controller_uuid=None, default_base=None, default_series=None, is_controller=None, life=None, machines=None, migration=None, name=None, owner_tag=None, provider_type=None, secret_backends=None, sla=None, status=None, supported_features=None, type_=None, users=None, uuid=None, **unknown_fields): + ''' + agent_version : Number + cloud_credential_tag : str + cloud_credential_validity : bool + cloud_region : str + cloud_tag : str + controller_uuid : str + default_base : str + default_series : str + is_controller : bool + life : str + machines : typing.Sequence[~ModelMachineInfo] + migration : ModelMigrationStatus + name : str + owner_tag : str + provider_type : str + secret_backends : typing.Sequence[~SecretBackendResult] + sla : ModelSLAInfo + status : EntityStatus + supported_features : typing.Sequence[~SupportedFeature] + type_ : str + users : typing.Sequence[~ModelUserInfo] + uuid : str + ''' + agent_version_ = Number.from_json(agent_version) if agent_version else None + cloud_credential_tag_ = cloud_credential_tag + cloud_credential_validity_ = cloud_credential_validity + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + controller_uuid_ = controller_uuid + default_base_ = default_base + default_series_ = default_series + is_controller_ = is_controller + life_ = life + machines_ = [ModelMachineInfo.from_json(o) for o in machines or []] + migration_ = ModelMigrationStatus.from_json(migration) if migration else None + name_ = name + owner_tag_ = owner_tag + provider_type_ = provider_type + secret_backends_ = [SecretBackendResult.from_json(o) for o in secret_backends or []] + sla_ = ModelSLAInfo.from_json(sla) if sla else None + status_ = EntityStatus.from_json(status) if status else None + supported_features_ = [SupportedFeature.from_json(o) for o in supported_features or []] + type__ = type_ + users_ = [ModelUserInfo.from_json(o) for o in users or []] + uuid_ = uuid + + # Validate arguments against known Juju API types. + if agent_version_ is not None and not isinstance(agent_version_, (dict, Number)): + raise Exception("Expected agent_version_ to be a Number, received: {}".format(type(agent_version_))) + + if cloud_credential_tag_ is not None and not isinstance(cloud_credential_tag_, (bytes, str)): + raise Exception("Expected cloud_credential_tag_ to be a str, received: {}".format(type(cloud_credential_tag_))) + + if cloud_credential_validity_ is not None and not isinstance(cloud_credential_validity_, bool): + raise Exception("Expected cloud_credential_validity_ to be a bool, received: {}".format(type(cloud_credential_validity_))) + + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): + raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) + + if default_base_ is not None and not isinstance(default_base_, (bytes, str)): + raise Exception("Expected default_base_ to be a str, received: {}".format(type(default_base_))) + + if default_series_ is not None and not isinstance(default_series_, (bytes, str)): + raise Exception("Expected default_series_ to be a str, received: {}".format(type(default_series_))) + + if is_controller_ is not None and not isinstance(is_controller_, bool): + raise Exception("Expected is_controller_ to be a bool, received: {}".format(type(is_controller_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + if migration_ is not None and not isinstance(migration_, (dict, ModelMigrationStatus)): + raise Exception("Expected migration_ to be a ModelMigrationStatus, received: {}".format(type(migration_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): + raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) + + if secret_backends_ is not None and not isinstance(secret_backends_, (bytes, str, list)): + raise Exception("Expected secret_backends_ to be a Sequence, received: {}".format(type(secret_backends_))) + + if sla_ is not None and not isinstance(sla_, (dict, ModelSLAInfo)): + raise Exception("Expected sla_ to be a ModelSLAInfo, received: {}".format(type(sla_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if supported_features_ is not None and not isinstance(supported_features_, (bytes, str, list)): + raise Exception("Expected supported_features_ to be a Sequence, received: {}".format(type(supported_features_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.agent_version = agent_version_ + self.cloud_credential_tag = cloud_credential_tag_ + self.cloud_credential_validity = cloud_credential_validity_ + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.controller_uuid = controller_uuid_ + self.default_base = default_base_ + self.default_series = default_series_ + self.is_controller = is_controller_ + self.life = life_ + self.machines = machines_ + self.migration = migration_ + self.name = name_ + self.owner_tag = owner_tag_ + self.provider_type = provider_type_ + self.secret_backends = secret_backends_ + self.sla = sla_ + self.status = status_ + self.supported_features = supported_features_ + self.type_ = type__ + self.users = users_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ModelInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ModelInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ModelInfo)): + raise Exception("Expected result_ to be a ModelInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ModelInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelInfoResult] + ''' + results_ = [ModelInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ModelInstanceTypesConstraint(Type): + _toSchema = {'value': 'value'} + _toPy = {'value': 'value'} + def __init__(self, value=None, **unknown_fields): + ''' + value : Value + ''' + value_ = Value.from_json(value) if value else None + + # Validate arguments against known Juju API types. + if value_ is not None and not isinstance(value_, (dict, Value)): + raise Exception("Expected value_ to be a Value, received: {}".format(type(value_))) + + self.value = value_ + self.unknown_fields = unknown_fields + + + +class ModelInstanceTypesConstraints(Type): + _toSchema = {'constraints': 'constraints'} + _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): + ''' + constraints : typing.Sequence[~ModelInstanceTypesConstraint] + ''' + constraints_ = [ModelInstanceTypesConstraint.from_json(o) for o in constraints or []] + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): + raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + + self.constraints = constraints_ + self.unknown_fields = unknown_fields + + + +class ModelMachineInfo(Type): + _toSchema = {'display_name': 'display-name', 'ha_primary': 'ha-primary', 'hardware': 'hardware', 'has_vote': 'has-vote', 'id_': 'id', 'instance_id': 'instance-id', 'message': 'message', 'status': 'status', 'wants_vote': 'wants-vote'} + _toPy = {'display-name': 'display_name', 'ha-primary': 'ha_primary', 'hardware': 'hardware', 'has-vote': 'has_vote', 'id': 'id_', 'instance-id': 'instance_id', 'message': 'message', 'status': 'status', 'wants-vote': 'wants_vote'} + def __init__(self, display_name=None, ha_primary=None, hardware=None, has_vote=None, id_=None, instance_id=None, message=None, status=None, wants_vote=None, **unknown_fields): + ''' + display_name : str + ha_primary : bool + hardware : MachineHardware + has_vote : bool + id_ : str + instance_id : str + message : str + status : str + wants_vote : bool + ''' + display_name_ = display_name + ha_primary_ = ha_primary + hardware_ = MachineHardware.from_json(hardware) if hardware else None + has_vote_ = has_vote + id__ = id_ + instance_id_ = instance_id + message_ = message + status_ = status + wants_vote_ = wants_vote + + # Validate arguments against known Juju API types. + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if ha_primary_ is not None and not isinstance(ha_primary_, bool): + raise Exception("Expected ha_primary_ to be a bool, received: {}".format(type(ha_primary_))) + + if hardware_ is not None and not isinstance(hardware_, (dict, MachineHardware)): + raise Exception("Expected hardware_ to be a MachineHardware, received: {}".format(type(hardware_))) + + if has_vote_ is not None and not isinstance(has_vote_, bool): + raise Exception("Expected has_vote_ to be a bool, received: {}".format(type(has_vote_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if wants_vote_ is not None and not isinstance(wants_vote_, bool): + raise Exception("Expected wants_vote_ to be a bool, received: {}".format(type(wants_vote_))) + + self.display_name = display_name_ + self.ha_primary = ha_primary_ + self.hardware = hardware_ + self.has_vote = has_vote_ + self.id_ = id__ + self.instance_id = instance_id_ + self.message = message_ + self.status = status_ + self.wants_vote = wants_vote_ + self.unknown_fields = unknown_fields + + + +class ModelMigrationStatus(Type): + _toSchema = {'end': 'end', 'start': 'start', 'status': 'status'} + _toPy = {'end': 'end', 'start': 'start', 'status': 'status'} + def __init__(self, end=None, start=None, status=None, **unknown_fields): + ''' + end : str + start : str + status : str + ''' + end_ = end + start_ = start + status_ = status + + # Validate arguments against known Juju API types. + if end_ is not None and not isinstance(end_, (bytes, str)): + raise Exception("Expected end_ to be a str, received: {}".format(type(end_))) + + if start_ is not None and not isinstance(start_, (bytes, str)): + raise Exception("Expected start_ to be a str, received: {}".format(type(start_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.end = end_ + self.start = start_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class ModelOperatorInfo(Type): + _toSchema = {'api_addresses': 'api-addresses', 'image_details': 'image-details', 'version': 'version'} + _toPy = {'api-addresses': 'api_addresses', 'image-details': 'image_details', 'version': 'version'} + def __init__(self, api_addresses=None, image_details=None, version=None, **unknown_fields): + ''' + api_addresses : typing.Sequence[str] + image_details : DockerImageInfo + version : Number + ''' + api_addresses_ = api_addresses + image_details_ = DockerImageInfo.from_json(image_details) if image_details else None + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) + + if image_details_ is not None and not isinstance(image_details_, (dict, DockerImageInfo)): + raise Exception("Expected image_details_ to be a DockerImageInfo, received: {}".format(type(image_details_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.api_addresses = api_addresses_ + self.image_details = image_details_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class ModelParam(Type): + _toSchema = {'model_tag': 'model-tag'} + _toPy = {'model-tag': 'model_tag'} + def __init__(self, model_tag=None, **unknown_fields): + ''' + model_tag : str + ''' + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + +class ModelResult(Type): + _toSchema = {'error': 'error', 'name': 'name', 'type_': 'type', 'uuid': 'uuid'} + _toPy = {'error': 'error', 'name': 'name', 'type': 'type_', 'uuid': 'uuid'} + def __init__(self, error=None, name=None, type_=None, uuid=None, **unknown_fields): + ''' + error : Error + name : str + type_ : str + uuid : str + ''' + error_ = Error.from_json(error) if error else None + name_ = name + type__ = type_ + uuid_ = uuid + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.error = error_ + self.name = name_ + self.type_ = type__ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelSLA(Type): + _toSchema = {'creds': 'creds', 'level': 'level', 'modelslainfo': 'ModelSLAInfo', 'owner': 'owner'} + _toPy = {'ModelSLAInfo': 'modelslainfo', 'creds': 'creds', 'level': 'level', 'owner': 'owner'} + def __init__(self, modelslainfo=None, creds=None, level=None, owner=None, **unknown_fields): + ''' + modelslainfo : ModelSLAInfo + creds : typing.Sequence[int] + level : str + owner : str + ''' + modelslainfo_ = ModelSLAInfo.from_json(modelslainfo) if modelslainfo else None + creds_ = creds + level_ = level + owner_ = owner + + # Validate arguments against known Juju API types. + if modelslainfo_ is not None and not isinstance(modelslainfo_, (dict, ModelSLAInfo)): + raise Exception("Expected modelslainfo_ to be a ModelSLAInfo, received: {}".format(type(modelslainfo_))) + + if creds_ is not None and not isinstance(creds_, (bytes, str, list)): + raise Exception("Expected creds_ to be a Sequence, received: {}".format(type(creds_))) + + if level_ is not None and not isinstance(level_, (bytes, str)): + raise Exception("Expected level_ to be a str, received: {}".format(type(level_))) + + if owner_ is not None and not isinstance(owner_, (bytes, str)): + raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + + self.modelslainfo = modelslainfo_ + self.creds = creds_ + self.level = level_ + self.owner = owner_ + self.unknown_fields = unknown_fields + + + +class ModelSLAInfo(Type): + _toSchema = {'level': 'level', 'owner': 'owner'} + _toPy = {'level': 'level', 'owner': 'owner'} + def __init__(self, level=None, owner=None, **unknown_fields): + ''' + level : str + owner : str + ''' + level_ = level + owner_ = owner + + # Validate arguments against known Juju API types. + if level_ is not None and not isinstance(level_, (bytes, str)): + raise Exception("Expected level_ to be a str, received: {}".format(type(level_))) + + if owner_ is not None and not isinstance(owner_, (bytes, str)): + raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + + self.level = level_ + self.owner = owner_ + self.unknown_fields = unknown_fields + + + +class ModelSequencesResult(Type): + _toSchema = {'sequences': 'sequences'} + _toPy = {'sequences': 'sequences'} + def __init__(self, sequences=None, **unknown_fields): + ''' + sequences : typing.Mapping[str, int] + ''' + sequences_ = sequences + + # Validate arguments against known Juju API types. + if sequences_ is not None and not isinstance(sequences_, dict): + raise Exception("Expected sequences_ to be a Mapping, received: {}".format(type(sequences_))) + + self.sequences = sequences_ + self.unknown_fields = unknown_fields + + + +class ModelSet(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ModelStatus(Type): + _toSchema = {'application_count': 'application-count', 'applications': 'applications', 'error': 'error', 'filesystems': 'filesystems', 'hosted_machine_count': 'hosted-machine-count', 'life': 'life', 'machines': 'machines', 'model_tag': 'model-tag', 'owner_tag': 'owner-tag', 'type_': 'type', 'unit_count': 'unit-count', 'volumes': 'volumes'} + _toPy = {'application-count': 'application_count', 'applications': 'applications', 'error': 'error', 'filesystems': 'filesystems', 'hosted-machine-count': 'hosted_machine_count', 'life': 'life', 'machines': 'machines', 'model-tag': 'model_tag', 'owner-tag': 'owner_tag', 'type': 'type_', 'unit-count': 'unit_count', 'volumes': 'volumes'} + def __init__(self, application_count=None, applications=None, error=None, filesystems=None, hosted_machine_count=None, life=None, machines=None, model_tag=None, owner_tag=None, type_=None, unit_count=None, volumes=None, **unknown_fields): + ''' + application_count : int + applications : typing.Sequence[~ModelApplicationInfo] + error : Error + filesystems : typing.Sequence[~ModelFilesystemInfo] + hosted_machine_count : int + life : str + machines : typing.Sequence[~ModelMachineInfo] + model_tag : str + owner_tag : str + type_ : str + unit_count : int + volumes : typing.Sequence[~ModelVolumeInfo] + ''' + application_count_ = application_count + applications_ = [ModelApplicationInfo.from_json(o) for o in applications or []] + error_ = Error.from_json(error) if error else None + filesystems_ = [ModelFilesystemInfo.from_json(o) for o in filesystems or []] + hosted_machine_count_ = hosted_machine_count + life_ = life + machines_ = [ModelMachineInfo.from_json(o) for o in machines or []] + model_tag_ = model_tag + owner_tag_ = owner_tag + type__ = type_ + unit_count_ = unit_count + volumes_ = [ModelVolumeInfo.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if application_count_ is not None and not isinstance(application_count_, int): + raise Exception("Expected application_count_ to be a int, received: {}".format(type(application_count_))) + + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + + if hosted_machine_count_ is not None and not isinstance(hosted_machine_count_, int): + raise Exception("Expected hosted_machine_count_ to be a int, received: {}".format(type(hosted_machine_count_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if unit_count_ is not None and not isinstance(unit_count_, int): + raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.application_count = application_count_ + self.applications = applications_ + self.error = error_ + self.filesystems = filesystems_ + self.hosted_machine_count = hosted_machine_count_ + self.life = life_ + self.machines = machines_ + self.model_tag = model_tag_ + self.owner_tag = owner_tag_ + self.type_ = type__ + self.unit_count = unit_count_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class ModelStatusInfo(Type): + _toSchema = {'available_version': 'available-version', 'cloud_tag': 'cloud-tag', 'meter_status': 'meter-status', 'model_status': 'model-status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type_': 'type', 'version': 'version'} + _toPy = {'available-version': 'available_version', 'cloud-tag': 'cloud_tag', 'meter-status': 'meter_status', 'model-status': 'model_status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type': 'type_', 'version': 'version'} + def __init__(self, available_version=None, cloud_tag=None, meter_status=None, model_status=None, name=None, region=None, sla=None, type_=None, version=None, **unknown_fields): + ''' + available_version : str + cloud_tag : str + meter_status : MeterStatus + model_status : DetailedStatus + name : str + region : str + sla : str + type_ : str + version : str + ''' + available_version_ = available_version + cloud_tag_ = cloud_tag + meter_status_ = MeterStatus.from_json(meter_status) if meter_status else None + model_status_ = DetailedStatus.from_json(model_status) if model_status else None + name_ = name + region_ = region + sla_ = sla + type__ = type_ + version_ = version + + # Validate arguments against known Juju API types. + if available_version_ is not None and not isinstance(available_version_, (bytes, str)): + raise Exception("Expected available_version_ to be a str, received: {}".format(type(available_version_))) + + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if meter_status_ is not None and not isinstance(meter_status_, (dict, MeterStatus)): + raise Exception("Expected meter_status_ to be a MeterStatus, received: {}".format(type(meter_status_))) + + if model_status_ is not None and not isinstance(model_status_, (dict, DetailedStatus)): + raise Exception("Expected model_status_ to be a DetailedStatus, received: {}".format(type(model_status_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if sla_ is not None and not isinstance(sla_, (bytes, str)): + raise Exception("Expected sla_ to be a str, received: {}".format(type(sla_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.available_version = available_version_ + self.cloud_tag = cloud_tag_ + self.meter_status = meter_status_ + self.model_status = model_status_ + self.name = name_ + self.region = region_ + self.sla = sla_ + self.type_ = type__ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class ModelStatusResults(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~ModelStatus] + ''' + models_ = [ModelStatus.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = unknown_fields + + + +class ModelSummariesRequest(Type): + _toSchema = {'all_': 'all', 'user_tag': 'user-tag'} + _toPy = {'all': 'all_', 'user-tag': 'user_tag'} + def __init__(self, all_=None, user_tag=None, **unknown_fields): + ''' + all_ : bool + user_tag : str + ''' + all__ = all_ + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.all_ = all__ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModelSummary(Type): + _toSchema = {'agent_version': 'agent-version', 'cloud_credential_tag': 'cloud-credential-tag', 'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'controller_uuid': 'controller-uuid', 'counts': 'counts', 'default_series': 'default-series', 'is_controller': 'is-controller', 'last_connection': 'last-connection', 'life': 'life', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', 'sla': 'sla', 'status': 'status', 'type_': 'type', 'user_access': 'user-access', 'uuid': 'uuid'} + _toPy = {'agent-version': 'agent_version', 'cloud-credential-tag': 'cloud_credential_tag', 'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'controller-uuid': 'controller_uuid', 'counts': 'counts', 'default-series': 'default_series', 'is-controller': 'is_controller', 'last-connection': 'last_connection', 'life': 'life', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', 'sla': 'sla', 'status': 'status', 'type': 'type_', 'user-access': 'user_access', 'uuid': 'uuid'} + def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_region=None, cloud_tag=None, controller_uuid=None, counts=None, default_series=None, is_controller=None, last_connection=None, life=None, migration=None, name=None, owner_tag=None, provider_type=None, sla=None, status=None, type_=None, user_access=None, uuid=None, **unknown_fields): + ''' + agent_version : Number + cloud_credential_tag : str + cloud_region : str + cloud_tag : str + controller_uuid : str + counts : typing.Sequence[~ModelEntityCount] + default_series : str + is_controller : bool + last_connection : str + life : str + migration : ModelMigrationStatus + name : str + owner_tag : str + provider_type : str + sla : ModelSLAInfo + status : EntityStatus + type_ : str + user_access : str + uuid : str + ''' + agent_version_ = Number.from_json(agent_version) if agent_version else None + cloud_credential_tag_ = cloud_credential_tag + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + controller_uuid_ = controller_uuid + counts_ = [ModelEntityCount.from_json(o) for o in counts or []] + default_series_ = default_series + is_controller_ = is_controller + last_connection_ = last_connection + life_ = life + migration_ = ModelMigrationStatus.from_json(migration) if migration else None + name_ = name + owner_tag_ = owner_tag + provider_type_ = provider_type + sla_ = ModelSLAInfo.from_json(sla) if sla else None + status_ = EntityStatus.from_json(status) if status else None + type__ = type_ + user_access_ = user_access + uuid_ = uuid + + # Validate arguments against known Juju API types. + if agent_version_ is not None and not isinstance(agent_version_, (dict, Number)): + raise Exception("Expected agent_version_ to be a Number, received: {}".format(type(agent_version_))) + + if cloud_credential_tag_ is not None and not isinstance(cloud_credential_tag_, (bytes, str)): + raise Exception("Expected cloud_credential_tag_ to be a str, received: {}".format(type(cloud_credential_tag_))) + + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): + raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) + + if counts_ is not None and not isinstance(counts_, (bytes, str, list)): + raise Exception("Expected counts_ to be a Sequence, received: {}".format(type(counts_))) + + if default_series_ is not None and not isinstance(default_series_, (bytes, str)): + raise Exception("Expected default_series_ to be a str, received: {}".format(type(default_series_))) + + if is_controller_ is not None and not isinstance(is_controller_, bool): + raise Exception("Expected is_controller_ to be a bool, received: {}".format(type(is_controller_))) + + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if migration_ is not None and not isinstance(migration_, (dict, ModelMigrationStatus)): + raise Exception("Expected migration_ to be a ModelMigrationStatus, received: {}".format(type(migration_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): + raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) + + if sla_ is not None and not isinstance(sla_, (dict, ModelSLAInfo)): + raise Exception("Expected sla_ to be a ModelSLAInfo, received: {}".format(type(sla_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if user_access_ is not None and not isinstance(user_access_, (bytes, str)): + raise Exception("Expected user_access_ to be a str, received: {}".format(type(user_access_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.agent_version = agent_version_ + self.cloud_credential_tag = cloud_credential_tag_ + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.controller_uuid = controller_uuid_ + self.counts = counts_ + self.default_series = default_series_ + self.is_controller = is_controller_ + self.last_connection = last_connection_ + self.life = life_ + self.migration = migration_ + self.name = name_ + self.owner_tag = owner_tag_ + self.provider_type = provider_type_ + self.sla = sla_ + self.status = status_ + self.type_ = type__ + self.user_access = user_access_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelSummaryMessage(Type): + _toSchema = {'agent': 'agent', 'message': 'message'} + _toPy = {'agent': 'agent', 'message': 'message'} + def __init__(self, agent=None, message=None, **unknown_fields): + ''' + agent : str + message : str + ''' + agent_ = agent + message_ = message + + # Validate arguments against known Juju API types. + if agent_ is not None and not isinstance(agent_, (bytes, str)): + raise Exception("Expected agent_ to be a str, received: {}".format(type(agent_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.agent = agent_ + self.message = message_ + self.unknown_fields = unknown_fields + + + +class ModelSummaryResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ModelSummary + ''' + error_ = Error.from_json(error) if error else None + result_ = ModelSummary.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ModelSummary)): + raise Exception("Expected result_ to be a ModelSummary, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ModelSummaryResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelSummaryResult] + ''' + results_ = [ModelSummaryResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ModelSummarySize(Type): + _toSchema = {'applications': 'applications', 'containers': 'containers', 'machines': 'machines', 'relations': 'relations', 'units': 'units'} + _toPy = {'applications': 'applications', 'containers': 'containers', 'machines': 'machines', 'relations': 'relations', 'units': 'units'} + def __init__(self, applications=None, containers=None, machines=None, relations=None, units=None, **unknown_fields): + ''' + applications : int + containers : int + machines : int + relations : int + units : int + ''' + applications_ = applications + containers_ = containers + machines_ = machines + relations_ = relations + units_ = units + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, int): + raise Exception("Expected applications_ to be a int, received: {}".format(type(applications_))) + + if containers_ is not None and not isinstance(containers_, int): + raise Exception("Expected containers_ to be a int, received: {}".format(type(containers_))) + + if machines_ is not None and not isinstance(machines_, int): + raise Exception("Expected machines_ to be a int, received: {}".format(type(machines_))) + + if relations_ is not None and not isinstance(relations_, int): + raise Exception("Expected relations_ to be a int, received: {}".format(type(relations_))) + + if units_ is not None and not isinstance(units_, int): + raise Exception("Expected units_ to be a int, received: {}".format(type(units_))) + + self.applications = applications_ + self.containers = containers_ + self.machines = machines_ + self.relations = relations_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class ModelTag(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): + ''' + + ''' + self.unknown_fields = unknown_fields + + + +class ModelUnset(Type): + _toSchema = {'keys': 'keys'} + _toPy = {'keys': 'keys'} + def __init__(self, keys=None, **unknown_fields): + ''' + keys : typing.Sequence[str] + ''' + keys_ = keys + + # Validate arguments against known Juju API types. + if keys_ is not None and not isinstance(keys_, (bytes, str, list)): + raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + + self.keys = keys_ + self.unknown_fields = unknown_fields + + + +class ModelUnsetKeys(Type): + _toSchema = {'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'keys': 'keys'} + _toPy = {'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'keys': 'keys'} + def __init__(self, cloud_region=None, cloud_tag=None, keys=None, **unknown_fields): + ''' + cloud_region : str + cloud_tag : str + keys : typing.Sequence[str] + ''' + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + keys_ = keys + + # Validate arguments against known Juju API types. + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if keys_ is not None and not isinstance(keys_, (bytes, str, list)): + raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.keys = keys_ + self.unknown_fields = unknown_fields + + + +class ModelUserInfo(Type): + _toSchema = {'access': 'access', 'display_name': 'display-name', 'last_connection': 'last-connection', 'model_tag': 'model-tag', 'user': 'user'} + _toPy = {'access': 'access', 'display-name': 'display_name', 'last-connection': 'last_connection', 'model-tag': 'model_tag', 'user': 'user'} + def __init__(self, access=None, display_name=None, last_connection=None, model_tag=None, user=None, **unknown_fields): + ''' + access : str + display_name : str + last_connection : str + model_tag : str + user : str + ''' + access_ = access + display_name_ = display_name + last_connection_ = last_connection + model_tag_ = model_tag + user_ = user + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.access = access_ + self.display_name = display_name_ + self.last_connection = last_connection_ + self.model_tag = model_tag_ + self.user = user_ + self.unknown_fields = unknown_fields + + + +class ModelUserInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ModelUserInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ModelUserInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ModelUserInfo)): + raise Exception("Expected result_ to be a ModelUserInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ModelUserInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelUserInfoResult] + ''' + results_ = [ModelUserInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ModelVolumeInfo(Type): + _toSchema = {'detachable': 'detachable', 'id_': 'id', 'message': 'message', 'provider_id': 'provider-id', 'status': 'status'} + _toPy = {'detachable': 'detachable', 'id': 'id_', 'message': 'message', 'provider-id': 'provider_id', 'status': 'status'} + def __init__(self, detachable=None, id_=None, message=None, provider_id=None, status=None, **unknown_fields): + ''' + detachable : bool + id_ : str + message : str + provider_id : str + status : str + ''' + detachable_ = detachable + id__ = id_ + message_ = message + provider_id_ = provider_id + status_ = status + + # Validate arguments against known Juju API types. + if detachable_ is not None and not isinstance(detachable_, bool): + raise Exception("Expected detachable_ to be a bool, received: {}".format(type(detachable_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.detachable = detachable_ + self.id_ = id__ + self.message = message_ + self.provider_id = provider_id_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class ModifyCloudAccess(Type): + _toSchema = {'access': 'access', 'action': 'action', 'cloud_tag': 'cloud-tag', 'user_tag': 'user-tag'} + _toPy = {'access': 'access', 'action': 'action', 'cloud-tag': 'cloud_tag', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, cloud_tag=None, user_tag=None, **unknown_fields): + ''' + access : str + action : str + cloud_tag : str + user_tag : str + ''' + access_ = access + action_ = action + cloud_tag_ = cloud_tag + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.access = access_ + self.action = action_ + self.cloud_tag = cloud_tag_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyCloudAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyCloudAccess] + ''' + changes_ = [ModifyCloudAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class ModifyControllerAccess(Type): + _toSchema = {'access': 'access', 'action': 'action', 'user_tag': 'user-tag'} + _toPy = {'access': 'access', 'action': 'action', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, user_tag=None, **unknown_fields): + ''' + access : str + action : str + user_tag : str + ''' + access_ = access + action_ = action + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.access = access_ + self.action = action_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyControllerAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyControllerAccess] + ''' + changes_ = [ModifyControllerAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class ModifyModelAccess(Type): + _toSchema = {'access': 'access', 'action': 'action', 'model_tag': 'model-tag', 'user_tag': 'user-tag'} + _toPy = {'access': 'access', 'action': 'action', 'model-tag': 'model_tag', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, model_tag=None, user_tag=None, **unknown_fields): + ''' + access : str + action : str + model_tag : str + user_tag : str + ''' + access_ = access + action_ = action + model_tag_ = model_tag + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.access = access_ + self.action = action_ + self.model_tag = model_tag_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyModelAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyModelAccess] + ''' + changes_ = [ModifyModelAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class ModifyOfferAccess(Type): + _toSchema = {'access': 'access', 'action': 'action', 'offer_url': 'offer-url', 'user_tag': 'user-tag'} + _toPy = {'access': 'access', 'action': 'action', 'offer-url': 'offer_url', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, offer_url=None, user_tag=None, **unknown_fields): + ''' + access : str + action : str + offer_url : str + user_tag : str + ''' + access_ = access + action_ = action + offer_url_ = offer_url + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + + self.access = access_ + self.action = action_ + self.offer_url = offer_url_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyOfferAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyOfferAccess] + ''' + changes_ = [ModifyOfferAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class ModifyUserSSHKeys(Type): + _toSchema = {'ssh_keys': 'ssh-keys', 'user': 'user'} + _toPy = {'ssh-keys': 'ssh_keys', 'user': 'user'} + def __init__(self, ssh_keys=None, user=None, **unknown_fields): + ''' + ssh_keys : typing.Sequence[str] + user : str + ''' + ssh_keys_ = ssh_keys + user_ = user + + # Validate arguments against known Juju API types. + if ssh_keys_ is not None and not isinstance(ssh_keys_, (bytes, str, list)): + raise Exception("Expected ssh_keys_ to be a Sequence, received: {}".format(type(ssh_keys_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.ssh_keys = ssh_keys_ + self.user = user_ + self.unknown_fields = unknown_fields + + + +class MoveSubnetsParam(Type): + _toSchema = {'force': 'force', 'space_tag': 'space-tag', 'subnets': 'subnets'} + _toPy = {'force': 'force', 'space-tag': 'space_tag', 'subnets': 'subnets'} + def __init__(self, force=None, space_tag=None, subnets=None, **unknown_fields): + ''' + force : bool + space_tag : str + subnets : typing.Sequence[str] + ''' + force_ = force + space_tag_ = space_tag + subnets_ = subnets + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): + raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.force = force_ + self.space_tag = space_tag_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +class MoveSubnetsParams(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~MoveSubnetsParam] + ''' + args_ = [MoveSubnetsParam.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class MoveSubnetsResult(Type): + _toSchema = {'error': 'error', 'moved_subnets': 'moved-subnets', 'new_space': 'new-space'} + _toPy = {'error': 'error', 'moved-subnets': 'moved_subnets', 'new-space': 'new_space'} + def __init__(self, error=None, moved_subnets=None, new_space=None, **unknown_fields): + ''' + error : Error + moved_subnets : typing.Sequence[~MovedSubnet] + new_space : str + ''' + error_ = Error.from_json(error) if error else None + moved_subnets_ = [MovedSubnet.from_json(o) for o in moved_subnets or []] + new_space_ = new_space + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if moved_subnets_ is not None and not isinstance(moved_subnets_, (bytes, str, list)): + raise Exception("Expected moved_subnets_ to be a Sequence, received: {}".format(type(moved_subnets_))) + + if new_space_ is not None and not isinstance(new_space_, (bytes, str)): + raise Exception("Expected new_space_ to be a str, received: {}".format(type(new_space_))) + + self.error = error_ + self.moved_subnets = moved_subnets_ + self.new_space = new_space_ + self.unknown_fields = unknown_fields + + + +class MoveSubnetsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MoveSubnetsResult] + ''' + results_ = [MoveSubnetsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class MovedSubnet(Type): + _toSchema = {'cidr': 'cidr', 'old_space': 'old-space', 'subnet': 'subnet'} + _toPy = {'cidr': 'cidr', 'old-space': 'old_space', 'subnet': 'subnet'} + def __init__(self, cidr=None, old_space=None, subnet=None, **unknown_fields): + ''' + cidr : str + old_space : str + subnet : str + ''' + cidr_ = cidr + old_space_ = old_space + subnet_ = subnet + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if old_space_ is not None and not isinstance(old_space_, (bytes, str)): + raise Exception("Expected old_space_ to be a str, received: {}".format(type(old_space_))) + + if subnet_ is not None and not isinstance(subnet_, (bytes, str)): + raise Exception("Expected subnet_ to be a str, received: {}".format(type(subnet_))) + + self.cidr = cidr_ + self.old_space = old_space_ + self.subnet = subnet_ + self.unknown_fields = unknown_fields + + + +class NetworkConfig(Type): + _toSchema = {'address': 'address', 'addresses': 'addresses', 'cidr': 'cidr', 'config_type': 'config-type', 'device_index': 'device-index', 'disabled': 'disabled', 'dns_search_domains': 'dns-search-domains', 'dns_servers': 'dns-servers', 'gateway_address': 'gateway-address', 'interface_name': 'interface-name', 'interface_type': 'interface-type', 'is_default_gateway': 'is-default-gateway', 'mac_address': 'mac-address', 'mtu': 'mtu', 'no_auto_start': 'no-auto-start', 'origin': 'origin', 'parent_interface_name': 'parent-interface-name', 'provider_address_id': 'provider-address-id', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'provider_subnet_id': 'provider-subnet-id', 'provider_vlan_id': 'provider-vlan-id', 'routes': 'routes', 'shadow_addresses': 'shadow-addresses', 'virtual_port_type': 'virtual-port-type', 'vlan_tag': 'vlan-tag'} + _toPy = {'address': 'address', 'addresses': 'addresses', 'cidr': 'cidr', 'config-type': 'config_type', 'device-index': 'device_index', 'disabled': 'disabled', 'dns-search-domains': 'dns_search_domains', 'dns-servers': 'dns_servers', 'gateway-address': 'gateway_address', 'interface-name': 'interface_name', 'interface-type': 'interface_type', 'is-default-gateway': 'is_default_gateway', 'mac-address': 'mac_address', 'mtu': 'mtu', 'no-auto-start': 'no_auto_start', 'origin': 'origin', 'parent-interface-name': 'parent_interface_name', 'provider-address-id': 'provider_address_id', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'provider-subnet-id': 'provider_subnet_id', 'provider-vlan-id': 'provider_vlan_id', 'routes': 'routes', 'shadow-addresses': 'shadow_addresses', 'virtual-port-type': 'virtual_port_type', 'vlan-tag': 'vlan_tag'} + def __init__(self, address=None, addresses=None, cidr=None, config_type=None, device_index=None, disabled=None, dns_search_domains=None, dns_servers=None, gateway_address=None, interface_name=None, interface_type=None, is_default_gateway=None, mac_address=None, mtu=None, no_auto_start=None, origin=None, parent_interface_name=None, provider_address_id=None, provider_id=None, provider_network_id=None, provider_space_id=None, provider_subnet_id=None, provider_vlan_id=None, routes=None, shadow_addresses=None, virtual_port_type=None, vlan_tag=None, **unknown_fields): + ''' + address : str + addresses : typing.Sequence[~Address] + cidr : str + config_type : str + device_index : int + disabled : bool + dns_search_domains : typing.Sequence[str] + dns_servers : typing.Sequence[str] + gateway_address : str + interface_name : str + interface_type : str + is_default_gateway : bool + mac_address : str + mtu : int + no_auto_start : bool + origin : str + parent_interface_name : str + provider_address_id : str + provider_id : str + provider_network_id : str + provider_space_id : str + provider_subnet_id : str + provider_vlan_id : str + routes : typing.Sequence[~NetworkRoute] + shadow_addresses : typing.Sequence[~Address] + virtual_port_type : str + vlan_tag : int + ''' + address_ = address + addresses_ = [Address.from_json(o) for o in addresses or []] + cidr_ = cidr + config_type_ = config_type + device_index_ = device_index + disabled_ = disabled + dns_search_domains_ = dns_search_domains + dns_servers_ = dns_servers + gateway_address_ = gateway_address + interface_name_ = interface_name + interface_type_ = interface_type + is_default_gateway_ = is_default_gateway + mac_address_ = mac_address + mtu_ = mtu + no_auto_start_ = no_auto_start + origin_ = origin + parent_interface_name_ = parent_interface_name + provider_address_id_ = provider_address_id + provider_id_ = provider_id + provider_network_id_ = provider_network_id + provider_space_id_ = provider_space_id + provider_subnet_id_ = provider_subnet_id + provider_vlan_id_ = provider_vlan_id + routes_ = [NetworkRoute.from_json(o) for o in routes or []] + shadow_addresses_ = [Address.from_json(o) for o in shadow_addresses or []] + virtual_port_type_ = virtual_port_type + vlan_tag_ = vlan_tag + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if config_type_ is not None and not isinstance(config_type_, (bytes, str)): + raise Exception("Expected config_type_ to be a str, received: {}".format(type(config_type_))) + + if device_index_ is not None and not isinstance(device_index_, int): + raise Exception("Expected device_index_ to be a int, received: {}".format(type(device_index_))) + + if disabled_ is not None and not isinstance(disabled_, bool): + raise Exception("Expected disabled_ to be a bool, received: {}".format(type(disabled_))) + + if dns_search_domains_ is not None and not isinstance(dns_search_domains_, (bytes, str, list)): + raise Exception("Expected dns_search_domains_ to be a Sequence, received: {}".format(type(dns_search_domains_))) + + if dns_servers_ is not None and not isinstance(dns_servers_, (bytes, str, list)): + raise Exception("Expected dns_servers_ to be a Sequence, received: {}".format(type(dns_servers_))) + + if gateway_address_ is not None and not isinstance(gateway_address_, (bytes, str)): + raise Exception("Expected gateway_address_ to be a str, received: {}".format(type(gateway_address_))) + + if interface_name_ is not None and not isinstance(interface_name_, (bytes, str)): + raise Exception("Expected interface_name_ to be a str, received: {}".format(type(interface_name_))) + + if interface_type_ is not None and not isinstance(interface_type_, (bytes, str)): + raise Exception("Expected interface_type_ to be a str, received: {}".format(type(interface_type_))) + + if is_default_gateway_ is not None and not isinstance(is_default_gateway_, bool): + raise Exception("Expected is_default_gateway_ to be a bool, received: {}".format(type(is_default_gateway_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + if mtu_ is not None and not isinstance(mtu_, int): + raise Exception("Expected mtu_ to be a int, received: {}".format(type(mtu_))) + + if no_auto_start_ is not None and not isinstance(no_auto_start_, bool): + raise Exception("Expected no_auto_start_ to be a bool, received: {}".format(type(no_auto_start_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if parent_interface_name_ is not None and not isinstance(parent_interface_name_, (bytes, str)): + raise Exception("Expected parent_interface_name_ to be a str, received: {}".format(type(parent_interface_name_))) + + if provider_address_id_ is not None and not isinstance(provider_address_id_, (bytes, str)): + raise Exception("Expected provider_address_id_ to be a str, received: {}".format(type(provider_address_id_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + + if provider_subnet_id_ is not None and not isinstance(provider_subnet_id_, (bytes, str)): + raise Exception("Expected provider_subnet_id_ to be a str, received: {}".format(type(provider_subnet_id_))) + + if provider_vlan_id_ is not None and not isinstance(provider_vlan_id_, (bytes, str)): + raise Exception("Expected provider_vlan_id_ to be a str, received: {}".format(type(provider_vlan_id_))) + + if routes_ is not None and not isinstance(routes_, (bytes, str, list)): + raise Exception("Expected routes_ to be a Sequence, received: {}".format(type(routes_))) + + if shadow_addresses_ is not None and not isinstance(shadow_addresses_, (bytes, str, list)): + raise Exception("Expected shadow_addresses_ to be a Sequence, received: {}".format(type(shadow_addresses_))) + + if virtual_port_type_ is not None and not isinstance(virtual_port_type_, (bytes, str)): + raise Exception("Expected virtual_port_type_ to be a str, received: {}".format(type(virtual_port_type_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + self.address = address_ + self.addresses = addresses_ + self.cidr = cidr_ + self.config_type = config_type_ + self.device_index = device_index_ + self.disabled = disabled_ + self.dns_search_domains = dns_search_domains_ + self.dns_servers = dns_servers_ + self.gateway_address = gateway_address_ + self.interface_name = interface_name_ + self.interface_type = interface_type_ + self.is_default_gateway = is_default_gateway_ + self.mac_address = mac_address_ + self.mtu = mtu_ + self.no_auto_start = no_auto_start_ + self.origin = origin_ + self.parent_interface_name = parent_interface_name_ + self.provider_address_id = provider_address_id_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.provider_subnet_id = provider_subnet_id_ + self.provider_vlan_id = provider_vlan_id_ + self.routes = routes_ + self.shadow_addresses = shadow_addresses_ + self.virtual_port_type = virtual_port_type_ + self.vlan_tag = vlan_tag_ + self.unknown_fields = unknown_fields + + + +class NetworkInfo(Type): + _toSchema = {'addresses': 'addresses', 'interface_name': 'interface-name', 'mac_address': 'mac-address'} + _toPy = {'addresses': 'addresses', 'interface-name': 'interface_name', 'mac-address': 'mac_address'} + def __init__(self, addresses=None, interface_name=None, mac_address=None, **unknown_fields): + ''' + addresses : typing.Sequence[~InterfaceAddress] + interface_name : str + mac_address : str + ''' + addresses_ = [InterfaceAddress.from_json(o) for o in addresses or []] + interface_name_ = interface_name + mac_address_ = mac_address + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if interface_name_ is not None and not isinstance(interface_name_, (bytes, str)): + raise Exception("Expected interface_name_ to be a str, received: {}".format(type(interface_name_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + self.addresses = addresses_ + self.interface_name = interface_name_ + self.mac_address = mac_address_ + self.unknown_fields = unknown_fields + + + +class NetworkInfoParams(Type): + _toSchema = {'bindings': 'bindings', 'relation_id': 'relation-id', 'unit': 'unit'} + _toPy = {'bindings': 'bindings', 'relation-id': 'relation_id', 'unit': 'unit'} + def __init__(self, bindings=None, relation_id=None, unit=None, **unknown_fields): + ''' + bindings : typing.Sequence[str] + relation_id : int + unit : str + ''' + bindings_ = bindings + relation_id_ = relation_id + unit_ = unit + + # Validate arguments against known Juju API types. + if bindings_ is not None and not isinstance(bindings_, (bytes, str, list)): + raise Exception("Expected bindings_ to be a Sequence, received: {}".format(type(bindings_))) + + if relation_id_ is not None and not isinstance(relation_id_, int): + raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.bindings = bindings_ + self.relation_id = relation_id_ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +class NetworkInfoResult(Type): + _toSchema = {'bind_addresses': 'bind-addresses', 'egress_subnets': 'egress-subnets', 'error': 'error', 'ingress_addresses': 'ingress-addresses'} + _toPy = {'bind-addresses': 'bind_addresses', 'egress-subnets': 'egress_subnets', 'error': 'error', 'ingress-addresses': 'ingress_addresses'} + def __init__(self, bind_addresses=None, egress_subnets=None, error=None, ingress_addresses=None, **unknown_fields): + ''' + bind_addresses : typing.Sequence[~NetworkInfo] + egress_subnets : typing.Sequence[str] + error : Error + ingress_addresses : typing.Sequence[str] + ''' + bind_addresses_ = [NetworkInfo.from_json(o) for o in bind_addresses or []] + egress_subnets_ = egress_subnets + error_ = Error.from_json(error) if error else None + ingress_addresses_ = ingress_addresses + + # Validate arguments against known Juju API types. + if bind_addresses_ is not None and not isinstance(bind_addresses_, (bytes, str, list)): + raise Exception("Expected bind_addresses_ to be a Sequence, received: {}".format(type(bind_addresses_))) + + if egress_subnets_ is not None and not isinstance(egress_subnets_, (bytes, str, list)): + raise Exception("Expected egress_subnets_ to be a Sequence, received: {}".format(type(egress_subnets_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if ingress_addresses_ is not None and not isinstance(ingress_addresses_, (bytes, str, list)): + raise Exception("Expected ingress_addresses_ to be a Sequence, received: {}".format(type(ingress_addresses_))) + + self.bind_addresses = bind_addresses_ + self.egress_subnets = egress_subnets_ + self.error = error_ + self.ingress_addresses = ingress_addresses_ + self.unknown_fields = unknown_fields + + + +class NetworkInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Mapping[str, ~NetworkInfoResult] + ''' + results_ = {k: NetworkInfoResult.from_json(v) for k, v in (results or dict()).items()} + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, dict): + raise Exception("Expected results_ to be a Mapping, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class NetworkInterface(Type): + _toSchema = {'dns_nameservers': 'dns-nameservers', 'gateway': 'gateway', 'ip_addresses': 'ip-addresses', 'is_up': 'is-up', 'mac_address': 'mac-address', 'space': 'space'} + _toPy = {'dns-nameservers': 'dns_nameservers', 'gateway': 'gateway', 'ip-addresses': 'ip_addresses', 'is-up': 'is_up', 'mac-address': 'mac_address', 'space': 'space'} + def __init__(self, dns_nameservers=None, gateway=None, ip_addresses=None, is_up=None, mac_address=None, space=None, **unknown_fields): + ''' + dns_nameservers : typing.Sequence[str] + gateway : str + ip_addresses : typing.Sequence[str] + is_up : bool + mac_address : str + space : str + ''' + dns_nameservers_ = dns_nameservers + gateway_ = gateway + ip_addresses_ = ip_addresses + is_up_ = is_up + mac_address_ = mac_address + space_ = space + + # Validate arguments against known Juju API types. + if dns_nameservers_ is not None and not isinstance(dns_nameservers_, (bytes, str, list)): + raise Exception("Expected dns_nameservers_ to be a Sequence, received: {}".format(type(dns_nameservers_))) + + if gateway_ is not None and not isinstance(gateway_, (bytes, str)): + raise Exception("Expected gateway_ to be a str, received: {}".format(type(gateway_))) + + if ip_addresses_ is not None and not isinstance(ip_addresses_, (bytes, str, list)): + raise Exception("Expected ip_addresses_ to be a Sequence, received: {}".format(type(ip_addresses_))) + + if is_up_ is not None and not isinstance(is_up_, bool): + raise Exception("Expected is_up_ to be a bool, received: {}".format(type(is_up_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + if space_ is not None and not isinstance(space_, (bytes, str)): + raise Exception("Expected space_ to be a str, received: {}".format(type(space_))) + + self.dns_nameservers = dns_nameservers_ + self.gateway = gateway_ + self.ip_addresses = ip_addresses_ + self.is_up = is_up_ + self.mac_address = mac_address_ + self.space = space_ + self.unknown_fields = unknown_fields + + + +class NetworkRoute(Type): + _toSchema = {'destination_cidr': 'destination-cidr', 'gateway_ip': 'gateway-ip', 'metric': 'metric'} + _toPy = {'destination-cidr': 'destination_cidr', 'gateway-ip': 'gateway_ip', 'metric': 'metric'} + def __init__(self, destination_cidr=None, gateway_ip=None, metric=None, **unknown_fields): + ''' + destination_cidr : str + gateway_ip : str + metric : int + ''' + destination_cidr_ = destination_cidr + gateway_ip_ = gateway_ip + metric_ = metric + + # Validate arguments against known Juju API types. + if destination_cidr_ is not None and not isinstance(destination_cidr_, (bytes, str)): + raise Exception("Expected destination_cidr_ to be a str, received: {}".format(type(destination_cidr_))) + + if gateway_ip_ is not None and not isinstance(gateway_ip_, (bytes, str)): + raise Exception("Expected gateway_ip_ to be a str, received: {}".format(type(gateway_ip_))) + + if metric_ is not None and not isinstance(metric_, int): + raise Exception("Expected metric_ to be a int, received: {}".format(type(metric_))) + + self.destination_cidr = destination_cidr_ + self.gateway_ip = gateway_ip_ + self.metric = metric_ + self.unknown_fields = unknown_fields + + + +class NotifyWatchResult(Type): + _toSchema = {'error': 'error', 'notifywatcherid': 'NotifyWatcherId'} + _toPy = {'NotifyWatcherId': 'notifywatcherid', 'error': 'error'} + def __init__(self, notifywatcherid=None, error=None, **unknown_fields): + ''' + notifywatcherid : str + error : Error + ''' + notifywatcherid_ = notifywatcherid + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if notifywatcherid_ is not None and not isinstance(notifywatcherid_, (bytes, str)): + raise Exception("Expected notifywatcherid_ to be a str, received: {}".format(type(notifywatcherid_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.notifywatcherid = notifywatcherid_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class NotifyWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~NotifyWatchResult] + ''' + results_ = [NotifyWatchResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class Number(Type): + _toSchema = {'build': 'Build', 'major': 'Major', 'minor': 'Minor', 'patch': 'Patch', 'tag': 'Tag'} + _toPy = {'Build': 'build', 'Major': 'major', 'Minor': 'minor', 'Patch': 'patch', 'Tag': 'tag'} + def __init__(self, build=None, major=None, minor=None, patch=None, tag=None, **unknown_fields): + ''' + build : int + major : int + minor : int + patch : int + tag : str + ''' + build_ = build + major_ = major + minor_ = minor + patch_ = patch + tag_ = tag + + # Validate arguments against known Juju API types. + if build_ is not None and not isinstance(build_, int): + raise Exception("Expected build_ to be a int, received: {}".format(type(build_))) + + if major_ is not None and not isinstance(major_, int): + raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) + + if minor_ is not None and not isinstance(minor_, int): + raise Exception("Expected minor_ to be a int, received: {}".format(type(minor_))) + + if patch_ is not None and not isinstance(patch_, int): + raise Exception("Expected patch_ to be a int, received: {}".format(type(patch_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.build = build_ + self.major = major_ + self.minor = minor_ + self.patch = patch_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class OfferArg(Type): + _toSchema = {'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'offer_uuid': 'offer-uuid'} + _toPy = {'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'offer-uuid': 'offer_uuid'} + def __init__(self, bakery_version=None, macaroons=None, offer_uuid=None, **unknown_fields): + ''' + bakery_version : int + macaroons : typing.Sequence[~Macaroon] + offer_uuid : str + ''' + bakery_version_ = bakery_version + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + offer_uuid_ = offer_uuid + + # Validate arguments against known Juju API types. + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) + + self.bakery_version = bakery_version_ + self.macaroons = macaroons_ + self.offer_uuid = offer_uuid_ + self.unknown_fields = unknown_fields + + + +class OfferArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~OfferArg] + ''' + args_ = [OfferArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class OfferConnection(Type): + _toSchema = {'endpoint': 'endpoint', 'ingress_subnets': 'ingress-subnets', 'relation_id': 'relation-id', 'source_model_tag': 'source-model-tag', 'status': 'status', 'username': 'username'} + _toPy = {'endpoint': 'endpoint', 'ingress-subnets': 'ingress_subnets', 'relation-id': 'relation_id', 'source-model-tag': 'source_model_tag', 'status': 'status', 'username': 'username'} + def __init__(self, endpoint=None, ingress_subnets=None, relation_id=None, source_model_tag=None, status=None, username=None, **unknown_fields): + ''' + endpoint : str + ingress_subnets : typing.Sequence[str] + relation_id : int + source_model_tag : str + status : EntityStatus + username : str + ''' + endpoint_ = endpoint + ingress_subnets_ = ingress_subnets + relation_id_ = relation_id + source_model_tag_ = source_model_tag + status_ = EntityStatus.from_json(status) if status else None + username_ = username + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if ingress_subnets_ is not None and not isinstance(ingress_subnets_, (bytes, str, list)): + raise Exception("Expected ingress_subnets_ to be a Sequence, received: {}".format(type(ingress_subnets_))) + + if relation_id_ is not None and not isinstance(relation_id_, int): + raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + + if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): + raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.endpoint = endpoint_ + self.ingress_subnets = ingress_subnets_ + self.relation_id = relation_id_ + self.source_model_tag = source_model_tag_ + self.status = status_ + self.username = username_ + self.unknown_fields = unknown_fields + + + +class OfferFilter(Type): + _toSchema = {'allowed_users': 'allowed-users', 'application_description': 'application-description', 'application_name': 'application-name', 'application_user': 'application-user', 'connected_users': 'connected-users', 'endpoints': 'endpoints', 'model_name': 'model-name', 'offer_name': 'offer-name', 'owner_name': 'owner-name'} + _toPy = {'allowed-users': 'allowed_users', 'application-description': 'application_description', 'application-name': 'application_name', 'application-user': 'application_user', 'connected-users': 'connected_users', 'endpoints': 'endpoints', 'model-name': 'model_name', 'offer-name': 'offer_name', 'owner-name': 'owner_name'} + def __init__(self, allowed_users=None, application_description=None, application_name=None, application_user=None, connected_users=None, endpoints=None, model_name=None, offer_name=None, owner_name=None, **unknown_fields): + ''' + allowed_users : typing.Sequence[str] + application_description : str + application_name : str + application_user : str + connected_users : typing.Sequence[str] + endpoints : typing.Sequence[~EndpointFilterAttributes] + model_name : str + offer_name : str + owner_name : str + ''' + allowed_users_ = allowed_users + application_description_ = application_description + application_name_ = application_name + application_user_ = application_user + connected_users_ = connected_users + endpoints_ = [EndpointFilterAttributes.from_json(o) for o in endpoints or []] + model_name_ = model_name + offer_name_ = offer_name + owner_name_ = owner_name + + # Validate arguments against known Juju API types. + if allowed_users_ is not None and not isinstance(allowed_users_, (bytes, str, list)): + raise Exception("Expected allowed_users_ to be a Sequence, received: {}".format(type(allowed_users_))) + + if application_description_ is not None and not isinstance(application_description_, (bytes, str)): + raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) + + if application_name_ is not None and not isinstance(application_name_, (bytes, str)): + raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) + + if application_user_ is not None and not isinstance(application_user_, (bytes, str)): + raise Exception("Expected application_user_ to be a str, received: {}".format(type(application_user_))) + + if connected_users_ is not None and not isinstance(connected_users_, (bytes, str, list)): + raise Exception("Expected connected_users_ to be a Sequence, received: {}".format(type(connected_users_))) + + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if model_name_ is not None and not isinstance(model_name_, (bytes, str)): + raise Exception("Expected model_name_ to be a str, received: {}".format(type(model_name_))) + + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + + if owner_name_ is not None and not isinstance(owner_name_, (bytes, str)): + raise Exception("Expected owner_name_ to be a str, received: {}".format(type(owner_name_))) + + self.allowed_users = allowed_users_ + self.application_description = application_description_ + self.application_name = application_name_ + self.application_user = application_user_ + self.connected_users = connected_users_ + self.endpoints = endpoints_ + self.model_name = model_name_ + self.offer_name = offer_name_ + self.owner_name = owner_name_ + self.unknown_fields = unknown_fields + + + +class OfferFilters(Type): + _toSchema = {'filters': 'Filters'} + _toPy = {'Filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~OfferFilter] + ''' + filters_ = [OfferFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ + self.unknown_fields = unknown_fields + + + +class OfferStatusChange(Type): + _toSchema = {'offer_name': 'offer-name', 'status': 'status'} + _toPy = {'offer-name': 'offer_name', 'status': 'status'} + def __init__(self, offer_name=None, status=None, **unknown_fields): + ''' + offer_name : str + status : EntityStatus + ''' + offer_name_ = offer_name + status_ = EntityStatus.from_json(status) if status else None + + # Validate arguments against known Juju API types. + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + self.offer_name = offer_name_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class OfferStatusWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): + ''' + changes : typing.Sequence[~OfferStatusChange] + error : Error + watcher_id : str + ''' + changes_ = [OfferStatusChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class OfferStatusWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OfferStatusWatchResult] + ''' + results_ = [OfferStatusWatchResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class OfferURLs(Type): + _toSchema = {'bakery_version': 'bakery-version', 'offer_urls': 'offer-urls'} + _toPy = {'bakery-version': 'bakery_version', 'offer-urls': 'offer_urls'} + def __init__(self, bakery_version=None, offer_urls=None, **unknown_fields): + ''' + bakery_version : int + offer_urls : typing.Sequence[str] + ''' + bakery_version_ = bakery_version + offer_urls_ = offer_urls + + # Validate arguments against known Juju API types. + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if offer_urls_ is not None and not isinstance(offer_urls_, (bytes, str, list)): + raise Exception("Expected offer_urls_ to be a Sequence, received: {}".format(type(offer_urls_))) + + self.bakery_version = bakery_version_ + self.offer_urls = offer_urls_ + self.unknown_fields = unknown_fields + + + +class OfferUserDetails(Type): + _toSchema = {'access': 'access', 'display_name': 'display-name', 'user': 'user'} + _toPy = {'access': 'access', 'display-name': 'display_name', 'user': 'user'} + def __init__(self, access=None, display_name=None, user=None, **unknown_fields): + ''' + access : str + display_name : str + user : str + ''' + access_ = access + display_name_ = display_name + user_ = user + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.access = access_ + self.display_name = display_name_ + self.user = user_ + self.unknown_fields = unknown_fields + + + +class OpenMachinePortRangesResult(Type): + _toSchema = {'error': 'error', 'unit_port_ranges': 'unit-port-ranges'} + _toPy = {'error': 'error', 'unit-port-ranges': 'unit_port_ranges'} + def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): + ''' + error : Error + unit_port_ranges : typing.Mapping[str, typing.Sequence[~OpenUnitPortRanges]] + ''' + error_ = Error.from_json(error) if error else None + unit_port_ranges_ = {k: OpenUnitPortRanges.from_json(v) for k, v in (unit_port_ranges or dict()).items()} + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if unit_port_ranges_ is not None and not isinstance(unit_port_ranges_, dict): + raise Exception("Expected unit_port_ranges_ to be a Mapping, received: {}".format(type(unit_port_ranges_))) + + self.error = error_ + self.unit_port_ranges = unit_port_ranges_ + self.unknown_fields = unknown_fields + + + +class OpenMachinePortRangesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OpenMachinePortRangesResult] + ''' + results_ = [OpenMachinePortRangesResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class OpenPortRangesByEndpointResult(Type): + _toSchema = {'error': 'error', 'unit_port_ranges': 'unit-port-ranges'} + _toPy = {'error': 'error', 'unit-port-ranges': 'unit_port_ranges'} + def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): + ''' + error : Error + unit_port_ranges : typing.Mapping[str, typing.Sequence[~OpenUnitPortRangesByEndpoint]] + ''' + error_ = Error.from_json(error) if error else None + unit_port_ranges_ = {k: OpenUnitPortRangesByEndpoint.from_json(v) for k, v in (unit_port_ranges or dict()).items()} + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if unit_port_ranges_ is not None and not isinstance(unit_port_ranges_, dict): + raise Exception("Expected unit_port_ranges_ to be a Mapping, received: {}".format(type(unit_port_ranges_))) + + self.error = error_ + self.unit_port_ranges = unit_port_ranges_ + self.unknown_fields = unknown_fields + + + +class OpenPortRangesByEndpointResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OpenPortRangesByEndpointResult] + ''' + results_ = [OpenPortRangesByEndpointResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class OpenUnitPortRanges(Type): + _toSchema = {'endpoint': 'endpoint', 'port_ranges': 'port-ranges', 'subnet_cidrs': 'subnet-cidrs'} + _toPy = {'endpoint': 'endpoint', 'port-ranges': 'port_ranges', 'subnet-cidrs': 'subnet_cidrs'} + def __init__(self, endpoint=None, port_ranges=None, subnet_cidrs=None, **unknown_fields): + ''' + endpoint : str + port_ranges : typing.Sequence[~PortRange] + subnet_cidrs : typing.Sequence[str] + ''' + endpoint_ = endpoint + port_ranges_ = [PortRange.from_json(o) for o in port_ranges or []] + subnet_cidrs_ = subnet_cidrs + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if port_ranges_ is not None and not isinstance(port_ranges_, (bytes, str, list)): + raise Exception("Expected port_ranges_ to be a Sequence, received: {}".format(type(port_ranges_))) + + if subnet_cidrs_ is not None and not isinstance(subnet_cidrs_, (bytes, str, list)): + raise Exception("Expected subnet_cidrs_ to be a Sequence, received: {}".format(type(subnet_cidrs_))) + + self.endpoint = endpoint_ + self.port_ranges = port_ranges_ + self.subnet_cidrs = subnet_cidrs_ + self.unknown_fields = unknown_fields + + + +class OpenUnitPortRangesByEndpoint(Type): + _toSchema = {'endpoint': 'endpoint', 'port_ranges': 'port-ranges'} + _toPy = {'endpoint': 'endpoint', 'port-ranges': 'port_ranges'} + def __init__(self, endpoint=None, port_ranges=None, **unknown_fields): + ''' + endpoint : str + port_ranges : typing.Sequence[~PortRange] + ''' + endpoint_ = endpoint + port_ranges_ = [PortRange.from_json(o) for o in port_ranges or []] + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if port_ranges_ is not None and not isinstance(port_ranges_, (bytes, str, list)): + raise Exception("Expected port_ranges_ to be a Sequence, received: {}".format(type(port_ranges_))) + + self.endpoint = endpoint_ + self.port_ranges = port_ranges_ + self.unknown_fields = unknown_fields + + + +class OperationQueryArgs(Type): + _toSchema = {'actions': 'actions', 'applications': 'applications', 'limit': 'limit', 'machines': 'machines', 'offset': 'offset', 'status': 'status', 'units': 'units'} + _toPy = {'actions': 'actions', 'applications': 'applications', 'limit': 'limit', 'machines': 'machines', 'offset': 'offset', 'status': 'status', 'units': 'units'} + def __init__(self, actions=None, applications=None, limit=None, machines=None, offset=None, status=None, units=None, **unknown_fields): + ''' + actions : typing.Sequence[str] + applications : typing.Sequence[str] + limit : int + machines : typing.Sequence[str] + offset : int + status : typing.Sequence[str] + units : typing.Sequence[str] + ''' + actions_ = actions + applications_ = applications + limit_ = limit + machines_ = machines + offset_ = offset + status_ = status + units_ = units + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + if limit_ is not None and not isinstance(limit_, int): + raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + if offset_ is not None and not isinstance(offset_, int): + raise Exception("Expected offset_ to be a int, received: {}".format(type(offset_))) + + if status_ is not None and not isinstance(status_, (bytes, str, list)): + raise Exception("Expected status_ to be a Sequence, received: {}".format(type(status_))) + + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + self.actions = actions_ + self.applications = applications_ + self.limit = limit_ + self.machines = machines_ + self.offset = offset_ + self.status = status_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class OperationResult(Type): + _toSchema = {'actions': 'actions', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'fail': 'fail', 'operation': 'operation', 'started': 'started', 'status': 'status', 'summary': 'summary'} + _toPy = {'actions': 'actions', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'fail': 'fail', 'operation': 'operation', 'started': 'started', 'status': 'status', 'summary': 'summary'} + def __init__(self, actions=None, completed=None, enqueued=None, error=None, fail=None, operation=None, started=None, status=None, summary=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionResult] + completed : str + enqueued : str + error : Error + fail : str + operation : str + started : str + status : str + summary : str + ''' + actions_ = [ActionResult.from_json(o) for o in actions or []] + completed_ = completed + enqueued_ = enqueued + error_ = Error.from_json(error) if error else None + fail_ = fail + operation_ = operation + started_ = started + status_ = status + summary_ = summary + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + if completed_ is not None and not isinstance(completed_, (bytes, str)): + raise Exception("Expected completed_ to be a str, received: {}".format(type(completed_))) + + if enqueued_ is not None and not isinstance(enqueued_, (bytes, str)): + raise Exception("Expected enqueued_ to be a str, received: {}".format(type(enqueued_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if fail_ is not None and not isinstance(fail_, (bytes, str)): + raise Exception("Expected fail_ to be a str, received: {}".format(type(fail_))) + + if operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + if started_ is not None and not isinstance(started_, (bytes, str)): + raise Exception("Expected started_ to be a str, received: {}".format(type(started_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if summary_ is not None and not isinstance(summary_, (bytes, str)): + raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + + self.actions = actions_ + self.completed = completed_ + self.enqueued = enqueued_ + self.error = error_ + self.fail = fail_ + self.operation = operation_ + self.started = started_ + self.status = status_ + self.summary = summary_ + self.unknown_fields = unknown_fields + + + +class OperationResults(Type): + _toSchema = {'results': 'results', 'truncated': 'truncated'} + _toPy = {'results': 'results', 'truncated': 'truncated'} + def __init__(self, results=None, truncated=None, **unknown_fields): + ''' + results : typing.Sequence[~OperationResult] + truncated : bool + ''' + results_ = [OperationResult.from_json(o) for o in results or []] + truncated_ = truncated + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + if truncated_ is not None and not isinstance(truncated_, bool): + raise Exception("Expected truncated_ to be a bool, received: {}".format(type(truncated_))) + + self.results = results_ + self.truncated = truncated_ + self.unknown_fields = unknown_fields + + + +class OperatorProvisioningInfo(Type): + _toSchema = {'api_addresses': 'api-addresses', 'base_image_details': 'base-image-details', 'charm_storage': 'charm-storage', 'error': 'error', 'image_details': 'image-details', 'tags': 'tags', 'version': 'version'} + _toPy = {'api-addresses': 'api_addresses', 'base-image-details': 'base_image_details', 'charm-storage': 'charm_storage', 'error': 'error', 'image-details': 'image_details', 'tags': 'tags', 'version': 'version'} + def __init__(self, api_addresses=None, base_image_details=None, charm_storage=None, error=None, image_details=None, tags=None, version=None, **unknown_fields): + ''' + api_addresses : typing.Sequence[str] + base_image_details : DockerImageInfo + charm_storage : KubernetesFilesystemParams + error : Error + image_details : DockerImageInfo + tags : typing.Mapping[str, str] + version : Number + ''' + api_addresses_ = api_addresses + base_image_details_ = DockerImageInfo.from_json(base_image_details) if base_image_details else None + charm_storage_ = KubernetesFilesystemParams.from_json(charm_storage) if charm_storage else None + error_ = Error.from_json(error) if error else None + image_details_ = DockerImageInfo.from_json(image_details) if image_details else None + tags_ = tags + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) + + if base_image_details_ is not None and not isinstance(base_image_details_, (dict, DockerImageInfo)): + raise Exception("Expected base_image_details_ to be a DockerImageInfo, received: {}".format(type(base_image_details_))) + + if charm_storage_ is not None and not isinstance(charm_storage_, (dict, KubernetesFilesystemParams)): + raise Exception("Expected charm_storage_ to be a KubernetesFilesystemParams, received: {}".format(type(charm_storage_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if image_details_ is not None and not isinstance(image_details_, (dict, DockerImageInfo)): + raise Exception("Expected image_details_ to be a DockerImageInfo, received: {}".format(type(image_details_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.api_addresses = api_addresses_ + self.base_image_details = base_image_details_ + self.charm_storage = charm_storage_ + self.error = error_ + self.image_details = image_details_ + self.tags = tags_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class OperatorProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OperatorProvisioningInfo] + ''' + results_ = [OperatorProvisioningInfo.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class Payload(Type): + _toSchema = {'class_': 'class', 'id_': 'id', 'labels': 'labels', 'machine': 'machine', 'status': 'status', 'type_': 'type', 'unit': 'unit'} + _toPy = {'class': 'class_', 'id': 'id_', 'labels': 'labels', 'machine': 'machine', 'status': 'status', 'type': 'type_', 'unit': 'unit'} + def __init__(self, class_=None, id_=None, labels=None, machine=None, status=None, type_=None, unit=None, **unknown_fields): + ''' + class_ : str + id_ : str + labels : typing.Sequence[str] + machine : str + status : str + type_ : str + unit : str + ''' + class__ = class_ + id__ = id_ + labels_ = labels + machine_ = machine + status_ = status + type__ = type_ + unit_ = unit + + # Validate arguments against known Juju API types. + if class__ is not None and not isinstance(class__, (bytes, str)): + raise Exception("Expected class__ to be a str, received: {}".format(type(class__))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if labels_ is not None and not isinstance(labels_, (bytes, str, list)): + raise Exception("Expected labels_ to be a Sequence, received: {}".format(type(labels_))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.class_ = class__ + self.id_ = id__ + self.labels = labels_ + self.machine = machine_ + self.status = status_ + self.type_ = type__ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +class PayloadListArgs(Type): + _toSchema = {'patterns': 'patterns'} + _toPy = {'patterns': 'patterns'} + def __init__(self, patterns=None, **unknown_fields): + ''' + patterns : typing.Sequence[str] + ''' + patterns_ = patterns + + # Validate arguments against known Juju API types. + if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): + raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + + self.patterns = patterns_ + self.unknown_fields = unknown_fields + + + +class PayloadListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Payload] + ''' + results_ = [Payload.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class PayloadResult(Type): + _toSchema = {'entity': 'Entity', 'error': 'error', 'not_found': 'not-found', 'payload': 'payload', 'tag': 'tag'} + _toPy = {'Entity': 'entity', 'error': 'error', 'not-found': 'not_found', 'payload': 'payload', 'tag': 'tag'} + def __init__(self, entity=None, error=None, not_found=None, payload=None, tag=None, **unknown_fields): + ''' + entity : Entity + error : Error + not_found : bool + payload : Payload + tag : str + ''' + entity_ = Entity.from_json(entity) if entity else None + error_ = Error.from_json(error) if error else None + not_found_ = not_found + payload_ = Payload.from_json(payload) if payload else None + tag_ = tag + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if not_found_ is not None and not isinstance(not_found_, bool): + raise Exception("Expected not_found_ to be a bool, received: {}".format(type(not_found_))) + + if payload_ is not None and not isinstance(payload_, (dict, Payload)): + raise Exception("Expected payload_ to be a Payload, received: {}".format(type(payload_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.entity = entity_ + self.error = error_ + self.not_found = not_found_ + self.payload = payload_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class PayloadResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~PayloadResult] + ''' + results_ = [PayloadResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class PendingResourceUpload(Type): + _toSchema = {'filename': 'Filename', 'name': 'Name', 'type_': 'Type'} + _toPy = {'Filename': 'filename', 'Name': 'name', 'Type': 'type_'} + def __init__(self, filename=None, name=None, type_=None, **unknown_fields): + ''' + filename : str + name : str + type_ : str + ''' + filename_ = filename + name_ = name + type__ = type_ + + # Validate arguments against known Juju API types. + if filename_ is not None and not isinstance(filename_, (bytes, str)): + raise Exception("Expected filename_ to be a str, received: {}".format(type(filename_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.filename = filename_ + self.name = name_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class PhaseResult(Type): + _toSchema = {'error': 'error', 'phase': 'phase'} + _toPy = {'error': 'error', 'phase': 'phase'} + def __init__(self, error=None, phase=None, **unknown_fields): + ''' + error : Error + phase : str + ''' + error_ = Error.from_json(error) if error else None + phase_ = phase + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + self.error = error_ + self.phase = phase_ + self.unknown_fields = unknown_fields + + + +class PhaseResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~PhaseResult] + ''' + results_ = [PhaseResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class PinApplicationResult(Type): + _toSchema = {'application_name': 'application-name', 'error': 'error'} + _toPy = {'application-name': 'application_name', 'error': 'error'} + def __init__(self, application_name=None, error=None, **unknown_fields): + ''' + application_name : str + error : Error + ''' + application_name_ = application_name + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if application_name_ is not None and not isinstance(application_name_, (bytes, str)): + raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.application_name = application_name_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class PinApplicationsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~PinApplicationResult] + ''' + results_ = [PinApplicationResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class PinnedLeadershipResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Mapping[str, typing.Sequence[str]] + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, dict): + raise Exception("Expected result_ to be a Mapping, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class Placement(Type): + _toSchema = {'directive': 'directive', 'scope': 'scope'} + _toPy = {'directive': 'directive', 'scope': 'scope'} + def __init__(self, directive=None, scope=None, **unknown_fields): + ''' + directive : str + scope : str + ''' + directive_ = directive + scope_ = scope + + # Validate arguments against known Juju API types. + if directive_ is not None and not isinstance(directive_, (bytes, str)): + raise Exception("Expected directive_ to be a str, received: {}".format(type(directive_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + self.directive = directive_ + self.scope = scope_ + self.unknown_fields = unknown_fields + + + +class PodSpec(Type): + _toSchema = {'spec': 'spec', 'tag': 'tag'} + _toPy = {'spec': 'spec', 'tag': 'tag'} + def __init__(self, spec=None, tag=None, **unknown_fields): + ''' + spec : str + tag : str + ''' + spec_ = spec + tag_ = tag + + # Validate arguments against known Juju API types. + if spec_ is not None and not isinstance(spec_, (bytes, str)): + raise Exception("Expected spec_ to be a str, received: {}".format(type(spec_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.spec = spec_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class PortRange(Type): + _toSchema = {'from_port': 'from-port', 'protocol': 'protocol', 'to_port': 'to-port'} + _toPy = {'from-port': 'from_port', 'protocol': 'protocol', 'to-port': 'to_port'} + def __init__(self, from_port=None, protocol=None, to_port=None, **unknown_fields): + ''' + from_port : int + protocol : str + to_port : int + ''' + from_port_ = from_port + protocol_ = protocol + to_port_ = to_port + + # Validate arguments against known Juju API types. + if from_port_ is not None and not isinstance(from_port_, int): + raise Exception("Expected from_port_ to be a int, received: {}".format(type(from_port_))) + + if protocol_ is not None and not isinstance(protocol_, (bytes, str)): + raise Exception("Expected protocol_ to be a str, received: {}".format(type(protocol_))) + + if to_port_ is not None and not isinstance(to_port_, int): + raise Exception("Expected to_port_ to be a int, received: {}".format(type(to_port_))) + + self.from_port = from_port_ + self.protocol = protocol_ + self.to_port = to_port_ + self.unknown_fields = unknown_fields + + + +class PrechecksArgs(Type): + _toSchema = {'target_controller_version': 'target-controller-version'} + _toPy = {'target-controller-version': 'target_controller_version'} + def __init__(self, target_controller_version=None, **unknown_fields): + ''' + target_controller_version : Number + ''' + target_controller_version_ = Number.from_json(target_controller_version) if target_controller_version else None + + # Validate arguments against known Juju API types. + if target_controller_version_ is not None and not isinstance(target_controller_version_, (dict, Number)): + raise Exception("Expected target_controller_version_ to be a Number, received: {}".format(type(target_controller_version_))) + + self.target_controller_version = target_controller_version_ + self.unknown_fields = unknown_fields + + + +class ProcessRelations(Type): + _toSchema = {'controller_alias': 'controller-alias'} + _toPy = {'controller-alias': 'controller_alias'} + def __init__(self, controller_alias=None, **unknown_fields): + ''' + controller_alias : str + ''' + controller_alias_ = controller_alias + + # Validate arguments against known Juju API types. + if controller_alias_ is not None and not isinstance(controller_alias_, (bytes, str)): + raise Exception("Expected controller_alias_ to be a str, received: {}".format(type(controller_alias_))) + + self.controller_alias = controller_alias_ + self.unknown_fields = unknown_fields + + + +class ProfileInfoResult(Type): + _toSchema = {'application_name': 'application-name', 'error': 'error', 'profile': 'profile', 'revision': 'revision'} + _toPy = {'application-name': 'application_name', 'error': 'error', 'profile': 'profile', 'revision': 'revision'} + def __init__(self, application_name=None, error=None, profile=None, revision=None, **unknown_fields): + ''' + application_name : str + error : Error + profile : CharmLXDProfile + revision : int + ''' + application_name_ = application_name + error_ = Error.from_json(error) if error else None + profile_ = CharmLXDProfile.from_json(profile) if profile else None + revision_ = revision + + # Validate arguments against known Juju API types. + if application_name_ is not None and not isinstance(application_name_, (bytes, str)): + raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if profile_ is not None and not isinstance(profile_, (dict, CharmLXDProfile)): + raise Exception("Expected profile_ to be a CharmLXDProfile, received: {}".format(type(profile_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + self.application_name = application_name_ + self.error = error_ + self.profile = profile_ + self.revision = revision_ + self.unknown_fields = unknown_fields + + + +class ProviderInterfaceInfo(Type): + _toSchema = {'interface_name': 'interface-name', 'mac_address': 'mac-address', 'provider_id': 'provider-id'} + _toPy = {'interface-name': 'interface_name', 'mac-address': 'mac_address', 'provider-id': 'provider_id'} + def __init__(self, interface_name=None, mac_address=None, provider_id=None, **unknown_fields): + ''' + interface_name : str + mac_address : str + provider_id : str + ''' + interface_name_ = interface_name + mac_address_ = mac_address + provider_id_ = provider_id + + # Validate arguments against known Juju API types. + if interface_name_ is not None and not isinstance(interface_name_, (bytes, str)): + raise Exception("Expected interface_name_ to be a str, received: {}".format(type(interface_name_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + self.interface_name = interface_name_ + self.mac_address = mac_address_ + self.provider_id = provider_id_ + self.unknown_fields = unknown_fields + + + +class ProviderInterfaceInfoResult(Type): + _toSchema = {'error': 'error', 'interfaces': 'interfaces', 'machine_tag': 'machine-tag'} + _toPy = {'error': 'error', 'interfaces': 'interfaces', 'machine-tag': 'machine_tag'} + def __init__(self, error=None, interfaces=None, machine_tag=None, **unknown_fields): + ''' + error : Error + interfaces : typing.Sequence[~ProviderInterfaceInfo] + machine_tag : str + ''' + error_ = Error.from_json(error) if error else None + interfaces_ = [ProviderInterfaceInfo.from_json(o) for o in interfaces or []] + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if interfaces_ is not None and not isinstance(interfaces_, (bytes, str, list)): + raise Exception("Expected interfaces_ to be a Sequence, received: {}".format(type(interfaces_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.error = error_ + self.interfaces = interfaces_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class ProviderInterfaceInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProviderInterfaceInfoResult] + ''' + results_ = [ProviderInterfaceInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ProviderNetworkConfig(Type): + _toSchema = {'config': 'config', 'tag': 'tag'} + _toPy = {'config': 'config', 'tag': 'tag'} + def __init__(self, config=None, tag=None, **unknown_fields): + ''' + config : typing.Sequence[~NetworkConfig] + tag : str + ''' + config_ = [NetworkConfig.from_json(o) for o in config or []] + tag_ = tag + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, (bytes, str, list)): + raise Exception("Expected config_ to be a Sequence, received: {}".format(type(config_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.config = config_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfo(Type): + _toSchema = {'base': 'base', 'charm_lxd_profiles': 'charm-lxd-profiles', 'cloudinit_userdata': 'cloudinit-userdata', 'constraints': 'constraints', 'controller_config': 'controller-config', 'endpoint_bindings': 'endpoint-bindings', 'image_metadata': 'image-metadata', 'jobs': 'jobs', 'placement': 'placement', 'provisioningnetworktopology': 'ProvisioningNetworkTopology', 'root_disk': 'root-disk', 'space_subnets': 'space-subnets', 'subnet_zones': 'subnet-zones', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} + _toPy = {'ProvisioningNetworkTopology': 'provisioningnetworktopology', 'base': 'base', 'charm-lxd-profiles': 'charm_lxd_profiles', 'cloudinit-userdata': 'cloudinit_userdata', 'constraints': 'constraints', 'controller-config': 'controller_config', 'endpoint-bindings': 'endpoint_bindings', 'image-metadata': 'image_metadata', 'jobs': 'jobs', 'placement': 'placement', 'root-disk': 'root_disk', 'space-subnets': 'space_subnets', 'subnet-zones': 'subnet_zones', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, provisioningnetworktopology=None, base=None, charm_lxd_profiles=None, cloudinit_userdata=None, constraints=None, controller_config=None, endpoint_bindings=None, image_metadata=None, jobs=None, placement=None, root_disk=None, space_subnets=None, subnet_zones=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): + ''' + provisioningnetworktopology : ProvisioningNetworkTopology + base : Base + charm_lxd_profiles : typing.Sequence[str] + cloudinit_userdata : typing.Mapping[str, typing.Any] + constraints : Value + controller_config : typing.Mapping[str, typing.Any] + endpoint_bindings : typing.Mapping[str, str] + image_metadata : typing.Sequence[~CloudImageMetadata] + jobs : typing.Sequence[str] + placement : str + root_disk : VolumeParams + space_subnets : typing.Mapping[str, typing.Sequence[str]] + subnet_zones : typing.Mapping[str, typing.Sequence[str]] + tags : typing.Mapping[str, str] + volume_attachments : typing.Sequence[~VolumeAttachmentParams] + volumes : typing.Sequence[~VolumeParams] + ''' + provisioningnetworktopology_ = ProvisioningNetworkTopology.from_json(provisioningnetworktopology) if provisioningnetworktopology else None + base_ = Base.from_json(base) if base else None + charm_lxd_profiles_ = charm_lxd_profiles + cloudinit_userdata_ = cloudinit_userdata + constraints_ = Value.from_json(constraints) if constraints else None + controller_config_ = controller_config + endpoint_bindings_ = endpoint_bindings + image_metadata_ = [CloudImageMetadata.from_json(o) for o in image_metadata or []] + jobs_ = jobs + placement_ = placement + root_disk_ = VolumeParams.from_json(root_disk) if root_disk else None + space_subnets_ = space_subnets + subnet_zones_ = subnet_zones + tags_ = tags + volume_attachments_ = [VolumeAttachmentParams.from_json(o) for o in volume_attachments or []] + volumes_ = [VolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if provisioningnetworktopology_ is not None and not isinstance(provisioningnetworktopology_, (dict, ProvisioningNetworkTopology)): + raise Exception("Expected provisioningnetworktopology_ to be a ProvisioningNetworkTopology, received: {}".format(type(provisioningnetworktopology_))) + + if base_ is not None and not isinstance(base_, (dict, Base)): + raise Exception("Expected base_ to be a Base, received: {}".format(type(base_))) + + if charm_lxd_profiles_ is not None and not isinstance(charm_lxd_profiles_, (bytes, str, list)): + raise Exception("Expected charm_lxd_profiles_ to be a Sequence, received: {}".format(type(charm_lxd_profiles_))) + + if cloudinit_userdata_ is not None and not isinstance(cloudinit_userdata_, dict): + raise Exception("Expected cloudinit_userdata_ to be a Mapping, received: {}".format(type(cloudinit_userdata_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if controller_config_ is not None and not isinstance(controller_config_, dict): + raise Exception("Expected controller_config_ to be a Mapping, received: {}".format(type(controller_config_))) + + if endpoint_bindings_ is not None and not isinstance(endpoint_bindings_, dict): + raise Exception("Expected endpoint_bindings_ to be a Mapping, received: {}".format(type(endpoint_bindings_))) + + if image_metadata_ is not None and not isinstance(image_metadata_, (bytes, str, list)): + raise Exception("Expected image_metadata_ to be a Sequence, received: {}".format(type(image_metadata_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if placement_ is not None and not isinstance(placement_, (bytes, str)): + raise Exception("Expected placement_ to be a str, received: {}".format(type(placement_))) + + if root_disk_ is not None and not isinstance(root_disk_, (dict, VolumeParams)): + raise Exception("Expected root_disk_ to be a VolumeParams, received: {}".format(type(root_disk_))) + + if space_subnets_ is not None and not isinstance(space_subnets_, dict): + raise Exception("Expected space_subnets_ to be a Mapping, received: {}".format(type(space_subnets_))) + + if subnet_zones_ is not None and not isinstance(subnet_zones_, dict): + raise Exception("Expected subnet_zones_ to be a Mapping, received: {}".format(type(subnet_zones_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if volume_attachments_ is not None and not isinstance(volume_attachments_, (bytes, str, list)): + raise Exception("Expected volume_attachments_ to be a Sequence, received: {}".format(type(volume_attachments_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.provisioningnetworktopology = provisioningnetworktopology_ + self.base = base_ + self.charm_lxd_profiles = charm_lxd_profiles_ + self.cloudinit_userdata = cloudinit_userdata_ + self.constraints = constraints_ + self.controller_config = controller_config_ + self.endpoint_bindings = endpoint_bindings_ + self.image_metadata = image_metadata_ + self.jobs = jobs_ + self.placement = placement_ + self.root_disk = root_disk_ + self.space_subnets = space_subnets_ + self.subnet_zones = subnet_zones_ + self.tags = tags_ + self.volume_attachments = volume_attachments_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ProvisioningInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ProvisioningInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, ProvisioningInfo)): + raise Exception("Expected result_ to be a ProvisioningInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProvisioningInfoResult] + ''' + results_ = [ProvisioningInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ProvisioningNetworkTopology(Type): + _toSchema = {'space_subnets': 'space-subnets', 'subnet_zones': 'subnet-zones'} + _toPy = {'space-subnets': 'space_subnets', 'subnet-zones': 'subnet_zones'} + def __init__(self, space_subnets=None, subnet_zones=None, **unknown_fields): + ''' + space_subnets : typing.Mapping[str, typing.Sequence[str]] + subnet_zones : typing.Mapping[str, typing.Sequence[str]] + ''' + space_subnets_ = space_subnets + subnet_zones_ = subnet_zones + + # Validate arguments against known Juju API types. + if space_subnets_ is not None and not isinstance(space_subnets_, dict): + raise Exception("Expected space_subnets_ to be a Mapping, received: {}".format(type(space_subnets_))) + + if subnet_zones_ is not None and not isinstance(subnet_zones_, dict): + raise Exception("Expected subnet_zones_ to be a Mapping, received: {}".format(type(subnet_zones_))) + + self.space_subnets = space_subnets_ + self.subnet_zones = subnet_zones_ + self.unknown_fields = unknown_fields + + + +class ProvisioningScriptParams(Type): + _toSchema = {'data_dir': 'data-dir', 'disable_package_commands': 'disable-package-commands', 'machine_id': 'machine-id', 'nonce': 'nonce'} + _toPy = {'data-dir': 'data_dir', 'disable-package-commands': 'disable_package_commands', 'machine-id': 'machine_id', 'nonce': 'nonce'} + def __init__(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None, **unknown_fields): + ''' + data_dir : str + disable_package_commands : bool + machine_id : str + nonce : str + ''' + data_dir_ = data_dir + disable_package_commands_ = disable_package_commands + machine_id_ = machine_id + nonce_ = nonce + + # Validate arguments against known Juju API types. + if data_dir_ is not None and not isinstance(data_dir_, (bytes, str)): + raise Exception("Expected data_dir_ to be a str, received: {}".format(type(data_dir_))) + + if disable_package_commands_ is not None and not isinstance(disable_package_commands_, bool): + raise Exception("Expected disable_package_commands_ to be a bool, received: {}".format(type(disable_package_commands_))) + + if machine_id_ is not None and not isinstance(machine_id_, (bytes, str)): + raise Exception("Expected machine_id_ to be a str, received: {}".format(type(machine_id_))) + + if nonce_ is not None and not isinstance(nonce_, (bytes, str)): + raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) + + self.data_dir = data_dir_ + self.disable_package_commands = disable_package_commands_ + self.machine_id = machine_id_ + self.nonce = nonce_ + self.unknown_fields = unknown_fields + + + +class ProvisioningScriptResult(Type): + _toSchema = {'script': 'script'} + _toPy = {'script': 'script'} + def __init__(self, script=None, **unknown_fields): + ''' + script : str + ''' + script_ = script + + # Validate arguments against known Juju API types. + if script_ is not None and not isinstance(script_, (bytes, str)): + raise Exception("Expected script_ to be a str, received: {}".format(type(script_))) + + self.script = script_ + self.unknown_fields = unknown_fields + + + +class Proxy(Type): + _toSchema = {'config': 'config', 'type_': 'type'} + _toPy = {'config': 'config', 'type': 'type_'} + def __init__(self, config=None, type_=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + type_ : str + ''' + config_ = config + type__ = type_ + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.config = config_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class ProxyConfig(Type): + _toSchema = {'ftp': 'ftp', 'http': 'http', 'https': 'https', 'no_proxy': 'no-proxy'} + _toPy = {'ftp': 'ftp', 'http': 'http', 'https': 'https', 'no-proxy': 'no_proxy'} + def __init__(self, ftp=None, http=None, https=None, no_proxy=None, **unknown_fields): + ''' + ftp : str + http : str + https : str + no_proxy : str + ''' + ftp_ = ftp + http_ = http + https_ = https + no_proxy_ = no_proxy + + # Validate arguments against known Juju API types. + if ftp_ is not None and not isinstance(ftp_, (bytes, str)): + raise Exception("Expected ftp_ to be a str, received: {}".format(type(ftp_))) + + if http_ is not None and not isinstance(http_, (bytes, str)): + raise Exception("Expected http_ to be a str, received: {}".format(type(http_))) + + if https_ is not None and not isinstance(https_, (bytes, str)): + raise Exception("Expected https_ to be a str, received: {}".format(type(https_))) + + if no_proxy_ is not None and not isinstance(no_proxy_, (bytes, str)): + raise Exception("Expected no_proxy_ to be a str, received: {}".format(type(no_proxy_))) + + self.ftp = ftp_ + self.http = http_ + self.https = https_ + self.no_proxy = no_proxy_ + self.unknown_fields = unknown_fields + + + +class ProxyConfigResult(Type): + _toSchema = {'apt_mirror': 'apt-mirror', 'apt_proxy_settings': 'apt-proxy-settings', 'error': 'error', 'juju_proxy_settings': 'juju-proxy-settings', 'legacy_proxy_settings': 'legacy-proxy-settings', 'snap_proxy_settings': 'snap-proxy-settings', 'snap_store_assertions': 'snap-store-assertions', 'snap_store_id': 'snap-store-id', 'snap_store_proxy_url': 'snap-store-proxy-url'} + _toPy = {'apt-mirror': 'apt_mirror', 'apt-proxy-settings': 'apt_proxy_settings', 'error': 'error', 'juju-proxy-settings': 'juju_proxy_settings', 'legacy-proxy-settings': 'legacy_proxy_settings', 'snap-proxy-settings': 'snap_proxy_settings', 'snap-store-assertions': 'snap_store_assertions', 'snap-store-id': 'snap_store_id', 'snap-store-proxy-url': 'snap_store_proxy_url'} + def __init__(self, apt_mirror=None, apt_proxy_settings=None, error=None, juju_proxy_settings=None, legacy_proxy_settings=None, snap_proxy_settings=None, snap_store_assertions=None, snap_store_id=None, snap_store_proxy_url=None, **unknown_fields): + ''' + apt_mirror : str + apt_proxy_settings : ProxyConfig + error : Error + juju_proxy_settings : ProxyConfig + legacy_proxy_settings : ProxyConfig + snap_proxy_settings : ProxyConfig + snap_store_assertions : str + snap_store_id : str + snap_store_proxy_url : str + ''' + apt_mirror_ = apt_mirror + apt_proxy_settings_ = ProxyConfig.from_json(apt_proxy_settings) if apt_proxy_settings else None + error_ = Error.from_json(error) if error else None + juju_proxy_settings_ = ProxyConfig.from_json(juju_proxy_settings) if juju_proxy_settings else None + legacy_proxy_settings_ = ProxyConfig.from_json(legacy_proxy_settings) if legacy_proxy_settings else None + snap_proxy_settings_ = ProxyConfig.from_json(snap_proxy_settings) if snap_proxy_settings else None + snap_store_assertions_ = snap_store_assertions + snap_store_id_ = snap_store_id + snap_store_proxy_url_ = snap_store_proxy_url + + # Validate arguments against known Juju API types. + if apt_mirror_ is not None and not isinstance(apt_mirror_, (bytes, str)): + raise Exception("Expected apt_mirror_ to be a str, received: {}".format(type(apt_mirror_))) + + if apt_proxy_settings_ is not None and not isinstance(apt_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected apt_proxy_settings_ to be a ProxyConfig, received: {}".format(type(apt_proxy_settings_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if juju_proxy_settings_ is not None and not isinstance(juju_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected juju_proxy_settings_ to be a ProxyConfig, received: {}".format(type(juju_proxy_settings_))) + + if legacy_proxy_settings_ is not None and not isinstance(legacy_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected legacy_proxy_settings_ to be a ProxyConfig, received: {}".format(type(legacy_proxy_settings_))) + + if snap_proxy_settings_ is not None and not isinstance(snap_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected snap_proxy_settings_ to be a ProxyConfig, received: {}".format(type(snap_proxy_settings_))) + + if snap_store_assertions_ is not None and not isinstance(snap_store_assertions_, (bytes, str)): + raise Exception("Expected snap_store_assertions_ to be a str, received: {}".format(type(snap_store_assertions_))) + + if snap_store_id_ is not None and not isinstance(snap_store_id_, (bytes, str)): + raise Exception("Expected snap_store_id_ to be a str, received: {}".format(type(snap_store_id_))) + + if snap_store_proxy_url_ is not None and not isinstance(snap_store_proxy_url_, (bytes, str)): + raise Exception("Expected snap_store_proxy_url_ to be a str, received: {}".format(type(snap_store_proxy_url_))) + + self.apt_mirror = apt_mirror_ + self.apt_proxy_settings = apt_proxy_settings_ + self.error = error_ + self.juju_proxy_settings = juju_proxy_settings_ + self.legacy_proxy_settings = legacy_proxy_settings_ + self.snap_proxy_settings = snap_proxy_settings_ + self.snap_store_assertions = snap_store_assertions_ + self.snap_store_id = snap_store_id_ + self.snap_store_proxy_url = snap_store_proxy_url_ + self.unknown_fields = unknown_fields + + + +class ProxyConfigResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProxyConfigResult] + ''' + results_ = [ProxyConfigResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class QueryApplicationOffersResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationOfferAdminDetails] + ''' + results_ = [ApplicationOfferAdminDetails.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RebootActionResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : str + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (bytes, str)): + raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RebootActionResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RebootActionResult] + ''' + results_ = [RebootActionResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RecordAgentStartInformationArg(Type): + _toSchema = {'hostname': 'hostname', 'tag': 'tag'} + _toPy = {'hostname': 'hostname', 'tag': 'tag'} + def __init__(self, hostname=None, tag=None, **unknown_fields): + ''' + hostname : str + tag : str + ''' + hostname_ = hostname + tag_ = tag + + # Validate arguments against known Juju API types. + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.hostname = hostname_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class RecordAgentStartInformationArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RecordAgentStartInformationArg] + ''' + args_ = [RecordAgentStartInformationArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class RedirectInfoResult(Type): + _toSchema = {'ca_cert': 'ca-cert', 'servers': 'servers'} + _toPy = {'ca-cert': 'ca_cert', 'servers': 'servers'} + def __init__(self, ca_cert=None, servers=None, **unknown_fields): + ''' + ca_cert : str + servers : typing.Sequence[~HostPort] + ''' + ca_cert_ = ca_cert + servers_ = [HostPort.from_json(o) for o in servers or []] + + # Validate arguments against known Juju API types. + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if servers_ is not None and not isinstance(servers_, (bytes, str, list)): + raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + + self.ca_cert = ca_cert_ + self.servers = servers_ + self.unknown_fields = unknown_fields + + + +class RegionDefaults(Type): + _toSchema = {'region_name': 'region-name', 'value': 'value'} + _toPy = {'region-name': 'region_name', 'value': 'value'} + def __init__(self, region_name=None, value=None, **unknown_fields): + ''' + region_name : str + value : Any + ''' + region_name_ = region_name + value_ = value + + # Validate arguments against known Juju API types. + if region_name_ is not None and not isinstance(region_name_, (bytes, str)): + raise Exception("Expected region_name_ to be a str, received: {}".format(type(region_name_))) + + self.region_name = region_name_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class RegisterRemoteRelationArg(Type): + _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'consume_version': 'consume-version', 'local_endpoint_name': 'local-endpoint-name', 'macaroons': 'macaroons', 'offer_uuid': 'offer-uuid', 'relation_token': 'relation-token', 'remote_endpoint': 'remote-endpoint', 'remote_space': 'remote-space', 'source_model_tag': 'source-model-tag'} + _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'consume-version': 'consume_version', 'local-endpoint-name': 'local_endpoint_name', 'macaroons': 'macaroons', 'offer-uuid': 'offer_uuid', 'relation-token': 'relation_token', 'remote-endpoint': 'remote_endpoint', 'remote-space': 'remote_space', 'source-model-tag': 'source_model_tag'} + def __init__(self, application_token=None, bakery_version=None, consume_version=None, local_endpoint_name=None, macaroons=None, offer_uuid=None, relation_token=None, remote_endpoint=None, remote_space=None, source_model_tag=None, **unknown_fields): + ''' + application_token : str + bakery_version : int + consume_version : int + local_endpoint_name : str + macaroons : typing.Sequence[~Macaroon] + offer_uuid : str + relation_token : str + remote_endpoint : RemoteEndpoint + remote_space : RemoteSpace + source_model_tag : str + ''' + application_token_ = application_token + bakery_version_ = bakery_version + consume_version_ = consume_version + local_endpoint_name_ = local_endpoint_name + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + offer_uuid_ = offer_uuid + relation_token_ = relation_token + remote_endpoint_ = RemoteEndpoint.from_json(remote_endpoint) if remote_endpoint else None + remote_space_ = RemoteSpace.from_json(remote_space) if remote_space else None + source_model_tag_ = source_model_tag + + # Validate arguments against known Juju API types. + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) + + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if consume_version_ is not None and not isinstance(consume_version_, int): + raise Exception("Expected consume_version_ to be a int, received: {}".format(type(consume_version_))) + + if local_endpoint_name_ is not None and not isinstance(local_endpoint_name_, (bytes, str)): + raise Exception("Expected local_endpoint_name_ to be a str, received: {}".format(type(local_endpoint_name_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + if remote_endpoint_ is not None and not isinstance(remote_endpoint_, (dict, RemoteEndpoint)): + raise Exception("Expected remote_endpoint_ to be a RemoteEndpoint, received: {}".format(type(remote_endpoint_))) + + if remote_space_ is not None and not isinstance(remote_space_, (dict, RemoteSpace)): + raise Exception("Expected remote_space_ to be a RemoteSpace, received: {}".format(type(remote_space_))) + + if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): + raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) + + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.consume_version = consume_version_ + self.local_endpoint_name = local_endpoint_name_ + self.macaroons = macaroons_ + self.offer_uuid = offer_uuid_ + self.relation_token = relation_token_ + self.remote_endpoint = remote_endpoint_ + self.remote_space = remote_space_ + self.source_model_tag = source_model_tag_ + self.unknown_fields = unknown_fields + + + +class RegisterRemoteRelationArgs(Type): + _toSchema = {'relations': 'relations'} + _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): + ''' + relations : typing.Sequence[~RegisterRemoteRelationArg] + ''' + relations_ = [RegisterRemoteRelationArg.from_json(o) for o in relations or []] + + # Validate arguments against known Juju API types. + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) + + self.relations = relations_ + self.unknown_fields = unknown_fields + + + +class RegisterRemoteRelationResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteRelationDetails + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteRelationDetails.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RemoteRelationDetails)): + raise Exception("Expected result_ to be a RemoteRelationDetails, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RegisterRemoteRelationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RegisterRemoteRelationResult] + ''' + results_ = [RegisterRemoteRelationResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RelationData(Type): + _toSchema = {'inscope': 'InScope', 'unitdata': 'UnitData'} + _toPy = {'InScope': 'inscope', 'UnitData': 'unitdata'} + def __init__(self, inscope=None, unitdata=None, **unknown_fields): + ''' + inscope : bool + unitdata : typing.Mapping[str, typing.Any] + ''' + inscope_ = inscope + unitdata_ = unitdata + + # Validate arguments against known Juju API types. + if inscope_ is not None and not isinstance(inscope_, bool): + raise Exception("Expected inscope_ to be a bool, received: {}".format(type(inscope_))) + + if unitdata_ is not None and not isinstance(unitdata_, dict): + raise Exception("Expected unitdata_ to be a Mapping, received: {}".format(type(unitdata_))) + + self.inscope = inscope_ + self.unitdata = unitdata_ + self.unknown_fields = unknown_fields + + + +class RelationIds(Type): + _toSchema = {'relation_ids': 'relation-ids'} + _toPy = {'relation-ids': 'relation_ids'} + def __init__(self, relation_ids=None, **unknown_fields): + ''' + relation_ids : typing.Sequence[int] + ''' + relation_ids_ = relation_ids + + # Validate arguments against known Juju API types. + if relation_ids_ is not None and not isinstance(relation_ids_, (bytes, str, list)): + raise Exception("Expected relation_ids_ to be a Sequence, received: {}".format(type(relation_ids_))) + + self.relation_ids = relation_ids_ + self.unknown_fields = unknown_fields + + + +class RelationLifeSuspendedStatusChange(Type): + _toSchema = {'key': 'key', 'life': 'life', 'suspended': 'suspended', 'suspended_reason': 'suspended-reason'} + _toPy = {'key': 'key', 'life': 'life', 'suspended': 'suspended', 'suspended-reason': 'suspended_reason'} + def __init__(self, key=None, life=None, suspended=None, suspended_reason=None, **unknown_fields): + ''' + key : str + life : str + suspended : bool + suspended_reason : str + ''' + key_ = key + life_ = life + suspended_ = suspended + suspended_reason_ = suspended_reason + + # Validate arguments against known Juju API types. + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + if suspended_reason_ is not None and not isinstance(suspended_reason_, (bytes, str)): + raise Exception("Expected suspended_reason_ to be a str, received: {}".format(type(suspended_reason_))) + + self.key = key_ + self.life = life_ + self.suspended = suspended_ + self.suspended_reason = suspended_reason_ + self.unknown_fields = unknown_fields + + + +class RelationLifeSuspendedStatusWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): + ''' + changes : typing.Sequence[~RelationLifeSuspendedStatusChange] + error : Error + watcher_id : str + ''' + changes_ = [RelationLifeSuspendedStatusChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class RelationResult(Type): + _toSchema = {'bool_': 'bool', 'endpoint': 'endpoint', 'error': 'error', 'id_': 'id', 'key': 'key', 'life': 'life', 'other_application': 'other-application'} + _toPy = {'bool': 'bool_', 'endpoint': 'endpoint', 'error': 'error', 'id': 'id_', 'key': 'key', 'life': 'life', 'other-application': 'other_application'} + def __init__(self, bool_=None, endpoint=None, error=None, id_=None, key=None, life=None, other_application=None, **unknown_fields): + ''' + bool_ : bool + endpoint : Endpoint + error : Error + id_ : int + key : str + life : str + other_application : str + ''' + bool__ = bool_ + endpoint_ = Endpoint.from_json(endpoint) if endpoint else None + error_ = Error.from_json(error) if error else None + id__ = id_ + key_ = key + life_ = life + other_application_ = other_application + + # Validate arguments against known Juju API types. + if bool__ is not None and not isinstance(bool__, bool): + raise Exception("Expected bool__ to be a bool, received: {}".format(type(bool__))) + + if endpoint_ is not None and not isinstance(endpoint_, (dict, Endpoint)): + raise Exception("Expected endpoint_ to be a Endpoint, received: {}".format(type(endpoint_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if other_application_ is not None and not isinstance(other_application_, (bytes, str)): + raise Exception("Expected other_application_ to be a str, received: {}".format(type(other_application_))) + + self.bool_ = bool__ + self.endpoint = endpoint_ + self.error = error_ + self.id_ = id__ + self.key = key_ + self.life = life_ + self.other_application = other_application_ + self.unknown_fields = unknown_fields + + + +class RelationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationResult] + ''' + results_ = [RelationResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RelationStatus(Type): + _toSchema = {'endpoints': 'endpoints', 'id_': 'id', 'interface': 'interface', 'key': 'key', 'scope': 'scope', 'status': 'status'} + _toPy = {'endpoints': 'endpoints', 'id': 'id_', 'interface': 'interface', 'key': 'key', 'scope': 'scope', 'status': 'status'} + def __init__(self, endpoints=None, id_=None, interface=None, key=None, scope=None, status=None, **unknown_fields): + ''' + endpoints : typing.Sequence[~EndpointStatus] + id_ : int + interface : str + key : str + scope : str + status : DetailedStatus + ''' + endpoints_ = [EndpointStatus.from_json(o) for o in endpoints or []] + id__ = id_ + interface_ = interface + key_ = key + scope_ = scope + status_ = DetailedStatus.from_json(status) if status else None + + # Validate arguments against known Juju API types. + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): + raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + + self.endpoints = endpoints_ + self.id_ = id__ + self.interface = interface_ + self.key = key_ + self.scope = scope_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class RelationStatusArg(Type): + _toSchema = {'message': 'message', 'relation_id': 'relation-id', 'status': 'status', 'unit_tag': 'unit-tag'} + _toPy = {'message': 'message', 'relation-id': 'relation_id', 'status': 'status', 'unit-tag': 'unit_tag'} + def __init__(self, message=None, relation_id=None, status=None, unit_tag=None, **unknown_fields): + ''' + message : str + relation_id : int + status : str + unit_tag : str + ''' + message_ = message + relation_id_ = relation_id + status_ = status + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if relation_id_ is not None and not isinstance(relation_id_, int): + raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.message = message_ + self.relation_id = relation_id_ + self.status = status_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class RelationStatusArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RelationStatusArg] + ''' + args_ = [RelationStatusArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class RelationStatusWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationLifeSuspendedStatusWatchResult] + ''' + results_ = [RelationLifeSuspendedStatusWatchResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RelationSuspendedArg(Type): + _toSchema = {'message': 'message', 'relation_id': 'relation-id', 'suspended': 'suspended'} + _toPy = {'message': 'message', 'relation-id': 'relation_id', 'suspended': 'suspended'} + def __init__(self, message=None, relation_id=None, suspended=None, **unknown_fields): + ''' + message : str + relation_id : int + suspended : bool + ''' + message_ = message + relation_id_ = relation_id + suspended_ = suspended + + # Validate arguments against known Juju API types. + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if relation_id_ is not None and not isinstance(relation_id_, int): + raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + self.message = message_ + self.relation_id = relation_id_ + self.suspended = suspended_ + self.unknown_fields = unknown_fields + + + +class RelationSuspendedArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RelationSuspendedArg] + ''' + args_ = [RelationSuspendedArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class RelationUnit(Type): + _toSchema = {'relation': 'relation', 'unit': 'unit'} + _toPy = {'relation': 'relation', 'unit': 'unit'} + def __init__(self, relation=None, unit=None, **unknown_fields): + ''' + relation : str + unit : str + ''' + relation_ = relation + unit_ = unit + + # Validate arguments against known Juju API types. + if relation_ is not None and not isinstance(relation_, (bytes, str)): + raise Exception("Expected relation_ to be a str, received: {}".format(type(relation_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.relation = relation_ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +class RelationUnitPair(Type): + _toSchema = {'local_unit': 'local-unit', 'relation': 'relation', 'remote_unit': 'remote-unit'} + _toPy = {'local-unit': 'local_unit', 'relation': 'relation', 'remote-unit': 'remote_unit'} + def __init__(self, local_unit=None, relation=None, remote_unit=None, **unknown_fields): + ''' + local_unit : str + relation : str + remote_unit : str + ''' + local_unit_ = local_unit + relation_ = relation + remote_unit_ = remote_unit + + # Validate arguments against known Juju API types. + if local_unit_ is not None and not isinstance(local_unit_, (bytes, str)): + raise Exception("Expected local_unit_ to be a str, received: {}".format(type(local_unit_))) + + if relation_ is not None and not isinstance(relation_, (bytes, str)): + raise Exception("Expected relation_ to be a str, received: {}".format(type(relation_))) + + if remote_unit_ is not None and not isinstance(remote_unit_, (bytes, str)): + raise Exception("Expected remote_unit_ to be a str, received: {}".format(type(remote_unit_))) + + self.local_unit = local_unit_ + self.relation = relation_ + self.remote_unit = remote_unit_ + self.unknown_fields = unknown_fields + + + +class RelationUnitPairs(Type): + _toSchema = {'relation_unit_pairs': 'relation-unit-pairs'} + _toPy = {'relation-unit-pairs': 'relation_unit_pairs'} + def __init__(self, relation_unit_pairs=None, **unknown_fields): + ''' + relation_unit_pairs : typing.Sequence[~RelationUnitPair] + ''' + relation_unit_pairs_ = [RelationUnitPair.from_json(o) for o in relation_unit_pairs or []] + + # Validate arguments against known Juju API types. + if relation_unit_pairs_ is not None and not isinstance(relation_unit_pairs_, (bytes, str, list)): + raise Exception("Expected relation_unit_pairs_ to be a Sequence, received: {}".format(type(relation_unit_pairs_))) + + self.relation_unit_pairs = relation_unit_pairs_ + self.unknown_fields = unknown_fields + + + +class RelationUnitSettings(Type): + _toSchema = {'application_settings': 'application-settings', 'relation': 'relation', 'settings': 'settings', 'unit': 'unit'} + _toPy = {'application-settings': 'application_settings', 'relation': 'relation', 'settings': 'settings', 'unit': 'unit'} + def __init__(self, application_settings=None, relation=None, settings=None, unit=None, **unknown_fields): + ''' + application_settings : typing.Mapping[str, str] + relation : str + settings : typing.Mapping[str, str] + unit : str + ''' + application_settings_ = application_settings + relation_ = relation + settings_ = settings + unit_ = unit + + # Validate arguments against known Juju API types. + if application_settings_ is not None and not isinstance(application_settings_, dict): + raise Exception("Expected application_settings_ to be a Mapping, received: {}".format(type(application_settings_))) + + if relation_ is not None and not isinstance(relation_, (bytes, str)): + raise Exception("Expected relation_ to be a str, received: {}".format(type(relation_))) + + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.application_settings = application_settings_ + self.relation = relation_ + self.settings = settings_ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +class RelationUnitStatus(Type): + _toSchema = {'in_scope': 'in-scope', 'relation_tag': 'relation-tag', 'suspended': 'suspended'} + _toPy = {'in-scope': 'in_scope', 'relation-tag': 'relation_tag', 'suspended': 'suspended'} + def __init__(self, in_scope=None, relation_tag=None, suspended=None, **unknown_fields): + ''' + in_scope : bool + relation_tag : str + suspended : bool + ''' + in_scope_ = in_scope + relation_tag_ = relation_tag + suspended_ = suspended + + # Validate arguments against known Juju API types. + if in_scope_ is not None and not isinstance(in_scope_, bool): + raise Exception("Expected in_scope_ to be a bool, received: {}".format(type(in_scope_))) + + if relation_tag_ is not None and not isinstance(relation_tag_, (bytes, str)): + raise Exception("Expected relation_tag_ to be a str, received: {}".format(type(relation_tag_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + self.in_scope = in_scope_ + self.relation_tag = relation_tag_ + self.suspended = suspended_ + self.unknown_fields = unknown_fields + + + +class RelationUnitStatusResult(Type): + _toSchema = {'error': 'error', 'results': 'results'} + _toPy = {'error': 'error', 'results': 'results'} + def __init__(self, error=None, results=None, **unknown_fields): + ''' + error : Error + results : typing.Sequence[~RelationUnitStatus] + ''' + error_ = Error.from_json(error) if error else None + results_ = [RelationUnitStatus.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.error = error_ + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RelationUnitStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationUnitStatusResult] + ''' + results_ = [RelationUnitStatusResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RelationUnits(Type): + _toSchema = {'relation_units': 'relation-units'} + _toPy = {'relation-units': 'relation_units'} + def __init__(self, relation_units=None, **unknown_fields): + ''' + relation_units : typing.Sequence[~RelationUnit] + ''' + relation_units_ = [RelationUnit.from_json(o) for o in relation_units or []] + + # Validate arguments against known Juju API types. + if relation_units_ is not None and not isinstance(relation_units_, (bytes, str, list)): + raise Exception("Expected relation_units_ to be a Sequence, received: {}".format(type(relation_units_))) + + self.relation_units = relation_units_ + self.unknown_fields = unknown_fields + + + +class RelationUnitsChange(Type): + _toSchema = {'app_changed': 'app-changed', 'changed': 'changed', 'departed': 'departed'} + _toPy = {'app-changed': 'app_changed', 'changed': 'changed', 'departed': 'departed'} + def __init__(self, app_changed=None, changed=None, departed=None, **unknown_fields): + ''' + app_changed : typing.Mapping[str, int] + changed : typing.Mapping[str, ~UnitSettings] + departed : typing.Sequence[str] + ''' + app_changed_ = app_changed + changed_ = {k: UnitSettings.from_json(v) for k, v in (changed or dict()).items()} + departed_ = departed + + # Validate arguments against known Juju API types. + if app_changed_ is not None and not isinstance(app_changed_, dict): + raise Exception("Expected app_changed_ to be a Mapping, received: {}".format(type(app_changed_))) + + if changed_ is not None and not isinstance(changed_, dict): + raise Exception("Expected changed_ to be a Mapping, received: {}".format(type(changed_))) + + if departed_ is not None and not isinstance(departed_, (bytes, str, list)): + raise Exception("Expected departed_ to be a Sequence, received: {}".format(type(departed_))) + + self.app_changed = app_changed_ + self.changed = changed_ + self.departed = departed_ + self.unknown_fields = unknown_fields + + + +class RelationUnitsWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): + ''' + changes : RelationUnitsChange + error : Error + watcher_id : str + ''' + changes_ = RelationUnitsChange.from_json(changes) if changes else None + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (dict, RelationUnitsChange)): + raise Exception("Expected changes_ to be a RelationUnitsChange, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class RelationUnitsWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationUnitsWatchResult] + ''' + results_ = [RelationUnitsWatchResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoteApplication(Type): + _toSchema = {'consume_version': 'consume-version', 'is_consumer_proxy': 'is-consumer-proxy', 'life': 'life', 'macaroon': 'macaroon', 'model_uuid': 'model-uuid', 'name': 'name', 'offer_uuid': 'offer-uuid', 'status': 'status'} + _toPy = {'consume-version': 'consume_version', 'is-consumer-proxy': 'is_consumer_proxy', 'life': 'life', 'macaroon': 'macaroon', 'model-uuid': 'model_uuid', 'name': 'name', 'offer-uuid': 'offer_uuid', 'status': 'status'} + def __init__(self, consume_version=None, is_consumer_proxy=None, life=None, macaroon=None, model_uuid=None, name=None, offer_uuid=None, status=None, **unknown_fields): + ''' + consume_version : int + is_consumer_proxy : bool + life : str + macaroon : Macaroon + model_uuid : str + name : str + offer_uuid : str + status : str + ''' + consume_version_ = consume_version + is_consumer_proxy_ = is_consumer_proxy + life_ = life + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + model_uuid_ = model_uuid + name_ = name + offer_uuid_ = offer_uuid + status_ = status + + # Validate arguments against known Juju API types. + if consume_version_ is not None and not isinstance(consume_version_, int): + raise Exception("Expected consume_version_ to be a int, received: {}".format(type(consume_version_))) + + if is_consumer_proxy_ is not None and not isinstance(is_consumer_proxy_, bool): + raise Exception("Expected is_consumer_proxy_ to be a bool, received: {}".format(type(is_consumer_proxy_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.consume_version = consume_version_ + self.is_consumer_proxy = is_consumer_proxy_ + self.life = life_ + self.macaroon = macaroon_ + self.model_uuid = model_uuid_ + self.name = name_ + self.offer_uuid = offer_uuid_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationInfo(Type): + _toSchema = {'description': 'description', 'endpoints': 'endpoints', 'icon_url_path': 'icon-url-path', 'model_tag': 'model-tag', 'name': 'name', 'offer_url': 'offer-url', 'source_model_label': 'source-model-label'} + _toPy = {'description': 'description', 'endpoints': 'endpoints', 'icon-url-path': 'icon_url_path', 'model-tag': 'model_tag', 'name': 'name', 'offer-url': 'offer_url', 'source-model-label': 'source_model_label'} + def __init__(self, description=None, endpoints=None, icon_url_path=None, model_tag=None, name=None, offer_url=None, source_model_label=None, **unknown_fields): + ''' + description : str + endpoints : typing.Sequence[~RemoteEndpoint] + icon_url_path : str + model_tag : str + name : str + offer_url : str + source_model_label : str + ''' + description_ = description + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + icon_url_path_ = icon_url_path + model_tag_ = model_tag + name_ = name + offer_url_ = offer_url + source_model_label_ = source_model_label + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if icon_url_path_ is not None and not isinstance(icon_url_path_, (bytes, str)): + raise Exception("Expected icon_url_path_ to be a str, received: {}".format(type(icon_url_path_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + + if source_model_label_ is not None and not isinstance(source_model_label_, (bytes, str)): + raise Exception("Expected source_model_label_ to be a str, received: {}".format(type(source_model_label_))) + + self.description = description_ + self.endpoints = endpoints_ + self.icon_url_path = icon_url_path_ + self.model_tag = model_tag_ + self.name = name_ + self.offer_url = offer_url_ + self.source_model_label = source_model_label_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteApplicationInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteApplicationInfo.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RemoteApplicationInfo)): + raise Exception("Expected result_ to be a RemoteApplicationInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteApplicationInfoResult] + ''' + results_ = [RemoteApplicationInfoResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteApplication + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteApplication.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RemoteApplication)): + raise Exception("Expected result_ to be a RemoteApplication, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteApplicationResult] + ''' + results_ = [RemoteApplicationResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationStatus(Type): + _toSchema = {'endpoints': 'endpoints', 'err': 'err', 'life': 'life', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'relations': 'relations', 'status': 'status'} + _toPy = {'endpoints': 'endpoints', 'err': 'err', 'life': 'life', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'relations': 'relations', 'status': 'status'} + def __init__(self, endpoints=None, err=None, life=None, offer_name=None, offer_url=None, relations=None, status=None, **unknown_fields): + ''' + endpoints : typing.Sequence[~RemoteEndpoint] + err : Error + life : str + offer_name : str + offer_url : str + relations : typing.Mapping[str, typing.Sequence[str]] + status : DetailedStatus + ''' + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + err_ = Error.from_json(err) if err else None + life_ = life + offer_name_ = offer_name + offer_url_ = offer_url + relations_ = relations + status_ = DetailedStatus.from_json(status) if status else None + + # Validate arguments against known Juju API types. + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + + if relations_ is not None and not isinstance(relations_, dict): + raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) + + if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): + raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + + self.endpoints = endpoints_ + self.err = err_ + self.life = life_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.relations = relations_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class RemoteEndpoint(Type): + _toSchema = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'role': 'role'} + _toPy = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'role': 'role'} + def __init__(self, interface=None, limit=None, name=None, role=None, **unknown_fields): + ''' + interface : str + limit : int + name : str + role : str + ''' + interface_ = interface + limit_ = limit + name_ = name + role_ = role + + # Validate arguments against known Juju API types. + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + + if limit_ is not None and not isinstance(limit_, int): + raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + + self.interface = interface_ + self.limit = limit_ + self.name = name_ + self.role = role_ + self.unknown_fields = unknown_fields + + + +class RemoteEntityArg(Type): + _toSchema = {'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'relation_token': 'relation-token'} + _toPy = {'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'relation-token': 'relation_token'} + def __init__(self, bakery_version=None, macaroons=None, relation_token=None, **unknown_fields): + ''' + bakery_version : int + macaroons : typing.Sequence[~Macaroon] + relation_token : str + ''' + bakery_version_ = bakery_version + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.bakery_version = bakery_version_ + self.macaroons = macaroons_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class RemoteEntityArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RemoteEntityArg] + ''' + args_ = [RemoteEntityArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class RemoteEntityTokenArg(Type): + _toSchema = {'tag': 'tag', 'token': 'token'} + _toPy = {'tag': 'tag', 'token': 'token'} + def __init__(self, tag=None, token=None, **unknown_fields): + ''' + tag : str + token : str + ''' + tag_ = tag + token_ = token + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if token_ is not None and not isinstance(token_, (bytes, str)): + raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) + + self.tag = tag_ + self.token = token_ + self.unknown_fields = unknown_fields + + + +class RemoteEntityTokenArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RemoteEntityTokenArg] + ''' + args_ = [RemoteEntityTokenArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class RemoteRelation(Type): + _toSchema = {'application_name': 'application-name', 'endpoint': 'endpoint', 'id_': 'id', 'key': 'key', 'life': 'life', 'remote_application_name': 'remote-application-name', 'remote_endpoint_name': 'remote-endpoint-name', 'source_model_uuid': 'source-model-uuid', 'suspended': 'suspended', 'unit_count': 'unit-count'} + _toPy = {'application-name': 'application_name', 'endpoint': 'endpoint', 'id': 'id_', 'key': 'key', 'life': 'life', 'remote-application-name': 'remote_application_name', 'remote-endpoint-name': 'remote_endpoint_name', 'source-model-uuid': 'source_model_uuid', 'suspended': 'suspended', 'unit-count': 'unit_count'} + def __init__(self, application_name=None, endpoint=None, id_=None, key=None, life=None, remote_application_name=None, remote_endpoint_name=None, source_model_uuid=None, suspended=None, unit_count=None, **unknown_fields): + ''' + application_name : str + endpoint : RemoteEndpoint + id_ : int + key : str + life : str + remote_application_name : str + remote_endpoint_name : str + source_model_uuid : str + suspended : bool + unit_count : int + ''' + application_name_ = application_name + endpoint_ = RemoteEndpoint.from_json(endpoint) if endpoint else None + id__ = id_ + key_ = key + life_ = life + remote_application_name_ = remote_application_name + remote_endpoint_name_ = remote_endpoint_name + source_model_uuid_ = source_model_uuid + suspended_ = suspended + unit_count_ = unit_count + + # Validate arguments against known Juju API types. + if application_name_ is not None and not isinstance(application_name_, (bytes, str)): + raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) + + if endpoint_ is not None and not isinstance(endpoint_, (dict, RemoteEndpoint)): + raise Exception("Expected endpoint_ to be a RemoteEndpoint, received: {}".format(type(endpoint_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if remote_application_name_ is not None and not isinstance(remote_application_name_, (bytes, str)): + raise Exception("Expected remote_application_name_ to be a str, received: {}".format(type(remote_application_name_))) + + if remote_endpoint_name_ is not None and not isinstance(remote_endpoint_name_, (bytes, str)): + raise Exception("Expected remote_endpoint_name_ to be a str, received: {}".format(type(remote_endpoint_name_))) + + if source_model_uuid_ is not None and not isinstance(source_model_uuid_, (bytes, str)): + raise Exception("Expected source_model_uuid_ to be a str, received: {}".format(type(source_model_uuid_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + if unit_count_ is not None and not isinstance(unit_count_, int): + raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) + + self.application_name = application_name_ + self.endpoint = endpoint_ + self.id_ = id__ + self.key = key_ + self.life = life_ + self.remote_application_name = remote_application_name_ + self.remote_endpoint_name = remote_endpoint_name_ + self.source_model_uuid = source_model_uuid_ + self.suspended = suspended_ + self.unit_count = unit_count_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationChangeEvent(Type): + _toSchema = {'application_settings': 'application-settings', 'application_token': 'application-token', 'bakery_version': 'bakery-version', 'changed_units': 'changed-units', 'departed_units': 'departed-units', 'force_cleanup': 'force-cleanup', 'life': 'life', 'macaroons': 'macaroons', 'relation_token': 'relation-token', 'suspended': 'suspended', 'suspended_reason': 'suspended-reason', 'unit_count': 'unit-count'} + _toPy = {'application-settings': 'application_settings', 'application-token': 'application_token', 'bakery-version': 'bakery_version', 'changed-units': 'changed_units', 'departed-units': 'departed_units', 'force-cleanup': 'force_cleanup', 'life': 'life', 'macaroons': 'macaroons', 'relation-token': 'relation_token', 'suspended': 'suspended', 'suspended-reason': 'suspended_reason', 'unit-count': 'unit_count'} + def __init__(self, application_settings=None, application_token=None, bakery_version=None, changed_units=None, departed_units=None, force_cleanup=None, life=None, macaroons=None, relation_token=None, suspended=None, suspended_reason=None, unit_count=None, **unknown_fields): + ''' + application_settings : typing.Mapping[str, typing.Any] + application_token : str + bakery_version : int + changed_units : typing.Sequence[~RemoteRelationUnitChange] + departed_units : typing.Sequence[int] + force_cleanup : bool + life : str + macaroons : typing.Sequence[~Macaroon] + relation_token : str + suspended : bool + suspended_reason : str + unit_count : int + ''' + application_settings_ = application_settings + application_token_ = application_token + bakery_version_ = bakery_version + changed_units_ = [RemoteRelationUnitChange.from_json(o) for o in changed_units or []] + departed_units_ = departed_units + force_cleanup_ = force_cleanup + life_ = life + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + relation_token_ = relation_token + suspended_ = suspended + suspended_reason_ = suspended_reason + unit_count_ = unit_count + + # Validate arguments against known Juju API types. + if application_settings_ is not None and not isinstance(application_settings_, dict): + raise Exception("Expected application_settings_ to be a Mapping, received: {}".format(type(application_settings_))) + + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) + + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if changed_units_ is not None and not isinstance(changed_units_, (bytes, str, list)): + raise Exception("Expected changed_units_ to be a Sequence, received: {}".format(type(changed_units_))) + + if departed_units_ is not None and not isinstance(departed_units_, (bytes, str, list)): + raise Exception("Expected departed_units_ to be a Sequence, received: {}".format(type(departed_units_))) + + if force_cleanup_ is not None and not isinstance(force_cleanup_, bool): + raise Exception("Expected force_cleanup_ to be a bool, received: {}".format(type(force_cleanup_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + if suspended_reason_ is not None and not isinstance(suspended_reason_, (bytes, str)): + raise Exception("Expected suspended_reason_ to be a str, received: {}".format(type(suspended_reason_))) + + if unit_count_ is not None and not isinstance(unit_count_, int): + raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) + + self.application_settings = application_settings_ + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.changed_units = changed_units_ + self.departed_units = departed_units_ + self.force_cleanup = force_cleanup_ + self.life = life_ + self.macaroons = macaroons_ + self.relation_token = relation_token_ + self.suspended = suspended_ + self.suspended_reason = suspended_reason_ + self.unit_count = unit_count_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationDetails(Type): + _toSchema = {'bakery_version': 'bakery-version', 'macaroon': 'macaroon', 'relation_token': 'relation-token'} + _toPy = {'bakery-version': 'bakery_version', 'macaroon': 'macaroon', 'relation-token': 'relation_token'} + def __init__(self, bakery_version=None, macaroon=None, relation_token=None, **unknown_fields): + ''' + bakery_version : int + macaroon : Macaroon + relation_token : str + ''' + bakery_version_ = bakery_version + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.bakery_version = bakery_version_ + self.macaroon = macaroon_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteRelation + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteRelation.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RemoteRelation)): + raise Exception("Expected result_ to be a RemoteRelation, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteRelationResult] + ''' + results_ = [RemoteRelationResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationUnitChange(Type): + _toSchema = {'settings': 'settings', 'unit_id': 'unit-id'} + _toPy = {'settings': 'settings', 'unit-id': 'unit_id'} + def __init__(self, settings=None, unit_id=None, **unknown_fields): + ''' + settings : typing.Mapping[str, typing.Any] + unit_id : int + ''' + settings_ = settings + unit_id_ = unit_id + + # Validate arguments against known Juju API types. + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + if unit_id_ is not None and not isinstance(unit_id_, int): + raise Exception("Expected unit_id_ to be a int, received: {}".format(type(unit_id_))) + + self.settings = settings_ + self.unit_id = unit_id_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): + ''' + changes : RemoteRelationChangeEvent + error : Error + watcher_id : str + ''' + changes_ = RemoteRelationChangeEvent.from_json(changes) if changes else None + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (dict, RemoteRelationChangeEvent)): + raise Exception("Expected changes_ to be a RemoteRelationChangeEvent, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteRelationWatchResult] + ''' + results_ = [RemoteRelationWatchResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationsChanges(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~RemoteRelationChangeEvent] + ''' + changes_ = [RemoteRelationChangeEvent.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class RemoteSpace(Type): + _toSchema = {'cloud_type': 'cloud-type', 'name': 'name', 'provider_attributes': 'provider-attributes', 'provider_id': 'provider-id', 'subnets': 'subnets'} + _toPy = {'cloud-type': 'cloud_type', 'name': 'name', 'provider-attributes': 'provider_attributes', 'provider-id': 'provider_id', 'subnets': 'subnets'} + def __init__(self, cloud_type=None, name=None, provider_attributes=None, provider_id=None, subnets=None, **unknown_fields): + ''' + cloud_type : str + name : str + provider_attributes : typing.Mapping[str, typing.Any] + provider_id : str + subnets : typing.Sequence[~Subnet] + ''' + cloud_type_ = cloud_type + name_ = name + provider_attributes_ = provider_attributes + provider_id_ = provider_id + subnets_ = [Subnet.from_json(o) for o in subnets or []] + + # Validate arguments against known Juju API types. + if cloud_type_ is not None and not isinstance(cloud_type_, (bytes, str)): + raise Exception("Expected cloud_type_ to be a str, received: {}".format(type(cloud_type_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if provider_attributes_ is not None and not isinstance(provider_attributes_, dict): + raise Exception("Expected provider_attributes_ to be a Mapping, received: {}".format(type(provider_attributes_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.cloud_type = cloud_type_ + self.name = name_ + self.provider_attributes = provider_attributes_ + self.provider_id = provider_id_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +class RemoveBlocksArgs(Type): + _toSchema = {'all_': 'all'} + _toPy = {'all': 'all_'} + def __init__(self, all_=None, **unknown_fields): + ''' + all_ : bool + ''' + all__ = all_ + + # Validate arguments against known Juju API types. + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + + self.all_ = all__ + self.unknown_fields = unknown_fields + + + +class RemoveFilesystemParams(Type): + _toSchema = {'destroy': 'destroy', 'filesystem_id': 'filesystem-id', 'provider': 'provider'} + _toPy = {'destroy': 'destroy', 'filesystem-id': 'filesystem_id', 'provider': 'provider'} + def __init__(self, destroy=None, filesystem_id=None, provider=None, **unknown_fields): + ''' + destroy : bool + filesystem_id : str + provider : str + ''' + destroy_ = destroy + filesystem_id_ = filesystem_id + provider_ = provider + + # Validate arguments against known Juju API types. + if destroy_ is not None and not isinstance(destroy_, bool): + raise Exception("Expected destroy_ to be a bool, received: {}".format(type(destroy_))) + + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + self.destroy = destroy_ + self.filesystem_id = filesystem_id_ + self.provider = provider_ + self.unknown_fields = unknown_fields + + + +class RemoveFilesystemParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoveFilesystemParams + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoveFilesystemParams.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RemoveFilesystemParams)): + raise Exception("Expected result_ to be a RemoveFilesystemParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoveFilesystemParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoveFilesystemParamsResult] + ''' + results_ = [RemoveFilesystemParamsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoveSecretBackendArg(Type): + _toSchema = {'force': 'force', 'name': 'name'} + _toPy = {'force': 'force', 'name': 'name'} + def __init__(self, force=None, name=None, **unknown_fields): + ''' + force : bool + name : str + ''' + force_ = force + name_ = name + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.force = force_ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class RemoveSecretBackendArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RemoveSecretBackendArg] + ''' + args_ = [RemoveSecretBackendArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class RemoveSpaceParam(Type): + _toSchema = {'dry_run': 'dry-run', 'force': 'force', 'space': 'space'} + _toPy = {'dry-run': 'dry_run', 'force': 'force', 'space': 'space'} + def __init__(self, dry_run=None, force=None, space=None, **unknown_fields): + ''' + dry_run : bool + force : bool + space : Entity + ''' + dry_run_ = dry_run + force_ = force + space_ = Entity.from_json(space) if space else None + + # Validate arguments against known Juju API types. + if dry_run_ is not None and not isinstance(dry_run_, bool): + raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if space_ is not None and not isinstance(space_, (dict, Entity)): + raise Exception("Expected space_ to be a Entity, received: {}".format(type(space_))) + + self.dry_run = dry_run_ + self.force = force_ + self.space = space_ + self.unknown_fields = unknown_fields + + + +class RemoveSpaceParams(Type): + _toSchema = {'space_param': 'space-param'} + _toPy = {'space-param': 'space_param'} + def __init__(self, space_param=None, **unknown_fields): + ''' + space_param : typing.Sequence[~RemoveSpaceParam] + ''' + space_param_ = [RemoveSpaceParam.from_json(o) for o in space_param or []] + + # Validate arguments against known Juju API types. + if space_param_ is not None and not isinstance(space_param_, (bytes, str, list)): + raise Exception("Expected space_param_ to be a Sequence, received: {}".format(type(space_param_))) + + self.space_param = space_param_ + self.unknown_fields = unknown_fields + + + +class RemoveSpaceResult(Type): + _toSchema = {'bindings': 'bindings', 'constraints': 'constraints', 'controller_settings': 'controller-settings', 'error': 'error'} + _toPy = {'bindings': 'bindings', 'constraints': 'constraints', 'controller-settings': 'controller_settings', 'error': 'error'} + def __init__(self, bindings=None, constraints=None, controller_settings=None, error=None, **unknown_fields): + ''' + bindings : typing.Sequence[~Entity] + constraints : typing.Sequence[~Entity] + controller_settings : typing.Sequence[str] + error : Error + ''' + bindings_ = [Entity.from_json(o) for o in bindings or []] + constraints_ = [Entity.from_json(o) for o in constraints or []] + controller_settings_ = controller_settings + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if bindings_ is not None and not isinstance(bindings_, (bytes, str, list)): + raise Exception("Expected bindings_ to be a Sequence, received: {}".format(type(bindings_))) + + if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): + raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + + if controller_settings_ is not None and not isinstance(controller_settings_, (bytes, str, list)): + raise Exception("Expected controller_settings_ to be a Sequence, received: {}".format(type(controller_settings_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.bindings = bindings_ + self.constraints = constraints_ + self.controller_settings = controller_settings_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class RemoveSpaceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoveSpaceResult] + ''' + results_ = [RemoveSpaceResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RemoveStorage(Type): + _toSchema = {'storage': 'storage'} + _toPy = {'storage': 'storage'} + def __init__(self, storage=None, **unknown_fields): + ''' + storage : typing.Sequence[~RemoveStorageInstance] + ''' + storage_ = [RemoveStorageInstance.from_json(o) for o in storage or []] + + # Validate arguments against known Juju API types. + if storage_ is not None and not isinstance(storage_, (bytes, str, list)): + raise Exception("Expected storage_ to be a Sequence, received: {}".format(type(storage_))) + + self.storage = storage_ + self.unknown_fields = unknown_fields + + + +class RemoveStorageInstance(Type): + _toSchema = {'destroy_attachments': 'destroy-attachments', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'tag': 'tag'} + _toPy = {'destroy-attachments': 'destroy_attachments', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'tag': 'tag'} + def __init__(self, destroy_attachments=None, destroy_storage=None, force=None, max_wait=None, tag=None, **unknown_fields): + ''' + destroy_attachments : bool + destroy_storage : bool + force : bool + max_wait : int + tag : str + ''' + destroy_attachments_ = destroy_attachments + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + tag_ = tag + + # Validate arguments against known Juju API types. + if destroy_attachments_ is not None and not isinstance(destroy_attachments_, bool): + raise Exception("Expected destroy_attachments_ to be a bool, received: {}".format(type(destroy_attachments_))) + + if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): + raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.destroy_attachments = destroy_attachments_ + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class RemoveVolumeParams(Type): + _toSchema = {'destroy': 'destroy', 'provider': 'provider', 'volume_id': 'volume-id'} + _toPy = {'destroy': 'destroy', 'provider': 'provider', 'volume-id': 'volume_id'} + def __init__(self, destroy=None, provider=None, volume_id=None, **unknown_fields): + ''' + destroy : bool + provider : str + volume_id : str + ''' + destroy_ = destroy + provider_ = provider + volume_id_ = volume_id + + # Validate arguments against known Juju API types. + if destroy_ is not None and not isinstance(destroy_, bool): + raise Exception("Expected destroy_ to be a bool, received: {}".format(type(destroy_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) + + self.destroy = destroy_ + self.provider = provider_ + self.volume_id = volume_id_ + self.unknown_fields = unknown_fields + + + +class RemoveVolumeParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoveVolumeParams + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoveVolumeParams.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RemoveVolumeParams)): + raise Exception("Expected result_ to be a RemoveVolumeParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoveVolumeParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoveVolumeParamsResult] + ''' + results_ = [RemoveVolumeParamsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RenameSpaceParams(Type): + _toSchema = {'from_space_tag': 'from-space-tag', 'to_space_tag': 'to-space-tag'} + _toPy = {'from-space-tag': 'from_space_tag', 'to-space-tag': 'to_space_tag'} + def __init__(self, from_space_tag=None, to_space_tag=None, **unknown_fields): + ''' + from_space_tag : str + to_space_tag : str + ''' + from_space_tag_ = from_space_tag + to_space_tag_ = to_space_tag + + # Validate arguments against known Juju API types. + if from_space_tag_ is not None and not isinstance(from_space_tag_, (bytes, str)): + raise Exception("Expected from_space_tag_ to be a str, received: {}".format(type(from_space_tag_))) + + if to_space_tag_ is not None and not isinstance(to_space_tag_, (bytes, str)): + raise Exception("Expected to_space_tag_ to be a str, received: {}".format(type(to_space_tag_))) + + self.from_space_tag = from_space_tag_ + self.to_space_tag = to_space_tag_ + self.unknown_fields = unknown_fields + + + +class RenameSpacesParams(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~RenameSpaceParams] + ''' + changes_ = [RenameSpaceParams.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmWithChannel(Type): + _toSchema = {'charm_origin': 'charm-origin', 'reference': 'reference', 'switch_charm': 'switch-charm'} + _toPy = {'charm-origin': 'charm_origin', 'reference': 'reference', 'switch-charm': 'switch_charm'} + def __init__(self, charm_origin=None, reference=None, switch_charm=None, **unknown_fields): + ''' + charm_origin : CharmOrigin + reference : str + switch_charm : bool + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + reference_ = reference + switch_charm_ = switch_charm + + # Validate arguments against known Juju API types. + if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): + raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) + + if reference_ is not None and not isinstance(reference_, (bytes, str)): + raise Exception("Expected reference_ to be a str, received: {}".format(type(reference_))) + + if switch_charm_ is not None and not isinstance(switch_charm_, bool): + raise Exception("Expected switch_charm_ to be a bool, received: {}".format(type(switch_charm_))) + + self.charm_origin = charm_origin_ + self.reference = reference_ + self.switch_charm = switch_charm_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmWithChannelResult(Type): + _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'supported_bases': 'supported-bases', 'url': 'url'} + _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'supported-bases': 'supported_bases', 'url': 'url'} + def __init__(self, charm_origin=None, error=None, supported_bases=None, url=None, **unknown_fields): + ''' + charm_origin : CharmOrigin + error : Error + supported_bases : typing.Sequence[~Base] + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + error_ = Error.from_json(error) if error else None + supported_bases_ = [Base.from_json(o) for o in supported_bases or []] + url_ = url + + # Validate arguments against known Juju API types. + if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): + raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if supported_bases_ is not None and not isinstance(supported_bases_, (bytes, str, list)): + raise Exception("Expected supported_bases_ to be a Sequence, received: {}".format(type(supported_bases_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.error = error_ + self.supported_bases = supported_bases_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmWithChannelResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ResolveCharmWithChannelResult] + ''' + results_ = [ResolveCharmWithChannelResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmsWithChannel(Type): + _toSchema = {'macaroon': 'macaroon', 'resolve': 'resolve'} + _toPy = {'macaroon': 'macaroon', 'resolve': 'resolve'} + def __init__(self, macaroon=None, resolve=None, **unknown_fields): + ''' + macaroon : Macaroon + resolve : typing.Sequence[~ResolveCharmWithChannel] + ''' + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + resolve_ = [ResolveCharmWithChannel.from_json(o) for o in resolve or []] + + # Validate arguments against known Juju API types. + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if resolve_ is not None and not isinstance(resolve_, (bytes, str, list)): + raise Exception("Expected resolve_ to be a Sequence, received: {}".format(type(resolve_))) + + self.macaroon = macaroon_ + self.resolve = resolve_ + self.unknown_fields = unknown_fields + + + +class ResolvedModeResult(Type): + _toSchema = {'error': 'error', 'mode': 'mode'} + _toPy = {'error': 'error', 'mode': 'mode'} + def __init__(self, error=None, mode=None, **unknown_fields): + ''' + error : Error + mode : str + ''' + error_ = Error.from_json(error) if error else None + mode_ = mode + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if mode_ is not None and not isinstance(mode_, (bytes, str)): + raise Exception("Expected mode_ to be a str, received: {}".format(type(mode_))) + + self.error = error_ + self.mode = mode_ + self.unknown_fields = unknown_fields + + + +class ResolvedModeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ResolvedModeResult] + ''' + results_ = [ResolvedModeResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class Resource(Type): + _toSchema = {'application': 'application', 'charmresource': 'CharmResource', 'description': 'description', 'fingerprint': 'fingerprint', 'id_': 'id', 'name': 'name', 'origin': 'origin', 'path': 'path', 'pending_id': 'pending-id', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type_': 'type', 'username': 'username'} + _toPy = {'CharmResource': 'charmresource', 'application': 'application', 'description': 'description', 'fingerprint': 'fingerprint', 'id': 'id_', 'name': 'name', 'origin': 'origin', 'path': 'path', 'pending-id': 'pending_id', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type': 'type_', 'username': 'username'} + def __init__(self, charmresource=None, application=None, description=None, fingerprint=None, id_=None, name=None, origin=None, path=None, pending_id=None, revision=None, size=None, timestamp=None, type_=None, username=None, **unknown_fields): + ''' + charmresource : CharmResource + application : str + description : str + fingerprint : typing.Sequence[int] + id_ : str + name : str + origin : str + path : str + pending_id : str + revision : int + size : int + timestamp : str + type_ : str + username : str + ''' + charmresource_ = CharmResource.from_json(charmresource) if charmresource else None + application_ = application + description_ = description + fingerprint_ = fingerprint + id__ = id_ + name_ = name + origin_ = origin + path_ = path + pending_id_ = pending_id + revision_ = revision + size_ = size + timestamp_ = timestamp + type__ = type_ + username_ = username + + # Validate arguments against known Juju API types. + if charmresource_ is not None and not isinstance(charmresource_, (dict, CharmResource)): + raise Exception("Expected charmresource_ to be a CharmResource, received: {}".format(type(charmresource_))) + + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): + raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if pending_id_ is not None and not isinstance(pending_id_, (bytes, str)): + raise Exception("Expected pending_id_ to be a str, received: {}".format(type(pending_id_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if timestamp_ is not None and not isinstance(timestamp_, (bytes, str)): + raise Exception("Expected timestamp_ to be a str, received: {}".format(type(timestamp_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.charmresource = charmresource_ + self.application = application_ + self.description = description_ + self.fingerprint = fingerprint_ + self.id_ = id__ + self.name = name_ + self.origin = origin_ + self.path = path_ + self.pending_id = pending_id_ + self.revision = revision_ + self.size = size_ + self.timestamp = timestamp_ + self.type_ = type__ + self.username = username_ + self.unknown_fields = unknown_fields + + + +class ResourcesResult(Type): + _toSchema = {'charm_store_resources': 'charm-store-resources', 'error': 'error', 'errorresult': 'ErrorResult', 'resources': 'resources', 'unit_resources': 'unit-resources'} + _toPy = {'ErrorResult': 'errorresult', 'charm-store-resources': 'charm_store_resources', 'error': 'error', 'resources': 'resources', 'unit-resources': 'unit_resources'} + def __init__(self, errorresult=None, charm_store_resources=None, error=None, resources=None, unit_resources=None, **unknown_fields): + ''' + errorresult : ErrorResult + charm_store_resources : typing.Sequence[~CharmResource] + error : Error + resources : typing.Sequence[~Resource] + unit_resources : typing.Sequence[~UnitResources] + ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + charm_store_resources_ = [CharmResource.from_json(o) for o in charm_store_resources or []] + error_ = Error.from_json(error) if error else None + resources_ = [Resource.from_json(o) for o in resources or []] + unit_resources_ = [UnitResources.from_json(o) for o in unit_resources or []] + + # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if charm_store_resources_ is not None and not isinstance(charm_store_resources_, (bytes, str, list)): + raise Exception("Expected charm_store_resources_ to be a Sequence, received: {}".format(type(charm_store_resources_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if resources_ is not None and not isinstance(resources_, (bytes, str, list)): + raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) + + if unit_resources_ is not None and not isinstance(unit_resources_, (bytes, str, list)): + raise Exception("Expected unit_resources_ to be a Sequence, received: {}".format(type(unit_resources_))) + + self.errorresult = errorresult_ + self.charm_store_resources = charm_store_resources_ + self.error = error_ + self.resources = resources_ + self.unit_resources = unit_resources_ + self.unknown_fields = unknown_fields + + + +class ResourcesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ResourcesResult] + ''' + results_ = [ResourcesResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RetryProvisioningArgs(Type): + _toSchema = {'all_': 'all', 'machines': 'machines'} + _toPy = {'all': 'all_', 'machines': 'machines'} + def __init__(self, all_=None, machines=None, **unknown_fields): + ''' + all_ : bool + machines : typing.Sequence[str] + ''' + all__ = all_ + machines_ = machines + + # Validate arguments against known Juju API types. + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + self.all_ = all__ + self.machines = machines_ + self.unknown_fields = unknown_fields + + + +class RetryStrategy(Type): + _toSchema = {'jitter_retry_time': 'jitter-retry-time', 'max_retry_time': 'max-retry-time', 'min_retry_time': 'min-retry-time', 'retry_time_factor': 'retry-time-factor', 'should_retry': 'should-retry'} + _toPy = {'jitter-retry-time': 'jitter_retry_time', 'max-retry-time': 'max_retry_time', 'min-retry-time': 'min_retry_time', 'retry-time-factor': 'retry_time_factor', 'should-retry': 'should_retry'} + def __init__(self, jitter_retry_time=None, max_retry_time=None, min_retry_time=None, retry_time_factor=None, should_retry=None, **unknown_fields): + ''' + jitter_retry_time : bool + max_retry_time : int + min_retry_time : int + retry_time_factor : int + should_retry : bool + ''' + jitter_retry_time_ = jitter_retry_time + max_retry_time_ = max_retry_time + min_retry_time_ = min_retry_time + retry_time_factor_ = retry_time_factor + should_retry_ = should_retry + + # Validate arguments against known Juju API types. + if jitter_retry_time_ is not None and not isinstance(jitter_retry_time_, bool): + raise Exception("Expected jitter_retry_time_ to be a bool, received: {}".format(type(jitter_retry_time_))) + + if max_retry_time_ is not None and not isinstance(max_retry_time_, int): + raise Exception("Expected max_retry_time_ to be a int, received: {}".format(type(max_retry_time_))) + + if min_retry_time_ is not None and not isinstance(min_retry_time_, int): + raise Exception("Expected min_retry_time_ to be a int, received: {}".format(type(min_retry_time_))) + + if retry_time_factor_ is not None and not isinstance(retry_time_factor_, int): + raise Exception("Expected retry_time_factor_ to be a int, received: {}".format(type(retry_time_factor_))) + + if should_retry_ is not None and not isinstance(should_retry_, bool): + raise Exception("Expected should_retry_ to be a bool, received: {}".format(type(should_retry_))) + + self.jitter_retry_time = jitter_retry_time_ + self.max_retry_time = max_retry_time_ + self.min_retry_time = min_retry_time_ + self.retry_time_factor = retry_time_factor_ + self.should_retry = should_retry_ + self.unknown_fields = unknown_fields + + + +class RetryStrategyResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RetryStrategy + ''' + error_ = Error.from_json(error) if error else None + result_ = RetryStrategy.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, RetryStrategy)): + raise Exception("Expected result_ to be a RetryStrategy, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RetryStrategyResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RetryStrategyResult] + ''' + results_ = [RetryStrategyResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RevokeCredentialArg(Type): + _toSchema = {'force': 'force', 'tag': 'tag'} + _toPy = {'force': 'force', 'tag': 'tag'} + def __init__(self, force=None, tag=None, **unknown_fields): + ''' + force : bool + tag : str + ''' + force_ = force + tag_ = tag + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.force = force_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class RevokeCredentialArgs(Type): + _toSchema = {'credentials': 'credentials'} + _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): + ''' + credentials : typing.Sequence[~RevokeCredentialArg] + ''' + credentials_ = [RevokeCredentialArg.from_json(o) for o in credentials or []] + + # Validate arguments against known Juju API types. + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + + self.credentials = credentials_ + self.unknown_fields = unknown_fields + + + +class RotateSecretBackendArgs(Type): + _toSchema = {'backend_ids': 'backend-ids'} + _toPy = {'backend-ids': 'backend_ids'} + def __init__(self, backend_ids=None, **unknown_fields): + ''' + backend_ids : typing.Sequence[str] + ''' + backend_ids_ = backend_ids + + # Validate arguments against known Juju API types. + 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_))) + + self.backend_ids = backend_ids_ + self.unknown_fields = unknown_fields + + + +class RunParams(Type): + _toSchema = {'applications': 'applications', 'commands': 'commands', 'execution_group': 'execution-group', 'machines': 'machines', 'parallel': 'parallel', 'timeout': 'timeout', 'units': 'units', 'workload_context': 'workload-context'} + _toPy = {'applications': 'applications', 'commands': 'commands', 'execution-group': 'execution_group', 'machines': 'machines', 'parallel': 'parallel', 'timeout': 'timeout', 'units': 'units', 'workload-context': 'workload_context'} + def __init__(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None, **unknown_fields): + ''' + applications : typing.Sequence[str] + commands : str + execution_group : str + machines : typing.Sequence[str] + parallel : bool + timeout : int + units : typing.Sequence[str] + workload_context : bool + ''' + applications_ = applications + commands_ = commands + execution_group_ = execution_group + machines_ = machines + parallel_ = parallel + timeout_ = timeout + units_ = units + workload_context_ = workload_context + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + if commands_ is not None and not isinstance(commands_, (bytes, str)): + raise Exception("Expected commands_ to be a str, received: {}".format(type(commands_))) + + if execution_group_ is not None and not isinstance(execution_group_, (bytes, str)): + raise Exception("Expected execution_group_ to be a str, received: {}".format(type(execution_group_))) + + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + if parallel_ is not None and not isinstance(parallel_, bool): + raise Exception("Expected parallel_ to be a bool, received: {}".format(type(parallel_))) + + if timeout_ is not None and not isinstance(timeout_, int): + raise Exception("Expected timeout_ to be a int, received: {}".format(type(timeout_))) + + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + if workload_context_ is not None and not isinstance(workload_context_, bool): + raise Exception("Expected workload_context_ to be a bool, received: {}".format(type(workload_context_))) + + self.applications = applications_ + self.commands = commands_ + self.execution_group = execution_group_ + self.machines = machines_ + self.parallel = parallel_ + self.timeout = timeout_ + self.units = units_ + self.workload_context = workload_context_ + self.unknown_fields = unknown_fields + + + +class SSHAddressResult(Type): + _toSchema = {'address': 'address', 'error': 'error'} + _toPy = {'address': 'address', 'error': 'error'} + def __init__(self, address=None, error=None, **unknown_fields): + ''' + address : str + error : Error + ''' + address_ = address + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.address = address_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class SSHAddressResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SSHAddressResult] + ''' + results_ = [SSHAddressResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class SSHAddressesResult(Type): + _toSchema = {'addresses': 'addresses', 'error': 'error'} + _toPy = {'addresses': 'addresses', 'error': 'error'} + def __init__(self, addresses=None, error=None, **unknown_fields): + ''' + addresses : typing.Sequence[str] + error : Error + ''' + addresses_ = addresses + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.addresses = addresses_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class SSHAddressesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SSHAddressesResult] + ''' + results_ = [SSHAddressesResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class SSHHostKeySet(Type): + _toSchema = {'entity_keys': 'entity-keys'} + _toPy = {'entity-keys': 'entity_keys'} + def __init__(self, entity_keys=None, **unknown_fields): + ''' + entity_keys : typing.Sequence[~SSHHostKeys] + ''' + entity_keys_ = [SSHHostKeys.from_json(o) for o in entity_keys or []] + + # Validate arguments against known Juju API types. + if entity_keys_ is not None and not isinstance(entity_keys_, (bytes, str, list)): + raise Exception("Expected entity_keys_ to be a Sequence, received: {}".format(type(entity_keys_))) + + self.entity_keys = entity_keys_ + self.unknown_fields = unknown_fields + + + +class SSHHostKeys(Type): + _toSchema = {'public_keys': 'public-keys', 'tag': 'tag'} + _toPy = {'public-keys': 'public_keys', 'tag': 'tag'} + def __init__(self, public_keys=None, tag=None, **unknown_fields): + ''' + public_keys : typing.Sequence[str] + tag : str + ''' + public_keys_ = public_keys + tag_ = tag + + # Validate arguments against known Juju API types. + if public_keys_ is not None and not isinstance(public_keys_, (bytes, str, list)): + raise Exception("Expected public_keys_ to be a Sequence, received: {}".format(type(public_keys_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.public_keys = public_keys_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class SSHProxyResult(Type): + _toSchema = {'use_proxy': 'use-proxy'} + _toPy = {'use-proxy': 'use_proxy'} + def __init__(self, use_proxy=None, **unknown_fields): + ''' + use_proxy : bool + ''' + use_proxy_ = use_proxy + + # Validate arguments against known Juju API types. + if use_proxy_ is not None and not isinstance(use_proxy_, bool): + raise Exception("Expected use_proxy_ to be a bool, received: {}".format(type(use_proxy_))) + + self.use_proxy = use_proxy_ + self.unknown_fields = unknown_fields + + + +class SSHPublicKeysResult(Type): + _toSchema = {'error': 'error', 'public_keys': 'public-keys'} + _toPy = {'error': 'error', 'public-keys': 'public_keys'} + def __init__(self, error=None, public_keys=None, **unknown_fields): + ''' + error : Error + public_keys : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + public_keys_ = public_keys + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if public_keys_ is not None and not isinstance(public_keys_, (bytes, str, list)): + raise Exception("Expected public_keys_ to be a Sequence, received: {}".format(type(public_keys_))) + + self.error = error_ + self.public_keys = public_keys_ + self.unknown_fields = unknown_fields + + + +class SSHPublicKeysResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SSHPublicKeysResult] + ''' + results_ = [SSHPublicKeysResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class ScaleApplicationInfo(Type): + _toSchema = {'num_units': 'num-units'} + _toPy = {'num-units': 'num_units'} + def __init__(self, num_units=None, **unknown_fields): + ''' + num_units : int + ''' + num_units_ = num_units + + # Validate arguments against known Juju API types. + if num_units_ is not None and not isinstance(num_units_, int): + raise Exception("Expected num_units_ to be a int, received: {}".format(type(num_units_))) + + self.num_units = num_units_ + self.unknown_fields = unknown_fields + + + +class ScaleApplicationParams(Type): + _toSchema = {'application_tag': 'application-tag', 'force': 'force', 'scale': 'scale', 'scale_change': 'scale-change'} + _toPy = {'application-tag': 'application_tag', 'force': 'force', 'scale': 'scale', 'scale-change': 'scale_change'} + def __init__(self, application_tag=None, force=None, scale=None, scale_change=None, **unknown_fields): + ''' + application_tag : str + force : bool + scale : int + scale_change : int + ''' + application_tag_ = application_tag + force_ = force + scale_ = scale + scale_change_ = scale_change # Validate arguments against known Juju API types. - if available_version_ is not None and not isinstance(available_version_, (bytes, str)): - raise Exception("Expected available_version_ to be a str, received: {}".format(type(available_version_))) + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - if meter_status_ is not None and not isinstance(meter_status_, (dict, MeterStatus)): - raise Exception("Expected meter_status_ to be a MeterStatus, received: {}".format(type(meter_status_))) + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) - if model_status_ is not None and not isinstance(model_status_, (dict, DetailedStatus)): - raise Exception("Expected model_status_ to be a DetailedStatus, received: {}".format(type(model_status_))) + if scale_change_ is not None and not isinstance(scale_change_, int): + raise Exception("Expected scale_change_ to be a int, received: {}".format(type(scale_change_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + self.application_tag = application_tag_ + self.force = force_ + self.scale = scale_ + self.scale_change = scale_change_ + self.unknown_fields = unknown_fields - if region_ is not None and not isinstance(region_, (bytes, str)): - raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) - if sla_ is not None and not isinstance(sla_, (bytes, str)): - raise Exception("Expected sla_ to be a str, received: {}".format(type(sla_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) +class ScaleApplicationResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : ScaleApplicationInfo + ''' + error_ = Error.from_json(error) if error else None + info_ = ScaleApplicationInfo.from_json(info) if info else None - if version_ is not None and not isinstance(version_, (bytes, str)): - raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.available_version = available_version_ - self.cloud_tag = cloud_tag_ - self.meter_status = meter_status_ - self.model_status = model_status_ - self.name = name_ - self.region = region_ - self.sla = sla_ - self.type_ = type__ - self.version = version_ + if info_ is not None and not isinstance(info_, (dict, ScaleApplicationInfo)): + raise Exception("Expected info_ to be a ScaleApplicationInfo, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ self.unknown_fields = unknown_fields -class ModelStatusResults(Type): - _toSchema = {'models': 'models'} - _toPy = {'models': 'models'} - def __init__(self, models=None, **unknown_fields): +class ScaleApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - models : typing.Sequence[~ModelStatus] + results : typing.Sequence[~ScaleApplicationResult] ''' - models_ = [ModelStatus.from_json(o) for o in models or []] + results_ = [ScaleApplicationResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if models_ is not None and not isinstance(models_, (bytes, str, list)): - raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.models = models_ + self.results = results_ self.unknown_fields = unknown_fields -class ModelSummariesRequest(Type): - _toSchema = {'all_': 'all', 'user_tag': 'user-tag'} - _toPy = {'all': 'all_', 'user-tag': 'user_tag'} - def __init__(self, all_=None, user_tag=None, **unknown_fields): +class ScaleApplicationsParams(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' - all_ : bool - user_tag : str + applications : typing.Sequence[~ScaleApplicationParams] ''' - all__ = all_ - user_tag_ = user_tag + applications_ = [ScaleApplicationParams.from_json(o) for o in applications or []] # Validate arguments against known Juju API types. - if all__ is not None and not isinstance(all__, bool): - raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) - - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - self.all_ = all__ - self.user_tag = user_tag_ + self.applications = applications_ self.unknown_fields = unknown_fields -class ModelSummary(Type): - _toSchema = {'agent_version': 'agent-version', 'cloud_credential_tag': 'cloud-credential-tag', 'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'controller_uuid': 'controller-uuid', 'counts': 'counts', 'default_series': 'default-series', 'is_controller': 'is-controller', 'last_connection': 'last-connection', 'life': 'life', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', 'sla': 'sla', 'status': 'status', 'type_': 'type', 'user_access': 'user-access', 'uuid': 'uuid'} - _toPy = {'agent-version': 'agent_version', 'cloud-credential-tag': 'cloud_credential_tag', 'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'controller-uuid': 'controller_uuid', 'counts': 'counts', 'default-series': 'default_series', 'is-controller': 'is_controller', 'last-connection': 'last_connection', 'life': 'life', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', 'sla': 'sla', 'status': 'status', 'type': 'type_', 'user-access': 'user_access', 'uuid': 'uuid'} - def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_region=None, cloud_tag=None, controller_uuid=None, counts=None, default_series=None, is_controller=None, last_connection=None, life=None, migration=None, name=None, owner_tag=None, provider_type=None, sla=None, status=None, type_=None, user_access=None, uuid=None, **unknown_fields): +class SecretBackend(Type): + _toSchema = {'backend_type': 'backend-type', 'config': 'config', 'name': 'name', 'token_rotate_interval': 'token-rotate-interval'} + _toPy = {'backend-type': 'backend_type', 'config': 'config', 'name': 'name', 'token-rotate-interval': 'token_rotate_interval'} + def __init__(self, backend_type=None, config=None, name=None, token_rotate_interval=None, **unknown_fields): ''' - agent_version : Number - cloud_credential_tag : str - cloud_region : str - cloud_tag : str - controller_uuid : str - counts : typing.Sequence[~ModelEntityCount] - default_series : str - is_controller : bool - last_connection : str - life : str - migration : ModelMigrationStatus + backend_type : str + config : typing.Mapping[str, typing.Any] name : str - owner_tag : str - provider_type : str - sla : ModelSLAInfo - status : EntityStatus - type_ : str - user_access : str - uuid : str + token_rotate_interval : int ''' - agent_version_ = Number.from_json(agent_version) if agent_version else None - cloud_credential_tag_ = cloud_credential_tag - cloud_region_ = cloud_region - cloud_tag_ = cloud_tag - controller_uuid_ = controller_uuid - counts_ = [ModelEntityCount.from_json(o) for o in counts or []] - default_series_ = default_series - is_controller_ = is_controller - last_connection_ = last_connection - life_ = life - migration_ = ModelMigrationStatus.from_json(migration) if migration else None + backend_type_ = backend_type + config_ = config name_ = name - owner_tag_ = owner_tag - provider_type_ = provider_type - sla_ = ModelSLAInfo.from_json(sla) if sla else None - status_ = EntityStatus.from_json(status) if status else None - type__ = type_ - user_access_ = user_access - uuid_ = uuid + token_rotate_interval_ = token_rotate_interval # Validate arguments against known Juju API types. - if agent_version_ is not None and not isinstance(agent_version_, (dict, Number)): - raise Exception("Expected agent_version_ to be a Number, received: {}".format(type(agent_version_))) - - if cloud_credential_tag_ is not None and not isinstance(cloud_credential_tag_, (bytes, str)): - raise Exception("Expected cloud_credential_tag_ to be a str, received: {}".format(type(cloud_credential_tag_))) + if backend_type_ is not None and not isinstance(backend_type_, (bytes, str)): + raise Exception("Expected backend_type_ to be a str, received: {}".format(type(backend_type_))) - if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): - raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): - raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) + if token_rotate_interval_ is not None and not isinstance(token_rotate_interval_, int): + raise Exception("Expected token_rotate_interval_ to be a int, received: {}".format(type(token_rotate_interval_))) - if counts_ is not None and not isinstance(counts_, (bytes, str, list)): - raise Exception("Expected counts_ to be a Sequence, received: {}".format(type(counts_))) + self.backend_type = backend_type_ + self.config = config_ + self.name = name_ + self.token_rotate_interval = token_rotate_interval_ + self.unknown_fields = unknown_fields - if default_series_ is not None and not isinstance(default_series_, (bytes, str)): - raise Exception("Expected default_series_ to be a str, received: {}".format(type(default_series_))) - if is_controller_ is not None and not isinstance(is_controller_, bool): - raise Exception("Expected is_controller_ to be a bool, received: {}".format(type(is_controller_))) - if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): - raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) +class SecretBackendArgs(Type): + _toSchema = {'backend_ids': 'backend-ids', 'for_drain': 'for-drain'} + _toPy = {'backend-ids': 'backend_ids', 'for-drain': 'for_drain'} + def __init__(self, backend_ids=None, for_drain=None, **unknown_fields): + ''' + backend_ids : typing.Sequence[str] + for_drain : bool + ''' + backend_ids_ = backend_ids + for_drain_ = for_drain - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + # Validate arguments against known Juju API types. + 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 migration_ is not None and not isinstance(migration_, (dict, ModelMigrationStatus)): - raise Exception("Expected migration_ to be a ModelMigrationStatus, received: {}".format(type(migration_))) + if for_drain_ is not None and not isinstance(for_drain_, bool): + raise Exception("Expected for_drain_ to be a bool, received: {}".format(type(for_drain_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + self.backend_ids = backend_ids_ + self.for_drain = for_drain_ + self.unknown_fields = unknown_fields - if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): - raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) - if provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): - raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) - if sla_ is not None and not isinstance(sla_, (dict, ModelSLAInfo)): - raise Exception("Expected sla_ to be a ModelSLAInfo, received: {}".format(type(sla_))) +class SecretBackendConfig(Type): + _toSchema = {'params': 'params', 'type_': 'type'} + _toPy = {'params': 'params', 'type': 'type_'} + def __init__(self, params=None, type_=None, **unknown_fields): + ''' + params : typing.Mapping[str, typing.Any] + type_ : str + ''' + params_ = params + type__ = type_ - if status_ is not None and not isinstance(status_, (dict, EntityStatus)): - raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) if type__ is not None and not isinstance(type__, (bytes, str)): raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) - if user_access_ is not None and not isinstance(user_access_, (bytes, str)): - raise Exception("Expected user_access_ to be a str, received: {}".format(type(user_access_))) - - if uuid_ is not None and not isinstance(uuid_, (bytes, str)): - raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) - - self.agent_version = agent_version_ - self.cloud_credential_tag = cloud_credential_tag_ - self.cloud_region = cloud_region_ - self.cloud_tag = cloud_tag_ - self.controller_uuid = controller_uuid_ - self.counts = counts_ - self.default_series = default_series_ - self.is_controller = is_controller_ - self.last_connection = last_connection_ - self.life = life_ - self.migration = migration_ - self.name = name_ - self.owner_tag = owner_tag_ - self.provider_type = provider_type_ - self.sla = sla_ - self.status = status_ + self.params = params_ self.type_ = type__ - self.user_access = user_access_ - self.uuid = uuid_ self.unknown_fields = unknown_fields -class ModelSummaryResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class SecretBackendConfigResult(Type): + _toSchema = {'config': 'config', 'draining': 'draining', 'model_controller': 'model-controller', 'model_name': 'model-name', 'model_uuid': 'model-uuid'} + _toPy = {'config': 'config', 'draining': 'draining', 'model-controller': 'model_controller', 'model-name': 'model_name', 'model-uuid': 'model_uuid'} + def __init__(self, config=None, draining=None, model_controller=None, model_name=None, model_uuid=None, **unknown_fields): ''' - error : Error - result : ModelSummary + config : SecretBackendConfig + draining : bool + model_controller : str + model_name : str + model_uuid : str ''' - error_ = Error.from_json(error) if error else None - result_ = ModelSummary.from_json(result) if result else None + config_ = SecretBackendConfig.from_json(config) if config else None + draining_ = draining + model_controller_ = model_controller + model_name_ = model_name + model_uuid_ = model_uuid # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if config_ is not None and not isinstance(config_, (dict, SecretBackendConfig)): + raise Exception("Expected config_ to be a SecretBackendConfig, received: {}".format(type(config_))) + + if draining_ is not None and not isinstance(draining_, bool): + raise Exception("Expected draining_ to be a bool, received: {}".format(type(draining_))) + + if model_controller_ is not None and not isinstance(model_controller_, (bytes, str)): + raise Exception("Expected model_controller_ to be a str, received: {}".format(type(model_controller_))) + + if model_name_ is not None and not isinstance(model_name_, (bytes, str)): + raise Exception("Expected model_name_ to be a str, received: {}".format(type(model_name_))) - if result_ is not None and not isinstance(result_, (dict, ModelSummary)): - raise Exception("Expected result_ to be a ModelSummary, received: {}".format(type(result_))) + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) - self.error = error_ - self.result = result_ + self.config = config_ + self.draining = draining_ + self.model_controller = model_controller_ + self.model_name = model_name_ + self.model_uuid = model_uuid_ self.unknown_fields = unknown_fields -class ModelSummaryResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class SecretBackendConfigResults(Type): + _toSchema = {'active_id': 'active-id', 'results': 'results'} + _toPy = {'active-id': 'active_id', 'results': 'results'} + def __init__(self, active_id=None, results=None, **unknown_fields): ''' - results : typing.Sequence[~ModelSummaryResult] + active_id : str + results : typing.Mapping[str, ~SecretBackendConfigResult] ''' - results_ = [ModelSummaryResult.from_json(o) for o in results or []] + active_id_ = active_id + results_ = {k: SecretBackendConfigResult.from_json(v) for k, v in (results or dict()).items()} # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if active_id_ is not None and not isinstance(active_id_, (bytes, str)): + raise Exception("Expected active_id_ to be a str, received: {}".format(type(active_id_))) + if results_ is not None and not isinstance(results_, dict): + raise Exception("Expected results_ to be a Mapping, received: {}".format(type(results_))) + + self.active_id = active_id_ self.results = results_ self.unknown_fields = unknown_fields -class ModelTag(Type): - _toSchema = {} - _toPy = {} - def __init__(self, **unknown_fields): +class SecretBackendResult(Type): + _toSchema = {'error': 'error', 'id_': 'id', 'message': 'message', 'num_secrets': 'num-secrets', 'result': 'result', 'status': 'status'} + _toPy = {'error': 'error', 'id': 'id_', 'message': 'message', 'num-secrets': 'num_secrets', 'result': 'result', 'status': 'status'} + def __init__(self, error=None, id_=None, message=None, num_secrets=None, result=None, status=None, **unknown_fields): ''' - + error : Error + id_ : str + message : str + num_secrets : int + result : SecretBackend + status : str ''' - self.unknown_fields = unknown_fields + error_ = Error.from_json(error) if error else None + id__ = id_ + message_ = message + num_secrets_ = num_secrets + result_ = SecretBackend.from_json(result) if result else None + status_ = status + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) -class ModelUnset(Type): - _toSchema = {'keys': 'keys'} - _toPy = {'keys': 'keys'} - def __init__(self, keys=None, **unknown_fields): - ''' - keys : typing.Sequence[str] - ''' - keys_ = keys + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - # Validate arguments against known Juju API types. - if keys_ is not None and not isinstance(keys_, (bytes, str, list)): - raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + if num_secrets_ is not None and not isinstance(num_secrets_, int): + raise Exception("Expected num_secrets_ to be a int, received: {}".format(type(num_secrets_))) - self.keys = keys_ + if result_ is not None and not isinstance(result_, (dict, SecretBackend)): + raise Exception("Expected result_ to be a SecretBackend, received: {}".format(type(result_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.error = error_ + self.id_ = id__ + self.message = message_ + self.num_secrets = num_secrets_ + self.result = result_ + self.status = status_ self.unknown_fields = unknown_fields -class ModelUnsetKeys(Type): - _toSchema = {'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'keys': 'keys'} - _toPy = {'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'keys': 'keys'} - def __init__(self, cloud_region=None, cloud_tag=None, keys=None, **unknown_fields): +class SecretBackendRotateChange(Type): + _toSchema = {'backend_name': 'backend-name', 'id_': 'id', 'next_trigger_time': 'next-trigger-time'} + _toPy = {'backend-name': 'backend_name', 'id': 'id_', 'next-trigger-time': 'next_trigger_time'} + def __init__(self, backend_name=None, id_=None, next_trigger_time=None, **unknown_fields): ''' - cloud_region : str - cloud_tag : str - keys : typing.Sequence[str] + backend_name : str + id_ : str + next_trigger_time : str ''' - cloud_region_ = cloud_region - cloud_tag_ = cloud_tag - keys_ = keys + backend_name_ = backend_name + id__ = id_ + next_trigger_time_ = next_trigger_time # Validate arguments against known Juju API types. - if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): - raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + if backend_name_ is not None and not isinstance(backend_name_, (bytes, str)): + raise Exception("Expected backend_name_ to be a str, received: {}".format(type(backend_name_))) - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - if keys_ is not None and not isinstance(keys_, (bytes, str, list)): - raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + if next_trigger_time_ is not None and not isinstance(next_trigger_time_, (bytes, str)): + raise Exception("Expected next_trigger_time_ to be a str, received: {}".format(type(next_trigger_time_))) - self.cloud_region = cloud_region_ - self.cloud_tag = cloud_tag_ - self.keys = keys_ + self.backend_name = backend_name_ + self.id_ = id__ + self.next_trigger_time = next_trigger_time_ self.unknown_fields = unknown_fields -class ModelUserInfo(Type): - _toSchema = {'access': 'access', 'display_name': 'display-name', 'last_connection': 'last-connection', 'model_tag': 'model-tag', 'user': 'user'} - _toPy = {'access': 'access', 'display-name': 'display_name', 'last-connection': 'last_connection', 'model-tag': 'model_tag', 'user': 'user'} - def __init__(self, access=None, display_name=None, last_connection=None, model_tag=None, user=None, **unknown_fields): +class SecretBackendRotateWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' - access : str - display_name : str - last_connection : str - model_tag : str - user : str + changes : typing.Sequence[~SecretBackendRotateChange] + error : Error + watcher_id : str ''' - access_ = access - display_name_ = display_name - last_connection_ = last_connection - model_tag_ = model_tag - user_ = user + changes_ = [SecretBackendRotateChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if display_name_ is not None and not isinstance(display_name_, (bytes, str)): - raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) - - if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): - raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if user_ is not None and not isinstance(user_, (bytes, str)): - raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) - self.access = access_ - self.display_name = display_name_ - self.last_connection = last_connection_ - self.model_tag = model_tag_ - self.user = user_ + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ self.unknown_fields = unknown_fields -class ModelUserInfoResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class SecretConsumerInfoResult(Type): + _toSchema = {'error': 'error', 'label': 'label', 'revision': 'revision'} + _toPy = {'error': 'error', 'label': 'label', 'revision': 'revision'} + def __init__(self, error=None, label=None, revision=None, **unknown_fields): ''' error : Error - result : ModelUserInfo + label : str + revision : int ''' error_ = Error.from_json(error) if error else None - result_ = ModelUserInfo.from_json(result) if result else None + label_ = label + revision_ = revision # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, ModelUserInfo)): - raise Exception("Expected result_ to be a ModelUserInfo, received: {}".format(type(result_))) + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) self.error = error_ - self.result = result_ + self.label = label_ + self.revision = revision_ self.unknown_fields = unknown_fields -class ModelUserInfoResults(Type): +class SecretConsumerInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ModelUserInfoResult] + results : typing.Sequence[~SecretConsumerInfoResult] ''' - results_ = [ModelUserInfoResult.from_json(o) for o in results or []] + results_ = [SecretConsumerInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -10724,950 +21983,974 @@ def __init__(self, results=None, **unknown_fields): -class ModelVolumeInfo(Type): - _toSchema = {'detachable': 'detachable', 'id_': 'id', 'message': 'message', 'provider_id': 'provider-id', 'status': 'status'} - _toPy = {'detachable': 'detachable', 'id': 'id_', 'message': 'message', 'provider-id': 'provider_id', 'status': 'status'} - def __init__(self, detachable=None, id_=None, message=None, provider_id=None, status=None, **unknown_fields): +class SecretContentParams(Type): + _toSchema = {'data': 'data', 'value_ref': 'value-ref'} + _toPy = {'data': 'data', 'value-ref': 'value_ref'} + def __init__(self, data=None, value_ref=None, **unknown_fields): ''' - detachable : bool - id_ : str - message : str - provider_id : str - status : str + data : typing.Mapping[str, str] + value_ref : SecretValueRef ''' - detachable_ = detachable - id__ = id_ - message_ = message - provider_id_ = provider_id - status_ = status + data_ = data + value_ref_ = SecretValueRef.from_json(value_ref) if value_ref else None # Validate arguments against known Juju API types. - if detachable_ is not None and not isinstance(detachable_, bool): - raise Exception("Expected detachable_ to be a bool, received: {}".format(type(detachable_))) - - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if value_ref_ is not None and not isinstance(value_ref_, (dict, SecretValueRef)): + raise Exception("Expected value_ref_ to be a SecretValueRef, received: {}".format(type(value_ref_))) - self.detachable = detachable_ - self.id_ = id__ - self.message = message_ - self.provider_id = provider_id_ - self.status = status_ + self.data = data_ + self.value_ref = value_ref_ self.unknown_fields = unknown_fields -class ModifyCloudAccess(Type): - _toSchema = {'access': 'access', 'action': 'action', 'cloud_tag': 'cloud-tag', 'user_tag': 'user-tag'} - _toPy = {'access': 'access', 'action': 'action', 'cloud-tag': 'cloud_tag', 'user-tag': 'user_tag'} - def __init__(self, access=None, action=None, cloud_tag=None, user_tag=None, **unknown_fields): +class SecretContentResult(Type): + _toSchema = {'backend_config': 'backend-config', 'content': 'content', 'error': 'error', 'latest_revision': 'latest-revision'} + _toPy = {'backend-config': 'backend_config', 'content': 'content', 'error': 'error', 'latest-revision': 'latest_revision'} + def __init__(self, backend_config=None, content=None, error=None, latest_revision=None, **unknown_fields): ''' - access : str - action : str - cloud_tag : str - user_tag : str + backend_config : SecretBackendConfigResult + content : SecretContentParams + error : Error + latest_revision : int ''' - access_ = access - action_ = action - cloud_tag_ = cloud_tag - user_tag_ = user_tag + backend_config_ = SecretBackendConfigResult.from_json(backend_config) if backend_config else None + content_ = SecretContentParams.from_json(content) if content else None + error_ = Error.from_json(error) if error else None + latest_revision_ = latest_revision # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if action_ is not None and not isinstance(action_, (bytes, str)): - raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + if backend_config_ is not None and not isinstance(backend_config_, (dict, SecretBackendConfigResult)): + raise Exception("Expected backend_config_ to be a SecretBackendConfigResult, received: {}".format(type(backend_config_))) - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): + raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.access = access_ - self.action = action_ - self.cloud_tag = cloud_tag_ - self.user_tag = user_tag_ + if latest_revision_ is not None and not isinstance(latest_revision_, int): + raise Exception("Expected latest_revision_ to be a int, received: {}".format(type(latest_revision_))) + + self.backend_config = backend_config_ + self.content = content_ + self.error = error_ + self.latest_revision = latest_revision_ self.unknown_fields = unknown_fields -class ModifyCloudAccessRequest(Type): - _toSchema = {'changes': 'changes'} - _toPy = {'changes': 'changes'} - def __init__(self, changes=None, **unknown_fields): +class SecretContentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - changes : typing.Sequence[~ModifyCloudAccess] + results : typing.Sequence[~SecretContentResult] ''' - changes_ = [ModifyCloudAccess.from_json(o) for o in changes or []] + results_ = [SecretContentResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if changes_ is not None and not isinstance(changes_, (bytes, str, list)): - raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.changes = changes_ + self.results = results_ self.unknown_fields = unknown_fields -class ModifyControllerAccess(Type): - _toSchema = {'access': 'access', 'action': 'action', 'user_tag': 'user-tag'} - _toPy = {'access': 'access', 'action': 'action', 'user-tag': 'user_tag'} - def __init__(self, access=None, action=None, user_tag=None, **unknown_fields): +class SecretRevision(Type): + _toSchema = {'backend_name': 'backend-name', 'create_time': 'create-time', 'expire_time': 'expire-time', 'revision': 'revision', 'update_time': 'update-time', 'value_ref': 'value-ref'} + _toPy = {'backend-name': 'backend_name', 'create-time': 'create_time', 'expire-time': 'expire_time', 'revision': 'revision', 'update-time': 'update_time', 'value-ref': 'value_ref'} + def __init__(self, backend_name=None, create_time=None, expire_time=None, revision=None, update_time=None, value_ref=None, **unknown_fields): ''' - access : str - action : str - user_tag : str + backend_name : str + create_time : str + expire_time : str + revision : int + update_time : str + value_ref : SecretValueRef ''' - access_ = access - action_ = action - user_tag_ = user_tag + backend_name_ = backend_name + create_time_ = create_time + expire_time_ = expire_time + revision_ = revision + update_time_ = update_time + value_ref_ = SecretValueRef.from_json(value_ref) if value_ref else None # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + if backend_name_ is not None and not isinstance(backend_name_, (bytes, str)): + raise Exception("Expected backend_name_ to be a str, received: {}".format(type(backend_name_))) - if action_ is not None and not isinstance(action_, (bytes, str)): - raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + if create_time_ is not None and not isinstance(create_time_, (bytes, str)): + raise Exception("Expected create_time_ to be a str, received: {}".format(type(create_time_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) - self.access = access_ - self.action = action_ - self.user_tag = user_tag_ + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if update_time_ is not None and not isinstance(update_time_, (bytes, str)): + raise Exception("Expected update_time_ to be a str, received: {}".format(type(update_time_))) + + if value_ref_ is not None and not isinstance(value_ref_, (dict, SecretValueRef)): + raise Exception("Expected value_ref_ to be a SecretValueRef, received: {}".format(type(value_ref_))) + + self.backend_name = backend_name_ + self.create_time = create_time_ + self.expire_time = expire_time_ + self.revision = revision_ + self.update_time = update_time_ + self.value_ref = value_ref_ self.unknown_fields = unknown_fields -class ModifyControllerAccessRequest(Type): - _toSchema = {'changes': 'changes'} - _toPy = {'changes': 'changes'} - def __init__(self, changes=None, **unknown_fields): +class SecretRevisionArg(Type): + _toSchema = {'pending_delete': 'pending-delete', 'revisions': 'revisions', 'uri': 'uri'} + _toPy = {'pending-delete': 'pending_delete', 'revisions': 'revisions', 'uri': 'uri'} + def __init__(self, pending_delete=None, revisions=None, uri=None, **unknown_fields): ''' - changes : typing.Sequence[~ModifyControllerAccess] + pending_delete : bool + revisions : typing.Sequence[int] + uri : str ''' - changes_ = [ModifyControllerAccess.from_json(o) for o in changes or []] + pending_delete_ = pending_delete + revisions_ = revisions + uri_ = uri # Validate arguments against known Juju API types. - if changes_ is not None and not isinstance(changes_, (bytes, str, list)): - raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if 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_))) - self.changes = changes_ + 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_))) + + self.pending_delete = pending_delete_ + self.revisions = revisions_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModifyModelAccess(Type): - _toSchema = {'access': 'access', 'action': 'action', 'model_tag': 'model-tag', 'user_tag': 'user-tag'} - _toPy = {'access': 'access', 'action': 'action', 'model-tag': 'model_tag', 'user-tag': 'user_tag'} - def __init__(self, access=None, action=None, model_tag=None, user_tag=None, **unknown_fields): +class SecretRevisionChange(Type): + _toSchema = {'revision': 'revision', 'uri': 'uri'} + _toPy = {'revision': 'revision', 'uri': 'uri'} + def __init__(self, revision=None, uri=None, **unknown_fields): ''' - access : str - action : str - model_tag : str - user_tag : str + revision : int + uri : str ''' - access_ = access - action_ = action - model_tag_ = model_tag - user_tag_ = user_tag + revision_ = revision + uri_ = uri # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if action_ is not None and not isinstance(action_, (bytes, str)): - raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) - - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) - self.access = access_ - self.action = action_ - self.model_tag = model_tag_ - self.user_tag = user_tag_ + self.revision = revision_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModifyModelAccessRequest(Type): - _toSchema = {'changes': 'changes'} - _toPy = {'changes': 'changes'} - def __init__(self, changes=None, **unknown_fields): +class SecretRevisionWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' - changes : typing.Sequence[~ModifyModelAccess] + changes : typing.Sequence[~SecretRevisionChange] + error : Error + watcher_id : str ''' - changes_ = [ModifyModelAccess.from_json(o) for o in changes or []] + changes_ = [SecretRevisionChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id # Validate arguments against known Juju API types. if changes_ is not None and not isinstance(changes_, (bytes, str, list)): raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ self.unknown_fields = unknown_fields -class ModifyOfferAccess(Type): - _toSchema = {'access': 'access', 'action': 'action', 'offer_url': 'offer-url', 'user_tag': 'user-tag'} - _toPy = {'access': 'access', 'action': 'action', 'offer-url': 'offer_url', 'user-tag': 'user_tag'} - def __init__(self, access=None, action=None, offer_url=None, user_tag=None, **unknown_fields): +class SecretRevisionWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - access : str - action : str - offer_url : str - user_tag : str + results : typing.Sequence[~SecretRevisionWatchResult] ''' - access_ = access - action_ = action - offer_url_ = offer_url - user_tag_ = user_tag + results_ = [SecretRevisionWatchResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if action_ is not None and not isinstance(action_, (bytes, str)): - raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + self.results = results_ + self.unknown_fields = unknown_fields - if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): - raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) - self.access = access_ - self.action = action_ - self.offer_url = offer_url_ - self.user_tag = user_tag_ +class SecretRotatedArg(Type): + _toSchema = {'original_revision': 'original-revision', 'skip': 'skip', 'uri': 'uri'} + _toPy = {'original-revision': 'original_revision', 'skip': 'skip', 'uri': 'uri'} + def __init__(self, original_revision=None, skip=None, uri=None, **unknown_fields): + ''' + original_revision : int + skip : bool + uri : str + ''' + original_revision_ = original_revision + skip_ = skip + uri_ = uri + + # Validate arguments against known Juju API types. + if original_revision_ is not None and not isinstance(original_revision_, int): + raise Exception("Expected original_revision_ to be a int, received: {}".format(type(original_revision_))) + + if skip_ is not None and not isinstance(skip_, bool): + raise Exception("Expected skip_ to be a bool, received: {}".format(type(skip_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.original_revision = original_revision_ + self.skip = skip_ + self.uri = uri_ self.unknown_fields = unknown_fields -class ModifyOfferAccessRequest(Type): - _toSchema = {'changes': 'changes'} - _toPy = {'changes': 'changes'} - def __init__(self, changes=None, **unknown_fields): +class SecretRotatedArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - changes : typing.Sequence[~ModifyOfferAccess] + args : typing.Sequence[~SecretRotatedArg] ''' - changes_ = [ModifyOfferAccess.from_json(o) for o in changes or []] + args_ = [SecretRotatedArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if changes_ is not None and not isinstance(changes_, (bytes, str, list)): - raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.changes = changes_ + self.args = args_ self.unknown_fields = unknown_fields -class ModifyUserSSHKeys(Type): - _toSchema = {'ssh_keys': 'ssh-keys', 'user': 'user'} - _toPy = {'ssh-keys': 'ssh_keys', 'user': 'user'} - def __init__(self, ssh_keys=None, user=None, **unknown_fields): +class SecretTriggerChange(Type): + _toSchema = {'next_trigger_time': 'next-trigger-time', 'revision': 'revision', 'uri': 'uri'} + _toPy = {'next-trigger-time': 'next_trigger_time', 'revision': 'revision', 'uri': 'uri'} + def __init__(self, next_trigger_time=None, revision=None, uri=None, **unknown_fields): ''' - ssh_keys : typing.Sequence[str] - user : str + next_trigger_time : str + revision : int + uri : str ''' - ssh_keys_ = ssh_keys - user_ = user + next_trigger_time_ = next_trigger_time + revision_ = revision + uri_ = uri # Validate arguments against known Juju API types. - if ssh_keys_ is not None and not isinstance(ssh_keys_, (bytes, str, list)): - raise Exception("Expected ssh_keys_ to be a Sequence, received: {}".format(type(ssh_keys_))) + if next_trigger_time_ is not None and not isinstance(next_trigger_time_, (bytes, str)): + raise Exception("Expected next_trigger_time_ to be a str, received: {}".format(type(next_trigger_time_))) - if user_ is not None and not isinstance(user_, (bytes, str)): - raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - self.ssh_keys = ssh_keys_ - self.user = user_ + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.next_trigger_time = next_trigger_time_ + self.revision = revision_ + self.uri = uri_ self.unknown_fields = unknown_fields -class MoveSubnetsParam(Type): - _toSchema = {'force': 'force', 'space_tag': 'space-tag', 'subnets': 'subnets'} - _toPy = {'force': 'force', 'space-tag': 'space_tag', 'subnets': 'subnets'} - def __init__(self, force=None, space_tag=None, subnets=None, **unknown_fields): +class SecretTriggerWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' - force : bool - space_tag : str - subnets : typing.Sequence[str] + changes : typing.Sequence[~SecretTriggerChange] + error : Error + watcher_id : str ''' - force_ = force - space_tag_ = space_tag - subnets_ = subnets + changes_ = [SecretTriggerChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id # Validate arguments against known Juju API types. - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) - if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): - raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): - raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) - self.force = force_ - self.space_tag = space_tag_ - self.subnets = subnets_ + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ self.unknown_fields = unknown_fields -class MoveSubnetsParams(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class SecretValueRef(Type): + _toSchema = {'backend_id': 'backend-id', 'revision_id': 'revision-id'} + _toPy = {'backend-id': 'backend_id', 'revision-id': 'revision_id'} + def __init__(self, backend_id=None, revision_id=None, **unknown_fields): ''' - args : typing.Sequence[~MoveSubnetsParam] + backend_id : str + revision_id : str ''' - args_ = [MoveSubnetsParam.from_json(o) for o in args or []] + backend_id_ = backend_id + revision_id_ = revision_id # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if backend_id_ is not None and not isinstance(backend_id_, (bytes, str)): + raise Exception("Expected backend_id_ to be a str, received: {}".format(type(backend_id_))) - self.args = args_ + if revision_id_ is not None and not isinstance(revision_id_, (bytes, str)): + raise Exception("Expected revision_id_ to be a str, received: {}".format(type(revision_id_))) + + self.backend_id = backend_id_ + self.revision_id = revision_id_ self.unknown_fields = unknown_fields -class MoveSubnetsResult(Type): - _toSchema = {'error': 'error', 'moved_subnets': 'moved-subnets', 'new_space': 'new-space'} - _toPy = {'error': 'error', 'moved-subnets': 'moved_subnets', 'new-space': 'new_space'} - def __init__(self, error=None, moved_subnets=None, new_space=None, **unknown_fields): +class SecretValueResult(Type): + _toSchema = {'data': 'data', 'error': 'error'} + _toPy = {'data': 'data', 'error': 'error'} + def __init__(self, data=None, error=None, **unknown_fields): ''' + data : typing.Mapping[str, str] error : Error - moved_subnets : typing.Sequence[~MovedSubnet] - new_space : str ''' + data_ = data error_ = Error.from_json(error) if error else None - moved_subnets_ = [MovedSubnet.from_json(o) for o in moved_subnets or []] - new_space_ = new_space # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if moved_subnets_ is not None and not isinstance(moved_subnets_, (bytes, str, list)): - raise Exception("Expected moved_subnets_ to be a Sequence, received: {}".format(type(moved_subnets_))) + self.data = data_ + self.error = error_ + self.unknown_fields = unknown_fields - if new_space_ is not None and not isinstance(new_space_, (bytes, str)): - raise Exception("Expected new_space_ to be a str, received: {}".format(type(new_space_))) - self.error = error_ - self.moved_subnets = moved_subnets_ - self.new_space = new_space_ + +class SecretsFilter(Type): + _toSchema = {'label': 'label', 'owner_tag': 'owner-tag', 'revision': 'revision', 'uri': 'uri'} + _toPy = {'label': 'label', 'owner-tag': 'owner_tag', 'revision': 'revision', 'uri': 'uri'} + def __init__(self, label=None, owner_tag=None, revision=None, uri=None, **unknown_fields): + ''' + label : str + owner_tag : str + revision : int + uri : str + ''' + label_ = label + owner_tag_ = owner_tag + revision_ = revision + uri_ = uri + + # Validate arguments against known Juju API types. + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + 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 revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.label = label_ + self.owner_tag = owner_tag_ + self.revision = revision_ + self.uri = uri_ self.unknown_fields = unknown_fields -class MoveSubnetsResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class SerializedModel(Type): + _toSchema = {'bytes_': 'bytes', 'charms': 'charms', 'resources': 'resources', 'tools': 'tools'} + _toPy = {'bytes': 'bytes_', 'charms': 'charms', 'resources': 'resources', 'tools': 'tools'} + def __init__(self, bytes_=None, charms=None, resources=None, tools=None, **unknown_fields): ''' - results : typing.Sequence[~MoveSubnetsResult] + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] ''' - results_ = [MoveSubnetsResult.from_json(o) for o in results or []] + bytes__ = bytes_ + charms_ = charms + resources_ = [SerializedModelResource.from_json(o) for o in resources or []] + tools_ = [SerializedModelTools.from_json(o) for o in tools or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if bytes__ is not None and not isinstance(bytes__, (bytes, str, list)): + raise Exception("Expected bytes__ to be a Sequence, received: {}".format(type(bytes__))) - self.results = results_ + if charms_ is not None and not isinstance(charms_, (bytes, str, list)): + raise Exception("Expected charms_ to be a Sequence, received: {}".format(type(charms_))) + + if resources_ is not None and not isinstance(resources_, (bytes, str, list)): + raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) + + if tools_ is not None and not isinstance(tools_, (bytes, str, list)): + raise Exception("Expected tools_ to be a Sequence, received: {}".format(type(tools_))) + + self.bytes_ = bytes__ + self.charms = charms_ + self.resources = resources_ + self.tools = tools_ self.unknown_fields = unknown_fields -class MovedSubnet(Type): - _toSchema = {'cidr': 'cidr', 'old_space': 'old-space', 'subnet': 'subnet'} - _toPy = {'cidr': 'cidr', 'old-space': 'old_space', 'subnet': 'subnet'} - def __init__(self, cidr=None, old_space=None, subnet=None, **unknown_fields): +class SerializedModelResource(Type): + _toSchema = {'application': 'application', 'application_revision': 'application-revision', 'charmstore_revision': 'charmstore-revision', 'name': 'name', 'unit_revisions': 'unit-revisions'} + _toPy = {'application': 'application', 'application-revision': 'application_revision', 'charmstore-revision': 'charmstore_revision', 'name': 'name', 'unit-revisions': 'unit_revisions'} + def __init__(self, application=None, application_revision=None, charmstore_revision=None, name=None, unit_revisions=None, **unknown_fields): ''' - cidr : str - old_space : str - subnet : str + application : str + application_revision : SerializedModelResourceRevision + charmstore_revision : SerializedModelResourceRevision + name : str + unit_revisions : typing.Mapping[str, ~SerializedModelResourceRevision] ''' - cidr_ = cidr - old_space_ = old_space - subnet_ = subnet + application_ = application + application_revision_ = SerializedModelResourceRevision.from_json(application_revision) if application_revision else None + charmstore_revision_ = SerializedModelResourceRevision.from_json(charmstore_revision) if charmstore_revision else None + name_ = name + unit_revisions_ = {k: SerializedModelResourceRevision.from_json(v) for k, v in (unit_revisions or dict()).items()} # Validate arguments against known Juju API types. - if cidr_ is not None and not isinstance(cidr_, (bytes, str)): - raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) - if old_space_ is not None and not isinstance(old_space_, (bytes, str)): - raise Exception("Expected old_space_ to be a str, received: {}".format(type(old_space_))) + if application_revision_ is not None and not isinstance(application_revision_, (dict, SerializedModelResourceRevision)): + raise Exception("Expected application_revision_ to be a SerializedModelResourceRevision, received: {}".format(type(application_revision_))) - if subnet_ is not None and not isinstance(subnet_, (bytes, str)): - raise Exception("Expected subnet_ to be a str, received: {}".format(type(subnet_))) + if charmstore_revision_ is not None and not isinstance(charmstore_revision_, (dict, SerializedModelResourceRevision)): + raise Exception("Expected charmstore_revision_ to be a SerializedModelResourceRevision, received: {}".format(type(charmstore_revision_))) - self.cidr = cidr_ - self.old_space = old_space_ - self.subnet = subnet_ + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if unit_revisions_ is not None and not isinstance(unit_revisions_, dict): + raise Exception("Expected unit_revisions_ to be a Mapping, received: {}".format(type(unit_revisions_))) + + self.application = application_ + self.application_revision = application_revision_ + self.charmstore_revision = charmstore_revision_ + self.name = name_ + self.unit_revisions = unit_revisions_ self.unknown_fields = unknown_fields -class NetworkInterface(Type): - _toSchema = {'dns_nameservers': 'dns-nameservers', 'gateway': 'gateway', 'ip_addresses': 'ip-addresses', 'is_up': 'is-up', 'mac_address': 'mac-address', 'space': 'space'} - _toPy = {'dns-nameservers': 'dns_nameservers', 'gateway': 'gateway', 'ip-addresses': 'ip_addresses', 'is-up': 'is_up', 'mac-address': 'mac_address', 'space': 'space'} - def __init__(self, dns_nameservers=None, gateway=None, ip_addresses=None, is_up=None, mac_address=None, space=None, **unknown_fields): +class SerializedModelResourceRevision(Type): + _toSchema = {'description': 'description', 'fingerprint': 'fingerprint', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type_': 'type', 'username': 'username'} + _toPy = {'description': 'description', 'fingerprint': 'fingerprint', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type': 'type_', 'username': 'username'} + def __init__(self, description=None, fingerprint=None, origin=None, path=None, revision=None, size=None, timestamp=None, type_=None, username=None, **unknown_fields): ''' - dns_nameservers : typing.Sequence[str] - gateway : str - ip_addresses : typing.Sequence[str] - is_up : bool - mac_address : str - space : str + description : str + fingerprint : str + origin : str + path : str + revision : int + size : int + timestamp : str + type_ : str + username : str ''' - dns_nameservers_ = dns_nameservers - gateway_ = gateway - ip_addresses_ = ip_addresses - is_up_ = is_up - mac_address_ = mac_address - space_ = space + description_ = description + fingerprint_ = fingerprint + origin_ = origin + path_ = path + revision_ = revision + size_ = size + timestamp_ = timestamp + type__ = type_ + username_ = username # Validate arguments against known Juju API types. - if dns_nameservers_ is not None and not isinstance(dns_nameservers_, (bytes, str, list)): - raise Exception("Expected dns_nameservers_ to be a Sequence, received: {}".format(type(dns_nameservers_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if gateway_ is not None and not isinstance(gateway_, (bytes, str)): - raise Exception("Expected gateway_ to be a str, received: {}".format(type(gateway_))) + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str)): + raise Exception("Expected fingerprint_ to be a str, received: {}".format(type(fingerprint_))) - if ip_addresses_ is not None and not isinstance(ip_addresses_, (bytes, str, list)): - raise Exception("Expected ip_addresses_ to be a Sequence, received: {}".format(type(ip_addresses_))) + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) - if is_up_ is not None and not isinstance(is_up_, bool): - raise Exception("Expected is_up_ to be a bool, received: {}".format(type(is_up_))) + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) - if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): - raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) - if space_ is not None and not isinstance(space_, (bytes, str)): - raise Exception("Expected space_ to be a str, received: {}".format(type(space_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - self.dns_nameservers = dns_nameservers_ - self.gateway = gateway_ - self.ip_addresses = ip_addresses_ - self.is_up = is_up_ - self.mac_address = mac_address_ - self.space = space_ + if timestamp_ is not None and not isinstance(timestamp_, (bytes, str)): + raise Exception("Expected timestamp_ to be a str, received: {}".format(type(timestamp_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.description = description_ + self.fingerprint = fingerprint_ + self.origin = origin_ + self.path = path_ + self.revision = revision_ + self.size = size_ + self.timestamp = timestamp_ + self.type_ = type__ + self.username = username_ self.unknown_fields = unknown_fields -class NotifyWatchResult(Type): - _toSchema = {'error': 'error', 'notifywatcherid': 'NotifyWatcherId'} - _toPy = {'NotifyWatcherId': 'notifywatcherid', 'error': 'error'} - def __init__(self, notifywatcherid=None, error=None, **unknown_fields): +class SerializedModelTools(Type): + _toSchema = {'uri': 'uri', 'version': 'version'} + _toPy = {'uri': 'uri', 'version': 'version'} + def __init__(self, uri=None, version=None, **unknown_fields): ''' - notifywatcherid : str - error : Error + uri : str + version : str ''' - notifywatcherid_ = notifywatcherid - error_ = Error.from_json(error) if error else None + uri_ = uri + version_ = version # Validate arguments against known Juju API types. - if notifywatcherid_ is not None and not isinstance(notifywatcherid_, (bytes, str)): - raise Exception("Expected notifywatcherid_ to be a str, received: {}".format(type(notifywatcherid_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) - self.notifywatcherid = notifywatcherid_ - self.error = error_ + self.uri = uri_ + self.version = version_ self.unknown_fields = unknown_fields -class NotifyWatchResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class SetConstraints(Type): + _toSchema = {'application': 'application', 'constraints': 'constraints'} + _toPy = {'application': 'application', 'constraints': 'constraints'} + def __init__(self, application=None, constraints=None, **unknown_fields): ''' - results : typing.Sequence[~NotifyWatchResult] + application : str + constraints : Value ''' - results_ = [NotifyWatchResult.from_json(o) for o in results or []] + application_ = application + constraints_ = Value.from_json(constraints) if constraints else None # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) - self.results = results_ + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + self.application = application_ + self.constraints = constraints_ self.unknown_fields = unknown_fields -class Number(Type): - _toSchema = {'build': 'Build', 'major': 'Major', 'minor': 'Minor', 'patch': 'Patch', 'tag': 'Tag'} - _toPy = {'Build': 'build', 'Major': 'major', 'Minor': 'minor', 'Patch': 'patch', 'Tag': 'tag'} - def __init__(self, build=None, major=None, minor=None, patch=None, tag=None, **unknown_fields): +class SetExternalControllerInfoParams(Type): + _toSchema = {'info': 'info'} + _toPy = {'info': 'info'} + def __init__(self, info=None, **unknown_fields): ''' - build : int - major : int - minor : int - patch : int - tag : str + info : ExternalControllerInfo ''' - build_ = build - major_ = major - minor_ = minor - patch_ = patch - tag_ = tag + info_ = ExternalControllerInfo.from_json(info) if info else None # Validate arguments against known Juju API types. - if build_ is not None and not isinstance(build_, int): - raise Exception("Expected build_ to be a int, received: {}".format(type(build_))) + if info_ is not None and not isinstance(info_, (dict, ExternalControllerInfo)): + raise Exception("Expected info_ to be a ExternalControllerInfo, received: {}".format(type(info_))) - if major_ is not None and not isinstance(major_, int): - raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) - - if minor_ is not None and not isinstance(minor_, int): - raise Exception("Expected minor_ to be a int, received: {}".format(type(minor_))) - - if patch_ is not None and not isinstance(patch_, int): - raise Exception("Expected patch_ to be a int, received: {}".format(type(patch_))) - - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - - self.build = build_ - self.major = major_ - self.minor = minor_ - self.patch = patch_ - self.tag = tag_ + self.info = info_ self.unknown_fields = unknown_fields -class OfferConnection(Type): - _toSchema = {'endpoint': 'endpoint', 'ingress_subnets': 'ingress-subnets', 'relation_id': 'relation-id', 'source_model_tag': 'source-model-tag', 'status': 'status', 'username': 'username'} - _toPy = {'endpoint': 'endpoint', 'ingress-subnets': 'ingress_subnets', 'relation-id': 'relation_id', 'source-model-tag': 'source_model_tag', 'status': 'status', 'username': 'username'} - def __init__(self, endpoint=None, ingress_subnets=None, relation_id=None, source_model_tag=None, status=None, username=None, **unknown_fields): +class SetExternalControllersInfoParams(Type): + _toSchema = {'controllers': 'controllers'} + _toPy = {'controllers': 'controllers'} + def __init__(self, controllers=None, **unknown_fields): ''' - endpoint : str - ingress_subnets : typing.Sequence[str] - relation_id : int - source_model_tag : str - status : EntityStatus - username : str + controllers : typing.Sequence[~SetExternalControllerInfoParams] ''' - endpoint_ = endpoint - ingress_subnets_ = ingress_subnets - relation_id_ = relation_id - source_model_tag_ = source_model_tag - status_ = EntityStatus.from_json(status) if status else None - username_ = username + controllers_ = [SetExternalControllerInfoParams.from_json(o) for o in controllers or []] # Validate arguments against known Juju API types. - if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): - raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + if controllers_ is not None and not isinstance(controllers_, (bytes, str, list)): + raise Exception("Expected controllers_ to be a Sequence, received: {}".format(type(controllers_))) - if ingress_subnets_ is not None and not isinstance(ingress_subnets_, (bytes, str, list)): - raise Exception("Expected ingress_subnets_ to be a Sequence, received: {}".format(type(ingress_subnets_))) + self.controllers = controllers_ + self.unknown_fields = unknown_fields - if relation_id_ is not None and not isinstance(relation_id_, int): - raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) - if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): - raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) - if status_ is not None and not isinstance(status_, (dict, EntityStatus)): - raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) +class SetMachineBlockDevices(Type): + _toSchema = {'machine_block_devices': 'machine-block-devices'} + _toPy = {'machine-block-devices': 'machine_block_devices'} + def __init__(self, machine_block_devices=None, **unknown_fields): + ''' + machine_block_devices : typing.Sequence[~MachineBlockDevices] + ''' + machine_block_devices_ = [MachineBlockDevices.from_json(o) for o in machine_block_devices or []] - if username_ is not None and not isinstance(username_, (bytes, str)): - raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + # Validate arguments against known Juju API types. + if machine_block_devices_ is not None and not isinstance(machine_block_devices_, (bytes, str, list)): + raise Exception("Expected machine_block_devices_ to be a Sequence, received: {}".format(type(machine_block_devices_))) - self.endpoint = endpoint_ - self.ingress_subnets = ingress_subnets_ - self.relation_id = relation_id_ - self.source_model_tag = source_model_tag_ - self.status = status_ - self.username = username_ + self.machine_block_devices = machine_block_devices_ self.unknown_fields = unknown_fields -class OfferFilter(Type): - _toSchema = {'allowed_users': 'allowed-users', 'application_description': 'application-description', 'application_name': 'application-name', 'application_user': 'application-user', 'connected_users': 'connected-users', 'endpoints': 'endpoints', 'model_name': 'model-name', 'offer_name': 'offer-name', 'owner_name': 'owner-name'} - _toPy = {'allowed-users': 'allowed_users', 'application-description': 'application_description', 'application-name': 'application_name', 'application-user': 'application_user', 'connected-users': 'connected_users', 'endpoints': 'endpoints', 'model-name': 'model_name', 'offer-name': 'offer_name', 'owner-name': 'owner_name'} - def __init__(self, allowed_users=None, application_description=None, application_name=None, application_user=None, connected_users=None, endpoints=None, model_name=None, offer_name=None, owner_name=None, **unknown_fields): +class SetMachineNetworkConfig(Type): + _toSchema = {'config': 'config', 'tag': 'tag'} + _toPy = {'config': 'config', 'tag': 'tag'} + def __init__(self, config=None, tag=None, **unknown_fields): ''' - allowed_users : typing.Sequence[str] - application_description : str - application_name : str - application_user : str - connected_users : typing.Sequence[str] - endpoints : typing.Sequence[~EndpointFilterAttributes] - model_name : str - offer_name : str - owner_name : str + config : typing.Sequence[~NetworkConfig] + tag : str ''' - allowed_users_ = allowed_users - application_description_ = application_description - application_name_ = application_name - application_user_ = application_user - connected_users_ = connected_users - endpoints_ = [EndpointFilterAttributes.from_json(o) for o in endpoints or []] - model_name_ = model_name - offer_name_ = offer_name - owner_name_ = owner_name + config_ = [NetworkConfig.from_json(o) for o in config or []] + tag_ = tag # Validate arguments against known Juju API types. - if allowed_users_ is not None and not isinstance(allowed_users_, (bytes, str, list)): - raise Exception("Expected allowed_users_ to be a Sequence, received: {}".format(type(allowed_users_))) - - if application_description_ is not None and not isinstance(application_description_, (bytes, str)): - raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) - - if application_name_ is not None and not isinstance(application_name_, (bytes, str)): - raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) + if config_ is not None and not isinstance(config_, (bytes, str, list)): + raise Exception("Expected config_ to be a Sequence, received: {}".format(type(config_))) - if application_user_ is not None and not isinstance(application_user_, (bytes, str)): - raise Exception("Expected application_user_ to be a str, received: {}".format(type(application_user_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - if connected_users_ is not None and not isinstance(connected_users_, (bytes, str, list)): - raise Exception("Expected connected_users_ to be a Sequence, received: {}".format(type(connected_users_))) + self.config = config_ + self.tag = tag_ + self.unknown_fields = unknown_fields - if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): - raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) - if model_name_ is not None and not isinstance(model_name_, (bytes, str)): - raise Exception("Expected model_name_ to be a str, received: {}".format(type(model_name_))) - if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): - raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) +class SetMachinesAddresses(Type): + _toSchema = {'machine_addresses': 'machine-addresses'} + _toPy = {'machine-addresses': 'machine_addresses'} + def __init__(self, machine_addresses=None, **unknown_fields): + ''' + machine_addresses : typing.Sequence[~MachineAddresses] + ''' + machine_addresses_ = [MachineAddresses.from_json(o) for o in machine_addresses or []] - if owner_name_ is not None and not isinstance(owner_name_, (bytes, str)): - raise Exception("Expected owner_name_ to be a str, received: {}".format(type(owner_name_))) + # Validate arguments against known Juju API types. + if machine_addresses_ is not None and not isinstance(machine_addresses_, (bytes, str, list)): + raise Exception("Expected machine_addresses_ to be a Sequence, received: {}".format(type(machine_addresses_))) - self.allowed_users = allowed_users_ - self.application_description = application_description_ - self.application_name = application_name_ - self.application_user = application_user_ - self.connected_users = connected_users_ - self.endpoints = endpoints_ - self.model_name = model_name_ - self.offer_name = offer_name_ - self.owner_name = owner_name_ + self.machine_addresses = machine_addresses_ self.unknown_fields = unknown_fields -class OfferFilters(Type): - _toSchema = {'filters': 'Filters'} - _toPy = {'Filters': 'filters'} - def __init__(self, filters=None, **unknown_fields): +class SetMigrationPhaseArgs(Type): + _toSchema = {'phase': 'phase'} + _toPy = {'phase': 'phase'} + def __init__(self, phase=None, **unknown_fields): ''' - filters : typing.Sequence[~OfferFilter] + phase : str ''' - filters_ = [OfferFilter.from_json(o) for o in filters or []] + phase_ = phase # Validate arguments against known Juju API types. - if filters_ is not None and not isinstance(filters_, (bytes, str, list)): - raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) - self.filters = filters_ + self.phase = phase_ self.unknown_fields = unknown_fields -class OfferURLs(Type): - _toSchema = {'bakery_version': 'bakery-version', 'offer_urls': 'offer-urls'} - _toPy = {'bakery-version': 'bakery_version', 'offer-urls': 'offer_urls'} - def __init__(self, bakery_version=None, offer_urls=None, **unknown_fields): +class SetMigrationStatusMessageArgs(Type): + _toSchema = {'message': 'message'} + _toPy = {'message': 'message'} + def __init__(self, message=None, **unknown_fields): ''' - bakery_version : int - offer_urls : typing.Sequence[str] + message : str ''' - bakery_version_ = bakery_version - offer_urls_ = offer_urls + message_ = message # Validate arguments against known Juju API types. - if bakery_version_ is not None and not isinstance(bakery_version_, int): - raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) - - if offer_urls_ is not None and not isinstance(offer_urls_, (bytes, str, list)): - raise Exception("Expected offer_urls_ to be a Sequence, received: {}".format(type(offer_urls_))) + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - self.bakery_version = bakery_version_ - self.offer_urls = offer_urls_ + self.message = message_ self.unknown_fields = unknown_fields -class OfferUserDetails(Type): - _toSchema = {'access': 'access', 'display_name': 'display-name', 'user': 'user'} - _toPy = {'access': 'access', 'display-name': 'display_name', 'user': 'user'} - def __init__(self, access=None, display_name=None, user=None, **unknown_fields): +class SetModelDefaults(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' - access : str - display_name : str - user : str + config : typing.Sequence[~ModelDefaultValues] ''' - access_ = access - display_name_ = display_name - user_ = user + config_ = [ModelDefaultValues.from_json(o) for o in config or []] # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if display_name_ is not None and not isinstance(display_name_, (bytes, str)): - raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) - - if user_ is not None and not isinstance(user_, (bytes, str)): - raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + if config_ is not None and not isinstance(config_, (bytes, str, list)): + raise Exception("Expected config_ to be a Sequence, received: {}".format(type(config_))) - self.access = access_ - self.display_name = display_name_ - self.user = user_ + self.config = config_ self.unknown_fields = unknown_fields -class OperationQueryArgs(Type): - _toSchema = {'actions': 'actions', 'applications': 'applications', 'limit': 'limit', 'machines': 'machines', 'offset': 'offset', 'status': 'status', 'units': 'units'} - _toPy = {'actions': 'actions', 'applications': 'applications', 'limit': 'limit', 'machines': 'machines', 'offset': 'offset', 'status': 'status', 'units': 'units'} - def __init__(self, actions=None, applications=None, limit=None, machines=None, offset=None, status=None, units=None, **unknown_fields): +class SetModelEnvironVersion(Type): + _toSchema = {'model_tag': 'model-tag', 'version': 'version'} + _toPy = {'model-tag': 'model_tag', 'version': 'version'} + def __init__(self, model_tag=None, version=None, **unknown_fields): ''' - actions : typing.Sequence[str] - applications : typing.Sequence[str] - limit : int - machines : typing.Sequence[str] - offset : int - status : typing.Sequence[str] - units : typing.Sequence[str] + model_tag : str + version : int ''' - actions_ = actions - applications_ = applications - limit_ = limit - machines_ = machines - offset_ = offset - status_ = status - units_ = units + model_tag_ = model_tag + version_ = version # Validate arguments against known Juju API types. - if actions_ is not None and not isinstance(actions_, (bytes, str, list)): - raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + if 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 applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) - if limit_ is not None and not isinstance(limit_, int): - raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + self.model_tag = model_tag_ + self.version = version_ + self.unknown_fields = unknown_fields - if machines_ is not None and not isinstance(machines_, (bytes, str, list)): - raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) - if offset_ is not None and not isinstance(offset_, int): - raise Exception("Expected offset_ to be a int, received: {}".format(type(offset_))) - if status_ is not None and not isinstance(status_, (bytes, str, list)): - raise Exception("Expected status_ to be a Sequence, received: {}".format(type(status_))) +class SetModelEnvironVersions(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~SetModelEnvironVersion] + ''' + models_ = [SetModelEnvironVersion.from_json(o) for o in models or []] - if units_ is not None and not isinstance(units_, (bytes, str, list)): - raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) - self.actions = actions_ - self.applications = applications_ - self.limit = limit_ - self.machines = machines_ - self.offset = offset_ - self.status = status_ - self.units = units_ + self.models = models_ self.unknown_fields = unknown_fields -class OperationResult(Type): - _toSchema = {'actions': 'actions', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'fail': 'fail', 'operation': 'operation', 'started': 'started', 'status': 'status', 'summary': 'summary'} - _toPy = {'actions': 'actions', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'fail': 'fail', 'operation': 'operation', 'started': 'started', 'status': 'status', 'summary': 'summary'} - def __init__(self, actions=None, completed=None, enqueued=None, error=None, fail=None, operation=None, started=None, status=None, summary=None, **unknown_fields): +class SetPayloadStatusArg(Type): + _toSchema = {'entity': 'Entity', 'status': 'status', 'tag': 'tag'} + _toPy = {'Entity': 'entity', 'status': 'status', 'tag': 'tag'} + def __init__(self, entity=None, status=None, tag=None, **unknown_fields): ''' - actions : typing.Sequence[~ActionResult] - completed : str - enqueued : str - error : Error - fail : str - operation : str - started : str + entity : Entity status : str - summary : str + tag : str ''' - actions_ = [ActionResult.from_json(o) for o in actions or []] - completed_ = completed - enqueued_ = enqueued - error_ = Error.from_json(error) if error else None - fail_ = fail - operation_ = operation - started_ = started + entity_ = Entity.from_json(entity) if entity else None status_ = status - summary_ = summary + tag_ = tag # Validate arguments against known Juju API types. - if actions_ is not None and not isinstance(actions_, (bytes, str, list)): - raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - if completed_ is not None and not isinstance(completed_, (bytes, str)): - raise Exception("Expected completed_ to be a str, received: {}".format(type(completed_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - if enqueued_ is not None and not isinstance(enqueued_, (bytes, str)): - raise Exception("Expected enqueued_ to be a str, received: {}".format(type(enqueued_))) + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + self.entity = entity_ + self.status = status_ + self.tag = tag_ + self.unknown_fields = unknown_fields - if fail_ is not None and not isinstance(fail_, (bytes, str)): - raise Exception("Expected fail_ to be a str, received: {}".format(type(fail_))) - if operation_ is not None and not isinstance(operation_, (bytes, str)): - raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) - if started_ is not None and not isinstance(started_, (bytes, str)): - raise Exception("Expected started_ to be a str, received: {}".format(type(started_))) +class SetPayloadStatusArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetPayloadStatusArg] + ''' + args_ = [SetPayloadStatusArg.from_json(o) for o in args or []] - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - if summary_ is not None and not isinstance(summary_, (bytes, str)): - raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + self.args = args_ + self.unknown_fields = unknown_fields - self.actions = actions_ - self.completed = completed_ - self.enqueued = enqueued_ - self.error = error_ - self.fail = fail_ - self.operation = operation_ - self.started = started_ - self.status = status_ - self.summary = summary_ + + +class SetPodSpecParams(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Sequence[~EntityString] + ''' + specs_ = [EntityString.from_json(o) for o in specs or []] + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + + self.specs = specs_ self.unknown_fields = unknown_fields -class OperationResults(Type): - _toSchema = {'results': 'results', 'truncated': 'truncated'} - _toPy = {'results': 'results', 'truncated': 'truncated'} - def __init__(self, results=None, truncated=None, **unknown_fields): +class SetProfileArg(Type): + _toSchema = {'entity': 'entity', 'profiles': 'profiles'} + _toPy = {'entity': 'entity', 'profiles': 'profiles'} + def __init__(self, entity=None, profiles=None, **unknown_fields): ''' - results : typing.Sequence[~OperationResult] - truncated : bool + entity : Entity + profiles : typing.Sequence[str] ''' - results_ = [OperationResult.from_json(o) for o in results or []] - truncated_ = truncated + entity_ = Entity.from_json(entity) if entity else None + profiles_ = profiles # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - if truncated_ is not None and not isinstance(truncated_, bool): - raise Exception("Expected truncated_ to be a bool, received: {}".format(type(truncated_))) + if profiles_ is not None and not isinstance(profiles_, (bytes, str, list)): + raise Exception("Expected profiles_ to be a Sequence, received: {}".format(type(profiles_))) - self.results = results_ - self.truncated = truncated_ + self.entity = entity_ + self.profiles = profiles_ self.unknown_fields = unknown_fields -class Payload(Type): - _toSchema = {'class_': 'class', 'id_': 'id', 'labels': 'labels', 'machine': 'machine', 'status': 'status', 'type_': 'type', 'unit': 'unit'} - _toPy = {'class': 'class_', 'id': 'id_', 'labels': 'labels', 'machine': 'machine', 'status': 'status', 'type': 'type_', 'unit': 'unit'} - def __init__(self, class_=None, id_=None, labels=None, machine=None, status=None, type_=None, unit=None, **unknown_fields): +class SetProfileArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - class_ : str - id_ : str - labels : typing.Sequence[str] - machine : str - status : str - type_ : str - unit : str + args : typing.Sequence[~SetProfileArg] ''' - class__ = class_ - id__ = id_ - labels_ = labels - machine_ = machine - status_ = status - type__ = type_ - unit_ = unit + args_ = [SetProfileArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if class__ is not None and not isinstance(class__, (bytes, str)): - raise Exception("Expected class__ to be a str, received: {}".format(type(class__))) - - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - if labels_ is not None and not isinstance(labels_, (bytes, str, list)): - raise Exception("Expected labels_ to be a Sequence, received: {}".format(type(labels_))) + self.args = args_ + self.unknown_fields = unknown_fields - if machine_ is not None and not isinstance(machine_, (bytes, str)): - raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) +class SetProviderNetworkConfig(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ProviderNetworkConfig] + ''' + args_ = [ProviderNetworkConfig.from_json(o) for o in args or []] - if unit_ is not None and not isinstance(unit_, (bytes, str)): - raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.class_ = class__ - self.id_ = id__ - self.labels = labels_ - self.machine = machine_ - self.status = status_ - self.type_ = type__ - self.unit = unit_ + self.args = args_ self.unknown_fields = unknown_fields -class PayloadListArgs(Type): - _toSchema = {'patterns': 'patterns'} - _toPy = {'patterns': 'patterns'} - def __init__(self, patterns=None, **unknown_fields): +class SetProviderNetworkConfigResult(Type): + _toSchema = {'addresses': 'addresses', 'error': 'error', 'modified': 'modified'} + _toPy = {'addresses': 'addresses', 'error': 'error', 'modified': 'modified'} + def __init__(self, addresses=None, error=None, modified=None, **unknown_fields): ''' - patterns : typing.Sequence[str] + addresses : typing.Sequence[~Address] + error : Error + modified : bool ''' - patterns_ = patterns + addresses_ = [Address.from_json(o) for o in addresses or []] + error_ = Error.from_json(error) if error else None + modified_ = modified # Validate arguments against known Juju API types. - if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): - raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) - self.patterns = patterns_ + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if modified_ is not None and not isinstance(modified_, bool): + raise Exception("Expected modified_ to be a bool, received: {}".format(type(modified_))) + + self.addresses = addresses_ + self.error = error_ + self.modified = modified_ self.unknown_fields = unknown_fields -class PayloadListResults(Type): +class SetProviderNetworkConfigResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~Payload] + results : typing.Sequence[~SetProviderNetworkConfigResult] ''' - results_ = [Payload.from_json(o) for o in results or []] + results_ = [SetProviderNetworkConfigResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -11678,146 +22961,170 @@ def __init__(self, results=None, **unknown_fields): -class PendingResourceUpload(Type): - _toSchema = {'filename': 'Filename', 'name': 'Name', 'type_': 'Type'} - _toPy = {'Filename': 'filename', 'Name': 'name', 'Type': 'type_'} - def __init__(self, filename=None, name=None, type_=None, **unknown_fields): +class SetStatus(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' - filename : str - name : str - type_ : str + entities : typing.Sequence[~EntityStatusArgs] ''' - filename_ = filename - name_ = name - type__ = type_ + entities_ = [EntityStatusArgs.from_json(o) for o in entities or []] # Validate arguments against known Juju API types. - if filename_ is not None and not isinstance(filename_, (bytes, str)): - raise Exception("Expected filename_ to be a str, received: {}".format(type(filename_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - self.filename = filename_ - self.name = name_ - self.type_ = type__ + self.entities = entities_ self.unknown_fields = unknown_fields -class Placement(Type): - _toSchema = {'directive': 'directive', 'scope': 'scope'} - _toPy = {'directive': 'directive', 'scope': 'scope'} - def __init__(self, directive=None, scope=None, **unknown_fields): +class SetUnitStateArg(Type): + _toSchema = {'charm_state': 'charm-state', 'meter_status_state': 'meter-status-state', 'relation_state': 'relation-state', 'secret_state': 'secret-state', 'storage_state': 'storage-state', 'tag': 'tag', 'uniter_state': 'uniter-state'} + _toPy = {'charm-state': 'charm_state', 'meter-status-state': 'meter_status_state', 'relation-state': 'relation_state', 'secret-state': 'secret_state', 'storage-state': 'storage_state', 'tag': 'tag', 'uniter-state': 'uniter_state'} + def __init__(self, charm_state=None, meter_status_state=None, relation_state=None, secret_state=None, storage_state=None, tag=None, uniter_state=None, **unknown_fields): ''' - directive : str - scope : str + charm_state : typing.Mapping[str, str] + meter_status_state : str + relation_state : typing.Mapping[str, str] + secret_state : str + storage_state : str + tag : str + uniter_state : str ''' - directive_ = directive - scope_ = scope + charm_state_ = charm_state + meter_status_state_ = meter_status_state + relation_state_ = relation_state + secret_state_ = secret_state + storage_state_ = storage_state + tag_ = tag + uniter_state_ = uniter_state # Validate arguments against known Juju API types. - if directive_ is not None and not isinstance(directive_, (bytes, str)): - raise Exception("Expected directive_ to be a str, received: {}".format(type(directive_))) + if charm_state_ is not None and not isinstance(charm_state_, dict): + raise Exception("Expected charm_state_ to be a Mapping, received: {}".format(type(charm_state_))) - if scope_ is not None and not isinstance(scope_, (bytes, str)): - raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + if meter_status_state_ is not None and not isinstance(meter_status_state_, (bytes, str)): + raise Exception("Expected meter_status_state_ to be a str, received: {}".format(type(meter_status_state_))) - self.directive = directive_ - self.scope = scope_ - self.unknown_fields = unknown_fields + if relation_state_ is not None and not isinstance(relation_state_, dict): + raise Exception("Expected relation_state_ to be a Mapping, received: {}".format(type(relation_state_))) + if secret_state_ is not None and not isinstance(secret_state_, (bytes, str)): + raise Exception("Expected secret_state_ to be a str, received: {}".format(type(secret_state_))) + if storage_state_ is not None and not isinstance(storage_state_, (bytes, str)): + raise Exception("Expected storage_state_ to be a str, received: {}".format(type(storage_state_))) -class ProvisioningScriptParams(Type): - _toSchema = {'data_dir': 'data-dir', 'disable_package_commands': 'disable-package-commands', 'machine_id': 'machine-id', 'nonce': 'nonce'} - _toPy = {'data-dir': 'data_dir', 'disable-package-commands': 'disable_package_commands', 'machine-id': 'machine_id', 'nonce': 'nonce'} - def __init__(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None, **unknown_fields): - ''' - data_dir : str - disable_package_commands : bool - machine_id : str - nonce : str - ''' - data_dir_ = data_dir - disable_package_commands_ = disable_package_commands - machine_id_ = machine_id - nonce_ = nonce + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - # Validate arguments against known Juju API types. - if data_dir_ is not None and not isinstance(data_dir_, (bytes, str)): - raise Exception("Expected data_dir_ to be a str, received: {}".format(type(data_dir_))) + if uniter_state_ is not None and not isinstance(uniter_state_, (bytes, str)): + raise Exception("Expected uniter_state_ to be a str, received: {}".format(type(uniter_state_))) - if disable_package_commands_ is not None and not isinstance(disable_package_commands_, bool): - raise Exception("Expected disable_package_commands_ to be a bool, received: {}".format(type(disable_package_commands_))) + self.charm_state = charm_state_ + self.meter_status_state = meter_status_state_ + self.relation_state = relation_state_ + self.secret_state = secret_state_ + self.storage_state = storage_state_ + self.tag = tag_ + self.uniter_state = uniter_state_ + self.unknown_fields = unknown_fields - if machine_id_ is not None and not isinstance(machine_id_, (bytes, str)): - raise Exception("Expected machine_id_ to be a str, received: {}".format(type(machine_id_))) - if nonce_ is not None and not isinstance(nonce_, (bytes, str)): - raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) - self.data_dir = data_dir_ - self.disable_package_commands = disable_package_commands_ - self.machine_id = machine_id_ - self.nonce = nonce_ +class SetUnitStateArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetUnitStateArg] + ''' + args_ = [SetUnitStateArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ self.unknown_fields = unknown_fields -class ProvisioningScriptResult(Type): - _toSchema = {'script': 'script'} - _toPy = {'script': 'script'} - def __init__(self, script=None, **unknown_fields): +class Settings(Type): + _toSchema = {'autonoproxy': 'AutoNoProxy', 'ftp': 'Ftp', 'http': 'Http', 'https': 'Https', 'noproxy': 'NoProxy'} + _toPy = {'AutoNoProxy': 'autonoproxy', 'Ftp': 'ftp', 'Http': 'http', 'Https': 'https', 'NoProxy': 'noproxy'} + def __init__(self, autonoproxy=None, ftp=None, http=None, https=None, noproxy=None, **unknown_fields): ''' - script : str + autonoproxy : str + ftp : str + http : str + https : str + noproxy : str ''' - script_ = script + autonoproxy_ = autonoproxy + ftp_ = ftp + http_ = http + https_ = https + noproxy_ = noproxy # Validate arguments against known Juju API types. - if script_ is not None and not isinstance(script_, (bytes, str)): - raise Exception("Expected script_ to be a str, received: {}".format(type(script_))) + if autonoproxy_ is not None and not isinstance(autonoproxy_, (bytes, str)): + raise Exception("Expected autonoproxy_ to be a str, received: {}".format(type(autonoproxy_))) - self.script = script_ + if ftp_ is not None and not isinstance(ftp_, (bytes, str)): + raise Exception("Expected ftp_ to be a str, received: {}".format(type(ftp_))) + + if http_ is not None and not isinstance(http_, (bytes, str)): + raise Exception("Expected http_ to be a str, received: {}".format(type(http_))) + + if https_ is not None and not isinstance(https_, (bytes, str)): + raise Exception("Expected https_ to be a str, received: {}".format(type(https_))) + + if noproxy_ is not None and not isinstance(noproxy_, (bytes, str)): + raise Exception("Expected noproxy_ to be a str, received: {}".format(type(noproxy_))) + + self.autonoproxy = autonoproxy_ + self.ftp = ftp_ + self.http = http_ + self.https = https_ + self.noproxy = noproxy_ self.unknown_fields = unknown_fields -class Proxy(Type): - _toSchema = {'config': 'config', 'type_': 'type'} - _toPy = {'config': 'config', 'type': 'type_'} - def __init__(self, config=None, type_=None, **unknown_fields): +class SettingsResult(Type): + _toSchema = {'error': 'error', 'settings': 'settings'} + _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): ''' - config : typing.Mapping[str, typing.Any] - type_ : str + error : Error + settings : typing.Mapping[str, str] ''' - config_ = config - type__ = type_ + error_ = Error.from_json(error) if error else None + settings_ = settings # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) - self.config = config_ - self.type_ = type__ + self.error = error_ + self.settings = settings_ self.unknown_fields = unknown_fields -class QueryApplicationOffersResults(Type): +class SettingsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ApplicationOfferAdminDetails] + results : typing.Sequence[~SettingsResult] ''' - results_ = [ApplicationOfferAdminDetails.from_json(o) for o in results or []] + results_ = [SettingsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -11828,551 +23135,518 @@ def __init__(self, results=None, **unknown_fields): -class RedirectInfoResult(Type): - _toSchema = {'ca_cert': 'ca-cert', 'servers': 'servers'} - _toPy = {'ca-cert': 'ca_cert', 'servers': 'servers'} - def __init__(self, ca_cert=None, servers=None, **unknown_fields): +class ShowSpaceResult(Type): + _toSchema = {'applications': 'applications', 'error': 'error', 'machine_count': 'machine-count', 'space': 'space'} + _toPy = {'applications': 'applications', 'error': 'error', 'machine-count': 'machine_count', 'space': 'space'} + def __init__(self, applications=None, error=None, machine_count=None, space=None, **unknown_fields): ''' - ca_cert : str - servers : typing.Sequence[~HostPort] + applications : typing.Sequence[str] + error : Error + machine_count : int + space : Space ''' - ca_cert_ = ca_cert - servers_ = [HostPort.from_json(o) for o in servers or []] + applications_ = applications + error_ = Error.from_json(error) if error else None + machine_count_ = machine_count + space_ = Space.from_json(space) if space else None # Validate arguments against known Juju API types. - if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): - raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) - - if servers_ is not None and not isinstance(servers_, (bytes, str, list)): - raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) - - self.ca_cert = ca_cert_ - self.servers = servers_ - self.unknown_fields = unknown_fields - + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) -class RegionDefaults(Type): - _toSchema = {'region_name': 'region-name', 'value': 'value'} - _toPy = {'region-name': 'region_name', 'value': 'value'} - def __init__(self, region_name=None, value=None, **unknown_fields): - ''' - region_name : str - value : Any - ''' - region_name_ = region_name - value_ = value + if machine_count_ is not None and not isinstance(machine_count_, int): + raise Exception("Expected machine_count_ to be a int, received: {}".format(type(machine_count_))) - # Validate arguments against known Juju API types. - if region_name_ is not None and not isinstance(region_name_, (bytes, str)): - raise Exception("Expected region_name_ to be a str, received: {}".format(type(region_name_))) + if space_ is not None and not isinstance(space_, (dict, Space)): + raise Exception("Expected space_ to be a Space, received: {}".format(type(space_))) - self.region_name = region_name_ - self.value = value_ + self.applications = applications_ + self.error = error_ + self.machine_count = machine_count_ + self.space = space_ self.unknown_fields = unknown_fields -class RelationData(Type): - _toSchema = {'inscope': 'InScope', 'unitdata': 'UnitData'} - _toPy = {'InScope': 'inscope', 'UnitData': 'unitdata'} - def __init__(self, inscope=None, unitdata=None, **unknown_fields): +class ShowSpaceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - inscope : bool - unitdata : typing.Mapping[str, typing.Any] + results : typing.Sequence[~ShowSpaceResult] ''' - inscope_ = inscope - unitdata_ = unitdata + results_ = [ShowSpaceResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if inscope_ is not None and not isinstance(inscope_, bool): - raise Exception("Expected inscope_ to be a bool, received: {}".format(type(inscope_))) - - if unitdata_ is not None and not isinstance(unitdata_, dict): - raise Exception("Expected unitdata_ to be a Mapping, received: {}".format(type(unitdata_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.inscope = inscope_ - self.unitdata = unitdata_ + self.results = results_ self.unknown_fields = unknown_fields -class RelationStatus(Type): - _toSchema = {'endpoints': 'endpoints', 'id_': 'id', 'interface': 'interface', 'key': 'key', 'scope': 'scope', 'status': 'status'} - _toPy = {'endpoints': 'endpoints', 'id': 'id_', 'interface': 'interface', 'key': 'key', 'scope': 'scope', 'status': 'status'} - def __init__(self, endpoints=None, id_=None, interface=None, key=None, scope=None, status=None, **unknown_fields): +class SingularClaim(Type): + _toSchema = {'claimant_tag': 'claimant-tag', 'duration': 'duration', 'entity_tag': 'entity-tag'} + _toPy = {'claimant-tag': 'claimant_tag', 'duration': 'duration', 'entity-tag': 'entity_tag'} + def __init__(self, claimant_tag=None, duration=None, entity_tag=None, **unknown_fields): ''' - endpoints : typing.Sequence[~EndpointStatus] - id_ : int - interface : str - key : str - scope : str - status : DetailedStatus + claimant_tag : str + duration : int + entity_tag : str ''' - endpoints_ = [EndpointStatus.from_json(o) for o in endpoints or []] - id__ = id_ - interface_ = interface - key_ = key - scope_ = scope - status_ = DetailedStatus.from_json(status) if status else None + claimant_tag_ = claimant_tag + duration_ = duration + entity_tag_ = entity_tag # Validate arguments against known Juju API types. - if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): - raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + if claimant_tag_ is not None and not isinstance(claimant_tag_, (bytes, str)): + raise Exception("Expected claimant_tag_ to be a str, received: {}".format(type(claimant_tag_))) - if id__ is not None and not isinstance(id__, int): - raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) - - if interface_ is not None and not isinstance(interface_, (bytes, str)): - raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) - - if key_ is not None and not isinstance(key_, (bytes, str)): - raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + if duration_ is not None and not isinstance(duration_, int): + raise Exception("Expected duration_ to be a int, received: {}".format(type(duration_))) - if scope_ is not None and not isinstance(scope_, (bytes, str)): - raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) - - if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): - raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + if entity_tag_ is not None and not isinstance(entity_tag_, (bytes, str)): + raise Exception("Expected entity_tag_ to be a str, received: {}".format(type(entity_tag_))) - self.endpoints = endpoints_ - self.id_ = id__ - self.interface = interface_ - self.key = key_ - self.scope = scope_ - self.status = status_ + self.claimant_tag = claimant_tag_ + self.duration = duration_ + self.entity_tag = entity_tag_ self.unknown_fields = unknown_fields -class RelationSuspendedArg(Type): - _toSchema = {'message': 'message', 'relation_id': 'relation-id', 'suspended': 'suspended'} - _toPy = {'message': 'message', 'relation-id': 'relation_id', 'suspended': 'suspended'} - def __init__(self, message=None, relation_id=None, suspended=None, **unknown_fields): +class SingularClaims(Type): + _toSchema = {'claims': 'claims'} + _toPy = {'claims': 'claims'} + def __init__(self, claims=None, **unknown_fields): ''' - message : str - relation_id : int - suspended : bool + claims : typing.Sequence[~SingularClaim] ''' - message_ = message - relation_id_ = relation_id - suspended_ = suspended + claims_ = [SingularClaim.from_json(o) for o in claims or []] # Validate arguments against known Juju API types. - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - - if relation_id_ is not None and not isinstance(relation_id_, int): - raise Exception("Expected relation_id_ to be a int, received: {}".format(type(relation_id_))) - - if suspended_ is not None and not isinstance(suspended_, bool): - raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + if claims_ is not None and not isinstance(claims_, (bytes, str, list)): + raise Exception("Expected claims_ to be a Sequence, received: {}".format(type(claims_))) - self.message = message_ - self.relation_id = relation_id_ - self.suspended = suspended_ + self.claims = claims_ self.unknown_fields = unknown_fields -class RelationSuspendedArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class Space(Type): + _toSchema = {'error': 'error', 'id_': 'id', 'name': 'name', 'subnets': 'subnets'} + _toPy = {'error': 'error', 'id': 'id_', 'name': 'name', 'subnets': 'subnets'} + def __init__(self, error=None, id_=None, name=None, subnets=None, **unknown_fields): ''' - args : typing.Sequence[~RelationSuspendedArg] + error : Error + id_ : str + name : str + subnets : typing.Sequence[~Subnet] ''' - args_ = [RelationSuspendedArg.from_json(o) for o in args or []] + error_ = Error.from_json(error) if error else None + id__ = id_ + name_ = name + subnets_ = [Subnet.from_json(o) for o in subnets or []] # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.args = args_ + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.error = error_ + self.id_ = id__ + self.name = name_ + self.subnets = subnets_ self.unknown_fields = unknown_fields -class RemoteApplicationInfo(Type): - _toSchema = {'description': 'description', 'endpoints': 'endpoints', 'icon_url_path': 'icon-url-path', 'model_tag': 'model-tag', 'name': 'name', 'offer_url': 'offer-url', 'source_model_label': 'source-model-label'} - _toPy = {'description': 'description', 'endpoints': 'endpoints', 'icon-url-path': 'icon_url_path', 'model-tag': 'model_tag', 'name': 'name', 'offer-url': 'offer_url', 'source-model-label': 'source_model_label'} - def __init__(self, description=None, endpoints=None, icon_url_path=None, model_tag=None, name=None, offer_url=None, source_model_label=None, **unknown_fields): +class SpaceInfo(Type): + _toSchema = {'id_': 'id', 'name': 'name', 'provider_id': 'provider-id', 'subnets': 'subnets'} + _toPy = {'id': 'id_', 'name': 'name', 'provider-id': 'provider_id', 'subnets': 'subnets'} + def __init__(self, id_=None, name=None, provider_id=None, subnets=None, **unknown_fields): ''' - description : str - endpoints : typing.Sequence[~RemoteEndpoint] - icon_url_path : str - model_tag : str + id_ : str name : str - offer_url : str - source_model_label : str + provider_id : str + subnets : typing.Sequence[~SubnetV3] ''' - description_ = description - endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] - icon_url_path_ = icon_url_path - model_tag_ = model_tag + id__ = id_ name_ = name - offer_url_ = offer_url - source_model_label_ = source_model_label + provider_id_ = provider_id + subnets_ = [SubnetV3.from_json(o) for o in subnets or []] # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - - if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): - raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) - - if icon_url_path_ is not None and not isinstance(icon_url_path_, (bytes, str)): - raise Exception("Expected icon_url_path_ to be a str, received: {}".format(type(icon_url_path_))) - - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): - raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - if source_model_label_ is not None and not isinstance(source_model_label_, (bytes, str)): - raise Exception("Expected source_model_label_ to be a str, received: {}".format(type(source_model_label_))) + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) - self.description = description_ - self.endpoints = endpoints_ - self.icon_url_path = icon_url_path_ - self.model_tag = model_tag_ + self.id_ = id__ self.name = name_ - self.offer_url = offer_url_ - self.source_model_label = source_model_label_ + self.provider_id = provider_id_ + self.subnets = subnets_ self.unknown_fields = unknown_fields -class RemoteApplicationInfoResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class SpaceInfos(Type): + _toSchema = {'space_infos': 'space-infos'} + _toPy = {'space-infos': 'space_infos'} + def __init__(self, space_infos=None, **unknown_fields): ''' - error : Error - result : RemoteApplicationInfo + space_infos : typing.Sequence[~SpaceInfo] ''' - error_ = Error.from_json(error) if error else None - result_ = RemoteApplicationInfo.from_json(result) if result else None + space_infos_ = [SpaceInfo.from_json(o) for o in space_infos or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if space_infos_ is not None and not isinstance(space_infos_, (bytes, str, list)): + raise Exception("Expected space_infos_ to be a Sequence, received: {}".format(type(space_infos_))) - if result_ is not None and not isinstance(result_, (dict, RemoteApplicationInfo)): - raise Exception("Expected result_ to be a RemoteApplicationInfo, received: {}".format(type(result_))) - - self.error = error_ - self.result = result_ + self.space_infos = space_infos_ self.unknown_fields = unknown_fields -class RemoteApplicationInfoResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class SpaceInfosParams(Type): + _toSchema = {'space_ids': 'space-ids'} + _toPy = {'space-ids': 'space_ids'} + def __init__(self, space_ids=None, **unknown_fields): ''' - results : typing.Sequence[~RemoteApplicationInfoResult] + space_ids : typing.Sequence[str] ''' - results_ = [RemoteApplicationInfoResult.from_json(o) for o in results or []] + space_ids_ = space_ids # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if space_ids_ is not None and not isinstance(space_ids_, (bytes, str, list)): + raise Exception("Expected space_ids_ to be a Sequence, received: {}".format(type(space_ids_))) - self.results = results_ + self.space_ids = space_ids_ self.unknown_fields = unknown_fields -class RemoteApplicationStatus(Type): - _toSchema = {'endpoints': 'endpoints', 'err': 'err', 'life': 'life', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'relations': 'relations', 'status': 'status'} - _toPy = {'endpoints': 'endpoints', 'err': 'err', 'life': 'life', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'relations': 'relations', 'status': 'status'} - def __init__(self, endpoints=None, err=None, life=None, offer_name=None, offer_url=None, relations=None, status=None, **unknown_fields): +class StateServingInfo(Type): + _toSchema = {'api_port': 'api-port', 'ca_private_key': 'ca-private-key', 'cert': 'cert', 'controller_api_port': 'controller-api-port', 'private_key': 'private-key', 'shared_secret': 'shared-secret', 'state_port': 'state-port', 'system_identity': 'system-identity'} + _toPy = {'api-port': 'api_port', 'ca-private-key': 'ca_private_key', 'cert': 'cert', 'controller-api-port': 'controller_api_port', 'private-key': 'private_key', 'shared-secret': 'shared_secret', 'state-port': 'state_port', 'system-identity': 'system_identity'} + def __init__(self, api_port=None, ca_private_key=None, cert=None, controller_api_port=None, private_key=None, shared_secret=None, state_port=None, system_identity=None, **unknown_fields): ''' - endpoints : typing.Sequence[~RemoteEndpoint] - err : Error - life : str - offer_name : str - offer_url : str - relations : typing.Mapping[str, typing.Sequence[str]] - status : DetailedStatus + api_port : int + ca_private_key : str + cert : str + controller_api_port : int + private_key : str + shared_secret : str + state_port : int + system_identity : str ''' - endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] - err_ = Error.from_json(err) if err else None - life_ = life - offer_name_ = offer_name - offer_url_ = offer_url - relations_ = relations - status_ = DetailedStatus.from_json(status) if status else None + api_port_ = api_port + ca_private_key_ = ca_private_key + cert_ = cert + controller_api_port_ = controller_api_port + private_key_ = private_key + shared_secret_ = shared_secret + state_port_ = state_port + system_identity_ = system_identity # Validate arguments against known Juju API types. - if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): - raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + if api_port_ is not None and not isinstance(api_port_, int): + raise Exception("Expected api_port_ to be a int, received: {}".format(type(api_port_))) - if err_ is not None and not isinstance(err_, (dict, Error)): - raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + if ca_private_key_ is not None and not isinstance(ca_private_key_, (bytes, str)): + raise Exception("Expected ca_private_key_ to be a str, received: {}".format(type(ca_private_key_))) - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if cert_ is not None and not isinstance(cert_, (bytes, str)): + raise Exception("Expected cert_ to be a str, received: {}".format(type(cert_))) - if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): - raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + if controller_api_port_ is not None and not isinstance(controller_api_port_, int): + raise Exception("Expected controller_api_port_ to be a int, received: {}".format(type(controller_api_port_))) - if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): - raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + if private_key_ is not None and not isinstance(private_key_, (bytes, str)): + raise Exception("Expected private_key_ to be a str, received: {}".format(type(private_key_))) - if relations_ is not None and not isinstance(relations_, dict): - raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) + if shared_secret_ is not None and not isinstance(shared_secret_, (bytes, str)): + raise Exception("Expected shared_secret_ to be a str, received: {}".format(type(shared_secret_))) - if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): - raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + if state_port_ is not None and not isinstance(state_port_, int): + raise Exception("Expected state_port_ to be a int, received: {}".format(type(state_port_))) - self.endpoints = endpoints_ - self.err = err_ - self.life = life_ - self.offer_name = offer_name_ - self.offer_url = offer_url_ - self.relations = relations_ - self.status = status_ + if system_identity_ is not None and not isinstance(system_identity_, (bytes, str)): + raise Exception("Expected system_identity_ to be a str, received: {}".format(type(system_identity_))) + + self.api_port = api_port_ + self.ca_private_key = ca_private_key_ + self.cert = cert_ + self.controller_api_port = controller_api_port_ + self.private_key = private_key_ + self.shared_secret = shared_secret_ + self.state_port = state_port_ + self.system_identity = system_identity_ self.unknown_fields = unknown_fields -class RemoteEndpoint(Type): - _toSchema = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'role': 'role'} - _toPy = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'role': 'role'} - def __init__(self, interface=None, limit=None, name=None, role=None, **unknown_fields): +class StatusHistoryFilter(Type): + _toSchema = {'date': 'date', 'delta': 'delta', 'exclude': 'exclude', 'size': 'size'} + _toPy = {'date': 'date', 'delta': 'delta', 'exclude': 'exclude', 'size': 'size'} + def __init__(self, date=None, delta=None, exclude=None, size=None, **unknown_fields): ''' - interface : str - limit : int - name : str - role : str + date : str + delta : int + exclude : typing.Sequence[str] + size : int ''' - interface_ = interface - limit_ = limit - name_ = name - role_ = role + date_ = date + delta_ = delta + exclude_ = exclude + size_ = size # Validate arguments against known Juju API types. - if interface_ is not None and not isinstance(interface_, (bytes, str)): - raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + if date_ is not None and not isinstance(date_, (bytes, str)): + raise Exception("Expected date_ to be a str, received: {}".format(type(date_))) - if limit_ is not None and not isinstance(limit_, int): - raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + if delta_ is not None and not isinstance(delta_, int): + raise Exception("Expected delta_ to be a int, received: {}".format(type(delta_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if exclude_ is not None and not isinstance(exclude_, (bytes, str, list)): + raise Exception("Expected exclude_ to be a Sequence, received: {}".format(type(exclude_))) - if role_ is not None and not isinstance(role_, (bytes, str)): - raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - self.interface = interface_ - self.limit = limit_ - self.name = name_ - self.role = role_ + self.date = date_ + self.delta = delta_ + self.exclude = exclude_ + self.size = size_ self.unknown_fields = unknown_fields -class RemoteSpace(Type): - _toSchema = {'cloud_type': 'cloud-type', 'name': 'name', 'provider_attributes': 'provider-attributes', 'provider_id': 'provider-id', 'subnets': 'subnets'} - _toPy = {'cloud-type': 'cloud_type', 'name': 'name', 'provider-attributes': 'provider_attributes', 'provider-id': 'provider_id', 'subnets': 'subnets'} - def __init__(self, cloud_type=None, name=None, provider_attributes=None, provider_id=None, subnets=None, **unknown_fields): +class StatusHistoryPruneArgs(Type): + _toSchema = {'max_history_mb': 'max-history-mb', 'max_history_time': 'max-history-time'} + _toPy = {'max-history-mb': 'max_history_mb', 'max-history-time': 'max_history_time'} + def __init__(self, max_history_mb=None, max_history_time=None, **unknown_fields): ''' - cloud_type : str - name : str - provider_attributes : typing.Mapping[str, typing.Any] - provider_id : str - subnets : typing.Sequence[~Subnet] + max_history_mb : int + max_history_time : int ''' - cloud_type_ = cloud_type - name_ = name - provider_attributes_ = provider_attributes - provider_id_ = provider_id - subnets_ = [Subnet.from_json(o) for o in subnets or []] + max_history_mb_ = max_history_mb + max_history_time_ = max_history_time # Validate arguments against known Juju API types. - if cloud_type_ is not None and not isinstance(cloud_type_, (bytes, str)): - raise Exception("Expected cloud_type_ to be a str, received: {}".format(type(cloud_type_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if provider_attributes_ is not None and not isinstance(provider_attributes_, dict): - raise Exception("Expected provider_attributes_ to be a Mapping, received: {}".format(type(provider_attributes_))) + if 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 provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - - if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): - raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + if max_history_time_ is not None and not isinstance(max_history_time_, int): + raise Exception("Expected max_history_time_ to be a int, received: {}".format(type(max_history_time_))) - self.cloud_type = cloud_type_ - self.name = name_ - self.provider_attributes = provider_attributes_ - self.provider_id = provider_id_ - self.subnets = subnets_ + self.max_history_mb = max_history_mb_ + self.max_history_time = max_history_time_ self.unknown_fields = unknown_fields -class RemoveBlocksArgs(Type): - _toSchema = {'all_': 'all'} - _toPy = {'all': 'all_'} - def __init__(self, all_=None, **unknown_fields): +class StatusHistoryRequest(Type): + _toSchema = {'filter_': 'filter', 'historykind': 'historyKind', 'size': 'size', 'tag': 'tag'} + _toPy = {'filter': 'filter_', 'historyKind': 'historykind', 'size': 'size', 'tag': 'tag'} + def __init__(self, filter_=None, historykind=None, size=None, tag=None, **unknown_fields): ''' - all_ : bool + filter_ : StatusHistoryFilter + historykind : str + size : int + tag : str ''' - all__ = all_ + filter__ = StatusHistoryFilter.from_json(filter_) if filter_ else None + historykind_ = historykind + size_ = size + tag_ = tag # Validate arguments against known Juju API types. - if all__ is not None and not isinstance(all__, bool): - raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + if filter__ is not None and not isinstance(filter__, (dict, StatusHistoryFilter)): + raise Exception("Expected filter__ to be a StatusHistoryFilter, received: {}".format(type(filter__))) - self.all_ = all__ + if historykind_ is not None and not isinstance(historykind_, (bytes, str)): + raise Exception("Expected historykind_ to be a str, received: {}".format(type(historykind_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.filter_ = filter__ + self.historykind = historykind_ + self.size = size_ + self.tag = tag_ self.unknown_fields = unknown_fields -class RemoveSecretBackendArg(Type): - _toSchema = {'force': 'force', 'name': 'name'} - _toPy = {'force': 'force', 'name': 'name'} - def __init__(self, force=None, name=None, **unknown_fields): +class StatusHistoryRequests(Type): + _toSchema = {'requests': 'requests'} + _toPy = {'requests': 'requests'} + def __init__(self, requests=None, **unknown_fields): ''' - force : bool - name : str + requests : typing.Sequence[~StatusHistoryRequest] ''' - force_ = force - name_ = name + requests_ = [StatusHistoryRequest.from_json(o) for o in requests or []] # Validate arguments against known Juju API types. - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if requests_ is not None and not isinstance(requests_, (bytes, str, list)): + raise Exception("Expected requests_ to be a Sequence, received: {}".format(type(requests_))) - self.force = force_ - self.name = name_ + self.requests = requests_ self.unknown_fields = unknown_fields -class RemoveSecretBackendArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class StatusHistoryResult(Type): + _toSchema = {'error': 'error', 'history': 'history'} + _toPy = {'error': 'error', 'history': 'history'} + def __init__(self, error=None, history=None, **unknown_fields): ''' - args : typing.Sequence[~RemoveSecretBackendArg] + error : Error + history : History ''' - args_ = [RemoveSecretBackendArg.from_json(o) for o in args or []] + error_ = Error.from_json(error) if error else None + history_ = History.from_json(history) if history else None # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.args = args_ + if history_ is not None and not isinstance(history_, (dict, History)): + raise Exception("Expected history_ to be a History, received: {}".format(type(history_))) + + self.error = error_ + self.history = history_ self.unknown_fields = unknown_fields -class RemoveSpaceParam(Type): - _toSchema = {'dry_run': 'dry-run', 'force': 'force', 'space': 'space'} - _toPy = {'dry-run': 'dry_run', 'force': 'force', 'space': 'space'} - def __init__(self, dry_run=None, force=None, space=None, **unknown_fields): +class StatusHistoryResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - dry_run : bool - force : bool - space : Entity + results : typing.Sequence[~StatusHistoryResult] ''' - dry_run_ = dry_run - force_ = force - space_ = Entity.from_json(space) if space else None + results_ = [StatusHistoryResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if dry_run_ is not None and not isinstance(dry_run_, bool): - raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) - - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - - if space_ is not None and not isinstance(space_, (dict, Entity)): - raise Exception("Expected space_ to be a Entity, received: {}".format(type(space_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.dry_run = dry_run_ - self.force = force_ - self.space = space_ + self.results = results_ self.unknown_fields = unknown_fields -class RemoveSpaceParams(Type): - _toSchema = {'space_param': 'space-param'} - _toPy = {'space-param': 'space_param'} - def __init__(self, space_param=None, **unknown_fields): +class StatusParams(Type): + _toSchema = {'include_storage': 'include-storage', 'patterns': 'patterns'} + _toPy = {'include-storage': 'include_storage', 'patterns': 'patterns'} + def __init__(self, include_storage=None, patterns=None, **unknown_fields): ''' - space_param : typing.Sequence[~RemoveSpaceParam] + include_storage : bool + patterns : typing.Sequence[str] ''' - space_param_ = [RemoveSpaceParam.from_json(o) for o in space_param or []] + include_storage_ = include_storage + patterns_ = patterns # Validate arguments against known Juju API types. - if space_param_ is not None and not isinstance(space_param_, (bytes, str, list)): - raise Exception("Expected space_param_ to be a Sequence, received: {}".format(type(space_param_))) + if include_storage_ is not None and not isinstance(include_storage_, bool): + raise Exception("Expected include_storage_ to be a bool, received: {}".format(type(include_storage_))) - self.space_param = space_param_ + if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): + raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + + self.include_storage = include_storage_ + self.patterns = patterns_ self.unknown_fields = unknown_fields -class RemoveSpaceResult(Type): - _toSchema = {'bindings': 'bindings', 'constraints': 'constraints', 'controller_settings': 'controller-settings', 'error': 'error'} - _toPy = {'bindings': 'bindings', 'constraints': 'constraints', 'controller-settings': 'controller_settings', 'error': 'error'} - def __init__(self, bindings=None, constraints=None, controller_settings=None, error=None, **unknown_fields): +class StatusResult(Type): + _toSchema = {'data': 'data', 'error': 'error', 'id_': 'id', 'info': 'info', 'life': 'life', 'since': 'since', 'status': 'status'} + _toPy = {'data': 'data', 'error': 'error', 'id': 'id_', 'info': 'info', 'life': 'life', 'since': 'since', 'status': 'status'} + def __init__(self, data=None, error=None, id_=None, info=None, life=None, since=None, status=None, **unknown_fields): ''' - bindings : typing.Sequence[~Entity] - constraints : typing.Sequence[~Entity] - controller_settings : typing.Sequence[str] + data : typing.Mapping[str, typing.Any] error : Error + id_ : str + info : str + life : str + since : str + status : str ''' - bindings_ = [Entity.from_json(o) for o in bindings or []] - constraints_ = [Entity.from_json(o) for o in constraints or []] - controller_settings_ = controller_settings + data_ = data error_ = Error.from_json(error) if error else None + id__ = id_ + info_ = info + life_ = life + since_ = since + status_ = status # Validate arguments against known Juju API types. - if bindings_ is not None and not isinstance(bindings_, (bytes, str, list)): - raise Exception("Expected bindings_ to be a Sequence, received: {}".format(type(bindings_))) - - if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): - raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) - - if controller_settings_ is not None and not isinstance(controller_settings_, (bytes, str, list)): - raise Exception("Expected controller_settings_ to be a Sequence, received: {}".format(type(controller_settings_))) + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.bindings = bindings_ - self.constraints = constraints_ - self.controller_settings = controller_settings_ + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.data = data_ self.error = error_ + self.id_ = id__ + self.info = info_ + self.life = life_ + self.since = since_ + self.status = status_ self.unknown_fields = unknown_fields -class RemoveSpaceResults(Type): +class StatusResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~RemoveSpaceResult] + results : typing.Sequence[~StatusResult] ''' - results_ = [RemoveSpaceResult.from_json(o) for o in results or []] + results_ = [StatusResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -12383,182 +23657,242 @@ def __init__(self, results=None, **unknown_fields): -class RemoveStorage(Type): - _toSchema = {'storage': 'storage'} - _toPy = {'storage': 'storage'} - def __init__(self, storage=None, **unknown_fields): +class StorageAddParams(Type): + _toSchema = {'name': 'name', 'storage': 'storage', 'unit': 'unit'} + _toPy = {'name': 'name', 'storage': 'storage', 'unit': 'unit'} + def __init__(self, name=None, storage=None, unit=None, **unknown_fields): ''' - storage : typing.Sequence[~RemoveStorageInstance] + name : str + storage : StorageConstraints + unit : str ''' - storage_ = [RemoveStorageInstance.from_json(o) for o in storage or []] + name_ = name + storage_ = StorageConstraints.from_json(storage) if storage else None + unit_ = unit # Validate arguments against known Juju API types. - if storage_ is not None and not isinstance(storage_, (bytes, str, list)): - raise Exception("Expected storage_ to be a Sequence, received: {}".format(type(storage_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if storage_ is not None and not isinstance(storage_, (dict, StorageConstraints)): + raise Exception("Expected storage_ to be a StorageConstraints, received: {}".format(type(storage_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + self.name = name_ self.storage = storage_ + self.unit = unit_ self.unknown_fields = unknown_fields -class RemoveStorageInstance(Type): - _toSchema = {'destroy_attachments': 'destroy-attachments', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'tag': 'tag'} - _toPy = {'destroy-attachments': 'destroy_attachments', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'tag': 'tag'} - def __init__(self, destroy_attachments=None, destroy_storage=None, force=None, max_wait=None, tag=None, **unknown_fields): +class StorageAttachment(Type): + _toSchema = {'kind': 'kind', 'life': 'life', 'location': 'location', 'owner_tag': 'owner-tag', 'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} + _toPy = {'kind': 'kind', 'life': 'life', 'location': 'location', 'owner-tag': 'owner_tag', 'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} + def __init__(self, kind=None, life=None, location=None, owner_tag=None, storage_tag=None, unit_tag=None, **unknown_fields): ''' - destroy_attachments : bool - destroy_storage : bool - force : bool - max_wait : int - tag : str + kind : int + life : str + location : str + owner_tag : str + storage_tag : str + unit_tag : str ''' - destroy_attachments_ = destroy_attachments - destroy_storage_ = destroy_storage - force_ = force - max_wait_ = max_wait - tag_ = tag + kind_ = kind + life_ = life + location_ = location + owner_tag_ = owner_tag + storage_tag_ = storage_tag + unit_tag_ = unit_tag # Validate arguments against known Juju API types. - if destroy_attachments_ is not None and not isinstance(destroy_attachments_, bool): - raise Exception("Expected destroy_attachments_ to be a bool, received: {}".format(type(destroy_attachments_))) + if kind_ is not None and not isinstance(kind_, int): + raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) - if destroy_storage_ is not None and not isinstance(destroy_storage_, bool): - raise Exception("Expected destroy_storage_ to be a bool, received: {}".format(type(destroy_storage_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.kind = kind_ + self.life = life_ + self.location = location_ + self.owner_tag = owner_tag_ + self.storage_tag = storage_tag_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class StorageAttachmentDetails(Type): + _toSchema = {'life': 'life', 'location': 'location', 'machine_tag': 'machine-tag', 'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} + _toPy = {'life': 'life', 'location': 'location', 'machine-tag': 'machine_tag', 'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} + def __init__(self, life=None, location=None, machine_tag=None, storage_tag=None, unit_tag=None, **unknown_fields): + ''' + life : str + location : str + machine_tag : str + storage_tag : str + unit_tag : str + ''' + life_ = life + location_ = location + machine_tag_ = machine_tag + storage_tag_ = storage_tag + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.life = life_ + self.location = location_ + self.machine_tag = machine_tag_ + self.storage_tag = storage_tag_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class StorageAttachmentId(Type): + _toSchema = {'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} + _toPy = {'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} + def __init__(self, storage_tag=None, unit_tag=None, **unknown_fields): + ''' + storage_tag : str + unit_tag : str + ''' + storage_tag_ = storage_tag + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) - self.destroy_attachments = destroy_attachments_ - self.destroy_storage = destroy_storage_ - self.force = force_ - self.max_wait = max_wait_ - self.tag = tag_ + self.storage_tag = storage_tag_ + self.unit_tag = unit_tag_ self.unknown_fields = unknown_fields -class RenameSpaceParams(Type): - _toSchema = {'from_space_tag': 'from-space-tag', 'to_space_tag': 'to-space-tag'} - _toPy = {'from-space-tag': 'from_space_tag', 'to-space-tag': 'to_space_tag'} - def __init__(self, from_space_tag=None, to_space_tag=None, **unknown_fields): +class StorageAttachmentIds(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): ''' - from_space_tag : str - to_space_tag : str + ids : typing.Sequence[~StorageAttachmentId] ''' - from_space_tag_ = from_space_tag - to_space_tag_ = to_space_tag + ids_ = [StorageAttachmentId.from_json(o) for o in ids or []] # Validate arguments against known Juju API types. - if from_space_tag_ is not None and not isinstance(from_space_tag_, (bytes, str)): - raise Exception("Expected from_space_tag_ to be a str, received: {}".format(type(from_space_tag_))) - - if to_space_tag_ is not None and not isinstance(to_space_tag_, (bytes, str)): - raise Exception("Expected to_space_tag_ to be a str, received: {}".format(type(to_space_tag_))) + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) - self.from_space_tag = from_space_tag_ - self.to_space_tag = to_space_tag_ + self.ids = ids_ self.unknown_fields = unknown_fields -class RenameSpacesParams(Type): - _toSchema = {'changes': 'changes'} - _toPy = {'changes': 'changes'} - def __init__(self, changes=None, **unknown_fields): +class StorageAttachmentIdsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - changes : typing.Sequence[~RenameSpaceParams] + error : Error + result : StorageAttachmentIds ''' - changes_ = [RenameSpaceParams.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + result_ = StorageAttachmentIds.from_json(result) if result else None # Validate arguments against known Juju API types. - if changes_ is not None and not isinstance(changes_, (bytes, str, list)): - raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.changes = changes_ + if result_ is not None and not isinstance(result_, (dict, StorageAttachmentIds)): + raise Exception("Expected result_ to be a StorageAttachmentIds, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class ResolveCharmWithChannel(Type): - _toSchema = {'charm_origin': 'charm-origin', 'reference': 'reference', 'switch_charm': 'switch-charm'} - _toPy = {'charm-origin': 'charm_origin', 'reference': 'reference', 'switch-charm': 'switch_charm'} - def __init__(self, charm_origin=None, reference=None, switch_charm=None, **unknown_fields): +class StorageAttachmentIdsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - charm_origin : CharmOrigin - reference : str - switch_charm : bool + results : typing.Sequence[~StorageAttachmentIdsResult] ''' - charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None - reference_ = reference - switch_charm_ = switch_charm + results_ = [StorageAttachmentIdsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): - raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) - - if reference_ is not None and not isinstance(reference_, (bytes, str)): - raise Exception("Expected reference_ to be a str, received: {}".format(type(reference_))) - - if switch_charm_ is not None and not isinstance(switch_charm_, bool): - raise Exception("Expected switch_charm_ to be a bool, received: {}".format(type(switch_charm_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.charm_origin = charm_origin_ - self.reference = reference_ - self.switch_charm = switch_charm_ + self.results = results_ self.unknown_fields = unknown_fields -class ResolveCharmWithChannelResult(Type): - _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'supported_bases': 'supported-bases', 'url': 'url'} - _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'supported-bases': 'supported_bases', 'url': 'url'} - def __init__(self, charm_origin=None, error=None, supported_bases=None, url=None, **unknown_fields): +class StorageAttachmentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - charm_origin : CharmOrigin error : Error - supported_bases : typing.Sequence[~Base] - url : str + result : StorageAttachment ''' - charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None error_ = Error.from_json(error) if error else None - supported_bases_ = [Base.from_json(o) for o in supported_bases or []] - url_ = url + result_ = StorageAttachment.from_json(result) if result else None # Validate arguments against known Juju API types. - if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)): - raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if supported_bases_ is not None and not isinstance(supported_bases_, (bytes, str, list)): - raise Exception("Expected supported_bases_ to be a Sequence, received: {}".format(type(supported_bases_))) - - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + if result_ is not None and not isinstance(result_, (dict, StorageAttachment)): + raise Exception("Expected result_ to be a StorageAttachment, received: {}".format(type(result_))) - self.charm_origin = charm_origin_ self.error = error_ - self.supported_bases = supported_bases_ - self.url = url_ + self.result = result_ self.unknown_fields = unknown_fields -class ResolveCharmWithChannelResults(Type): - _toSchema = {'results': 'Results'} - _toPy = {'Results': 'results'} +class StorageAttachmentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ResolveCharmWithChannelResult] + results : typing.Sequence[~StorageAttachmentResult] ''' - results_ = [ResolveCharmWithChannelResult.from_json(o) for o in results or []] + results_ = [StorageAttachmentResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -12569,176 +23903,194 @@ def __init__(self, results=None, **unknown_fields): -class ResolveCharmsWithChannel(Type): - _toSchema = {'macaroon': 'macaroon', 'resolve': 'resolve'} - _toPy = {'macaroon': 'macaroon', 'resolve': 'resolve'} - def __init__(self, macaroon=None, resolve=None, **unknown_fields): +class StorageConstraints(Type): + _toSchema = {'count': 'count', 'pool': 'pool', 'size': 'size'} + _toPy = {'count': 'count', 'pool': 'pool', 'size': 'size'} + def __init__(self, count=None, pool=None, size=None, **unknown_fields): ''' - macaroon : Macaroon - resolve : typing.Sequence[~ResolveCharmWithChannel] + count : int + pool : str + size : int ''' - macaroon_ = Macaroon.from_json(macaroon) if macaroon else None - resolve_ = [ResolveCharmWithChannel.from_json(o) for o in resolve or []] + count_ = count + pool_ = pool + size_ = size # Validate arguments against known Juju API types. - if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): - raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) - if resolve_ is not None and not isinstance(resolve_, (bytes, str, list)): - raise Exception("Expected resolve_ to be a Sequence, received: {}".format(type(resolve_))) + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) - self.macaroon = macaroon_ - self.resolve = resolve_ + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + self.count = count_ + self.pool = pool_ + self.size = size_ self.unknown_fields = unknown_fields -class Resource(Type): - _toSchema = {'application': 'application', 'charmresource': 'CharmResource', 'description': 'description', 'fingerprint': 'fingerprint', 'id_': 'id', 'name': 'name', 'origin': 'origin', 'path': 'path', 'pending_id': 'pending-id', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type_': 'type', 'username': 'username'} - _toPy = {'CharmResource': 'charmresource', 'application': 'application', 'description': 'description', 'fingerprint': 'fingerprint', 'id': 'id_', 'name': 'name', 'origin': 'origin', 'path': 'path', 'pending-id': 'pending_id', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type': 'type_', 'username': 'username'} - def __init__(self, charmresource=None, application=None, description=None, fingerprint=None, id_=None, name=None, origin=None, path=None, pending_id=None, revision=None, size=None, timestamp=None, type_=None, username=None, **unknown_fields): +class StorageDetachmentParams(Type): + _toSchema = {'force': 'force', 'ids': 'ids', 'max_wait': 'max-wait'} + _toPy = {'force': 'force', 'ids': 'ids', 'max-wait': 'max_wait'} + def __init__(self, force=None, ids=None, max_wait=None, **unknown_fields): ''' - charmresource : CharmResource - application : str - description : str - fingerprint : typing.Sequence[int] - id_ : str - name : str - origin : str - path : str - pending_id : str - revision : int - size : int - timestamp : str - type_ : str - username : str + force : bool + ids : StorageAttachmentIds + max_wait : int ''' - charmresource_ = CharmResource.from_json(charmresource) if charmresource else None - application_ = application - description_ = description - fingerprint_ = fingerprint - id__ = id_ - name_ = name - origin_ = origin - path_ = path - pending_id_ = pending_id - revision_ = revision - size_ = size - timestamp_ = timestamp - type__ = type_ - username_ = username + force_ = force + ids_ = StorageAttachmentIds.from_json(ids) if ids else None + max_wait_ = max_wait # Validate arguments against known Juju API types. - if charmresource_ is not None and not isinstance(charmresource_, (dict, CharmResource)): - raise Exception("Expected charmresource_ to be a CharmResource, received: {}".format(type(charmresource_))) + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - if application_ is not None and not isinstance(application_, (bytes, str)): - raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + if ids_ is not None and not isinstance(ids_, (dict, StorageAttachmentIds)): + raise Exception("Expected ids_ to be a StorageAttachmentIds, received: {}".format(type(ids_))) - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if max_wait_ is not None and not isinstance(max_wait_, int): + raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) - if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): - raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) + self.force = force_ + self.ids = ids_ + self.max_wait = max_wait_ + self.unknown_fields = unknown_fields + + + +class StorageDetails(Type): + _toSchema = {'attachments': 'attachments', 'kind': 'kind', 'life': 'life', 'owner_tag': 'owner-tag', 'persistent': 'persistent', 'status': 'status', 'storage_tag': 'storage-tag'} + _toPy = {'attachments': 'attachments', 'kind': 'kind', 'life': 'life', 'owner-tag': 'owner_tag', 'persistent': 'persistent', 'status': 'status', 'storage-tag': 'storage_tag'} + def __init__(self, attachments=None, kind=None, life=None, owner_tag=None, persistent=None, status=None, storage_tag=None, **unknown_fields): + ''' + attachments : typing.Mapping[str, ~StorageAttachmentDetails] + kind : int + life : str + owner_tag : str + persistent : bool + status : EntityStatus + storage_tag : str + ''' + attachments_ = {k: StorageAttachmentDetails.from_json(v) for k, v in (attachments or dict()).items()} + kind_ = kind + life_ = life + owner_tag_ = owner_tag + persistent_ = persistent + status_ = EntityStatus.from_json(status) if status else None + storage_tag_ = storage_tag + + # Validate arguments against known Juju API types. + if attachments_ is not None and not isinstance(attachments_, dict): + raise Exception("Expected attachments_ to be a Mapping, received: {}".format(type(attachments_))) + + if kind_ is not None and not isinstance(kind_, int): + raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if owner_tag_ is not None and not isinstance(owner_tag_, (bytes, str)): + raise Exception("Expected owner_tag_ to be a str, received: {}".format(type(owner_tag_))) + + if persistent_ is not None and not isinstance(persistent_, bool): + raise Exception("Expected persistent_ to be a bool, received: {}".format(type(persistent_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + self.attachments = attachments_ + self.kind = kind_ + self.life = life_ + self.owner_tag = owner_tag_ + self.persistent = persistent_ + self.status = status_ + self.storage_tag = storage_tag_ + self.unknown_fields = unknown_fields - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if origin_ is not None and not isinstance(origin_, (bytes, str)): - raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) +class StorageDetailsListResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Sequence[~StorageDetails] + ''' + error_ = Error.from_json(error) if error else None + result_ = [StorageDetails.from_json(o) for o in result or []] - if path_ is not None and not isinstance(path_, (bytes, str)): - raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if pending_id_ is not None and not isinstance(pending_id_, (bytes, str)): - raise Exception("Expected pending_id_ to be a str, received: {}".format(type(pending_id_))) + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - if timestamp_ is not None and not isinstance(timestamp_, (bytes, str)): - raise Exception("Expected timestamp_ to be a str, received: {}".format(type(timestamp_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) +class StorageDetailsListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StorageDetailsListResult] + ''' + results_ = [StorageDetailsListResult.from_json(o) for o in results or []] - if username_ is not None and not isinstance(username_, (bytes, str)): - raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.charmresource = charmresource_ - self.application = application_ - self.description = description_ - self.fingerprint = fingerprint_ - self.id_ = id__ - self.name = name_ - self.origin = origin_ - self.path = path_ - self.pending_id = pending_id_ - self.revision = revision_ - self.size = size_ - self.timestamp = timestamp_ - self.type_ = type__ - self.username = username_ + self.results = results_ self.unknown_fields = unknown_fields -class ResourcesResult(Type): - _toSchema = {'charm_store_resources': 'charm-store-resources', 'error': 'error', 'errorresult': 'ErrorResult', 'resources': 'resources', 'unit_resources': 'unit-resources'} - _toPy = {'ErrorResult': 'errorresult', 'charm-store-resources': 'charm_store_resources', 'error': 'error', 'resources': 'resources', 'unit-resources': 'unit_resources'} - def __init__(self, errorresult=None, charm_store_resources=None, error=None, resources=None, unit_resources=None, **unknown_fields): +class StorageDetailsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - errorresult : ErrorResult - charm_store_resources : typing.Sequence[~CharmResource] error : Error - resources : typing.Sequence[~Resource] - unit_resources : typing.Sequence[~UnitResources] + result : StorageDetails ''' - errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None - charm_store_resources_ = [CharmResource.from_json(o) for o in charm_store_resources or []] error_ = Error.from_json(error) if error else None - resources_ = [Resource.from_json(o) for o in resources or []] - unit_resources_ = [UnitResources.from_json(o) for o in unit_resources or []] + result_ = StorageDetails.from_json(result) if result else None # Validate arguments against known Juju API types. - if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): - raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) - - if charm_store_resources_ is not None and not isinstance(charm_store_resources_, (bytes, str, list)): - raise Exception("Expected charm_store_resources_ to be a Sequence, received: {}".format(type(charm_store_resources_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if resources_ is not None and not isinstance(resources_, (bytes, str, list)): - raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) - - if unit_resources_ is not None and not isinstance(unit_resources_, (bytes, str, list)): - raise Exception("Expected unit_resources_ to be a Sequence, received: {}".format(type(unit_resources_))) + if result_ is not None and not isinstance(result_, (dict, StorageDetails)): + raise Exception("Expected result_ to be a StorageDetails, received: {}".format(type(result_))) - self.errorresult = errorresult_ - self.charm_store_resources = charm_store_resources_ self.error = error_ - self.resources = resources_ - self.unit_resources = unit_resources_ + self.result = result_ self.unknown_fields = unknown_fields -class ResourcesResults(Type): +class StorageDetailsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ResourcesResult] + results : typing.Sequence[~StorageDetailsResult] ''' - results_ = [ResourcesResult.from_json(o) for o in results or []] + results_ = [StorageDetailsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -12749,206 +24101,193 @@ def __init__(self, results=None, **unknown_fields): -class RetryProvisioningArgs(Type): - _toSchema = {'all_': 'all', 'machines': 'machines'} - _toPy = {'all': 'all_', 'machines': 'machines'} - def __init__(self, all_=None, machines=None, **unknown_fields): +class StorageFilter(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): ''' - all_ : bool - machines : typing.Sequence[str] + ''' - all__ = all_ - machines_ = machines + self.unknown_fields = unknown_fields - # Validate arguments against known Juju API types. - if all__ is not None and not isinstance(all__, bool): - raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) - if machines_ is not None and not isinstance(machines_, (bytes, str, list)): - raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) - self.all_ = all__ - self.machines = machines_ +class StorageFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~StorageFilter] + ''' + filters_ = [StorageFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ self.unknown_fields = unknown_fields -class RevokeCredentialArg(Type): - _toSchema = {'force': 'force', 'tag': 'tag'} - _toPy = {'force': 'force', 'tag': 'tag'} - def __init__(self, force=None, tag=None, **unknown_fields): +class StoragePool(Type): + _toSchema = {'attrs': 'attrs', 'name': 'name', 'provider': 'provider'} + _toPy = {'attrs': 'attrs', 'name': 'name', 'provider': 'provider'} + def __init__(self, attrs=None, name=None, provider=None, **unknown_fields): ''' - force : bool - tag : str + attrs : typing.Mapping[str, typing.Any] + name : str + provider : str ''' - force_ = force - tag_ = tag + attrs_ = attrs + name_ = name + provider_ = provider # Validate arguments against known Juju API types. - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if attrs_ is not None and not isinstance(attrs_, dict): + raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - self.force = force_ - self.tag = tag_ + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + self.attrs = attrs_ + self.name = name_ + self.provider = provider_ self.unknown_fields = unknown_fields -class RevokeCredentialArgs(Type): - _toSchema = {'credentials': 'credentials'} - _toPy = {'credentials': 'credentials'} - def __init__(self, credentials=None, **unknown_fields): +class StoragePoolArgs(Type): + _toSchema = {'pools': 'pools'} + _toPy = {'pools': 'pools'} + def __init__(self, pools=None, **unknown_fields): ''' - credentials : typing.Sequence[~RevokeCredentialArg] + pools : typing.Sequence[~StoragePool] ''' - credentials_ = [RevokeCredentialArg.from_json(o) for o in credentials or []] + pools_ = [StoragePool.from_json(o) for o in pools or []] # Validate arguments against known Juju API types. - if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): - raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + if pools_ is not None and not isinstance(pools_, (bytes, str, list)): + raise Exception("Expected pools_ to be a Sequence, received: {}".format(type(pools_))) - self.credentials = credentials_ + self.pools = pools_ self.unknown_fields = unknown_fields -class RunParams(Type): - _toSchema = {'applications': 'applications', 'commands': 'commands', 'execution_group': 'execution-group', 'machines': 'machines', 'parallel': 'parallel', 'timeout': 'timeout', 'units': 'units', 'workload_context': 'workload-context'} - _toPy = {'applications': 'applications', 'commands': 'commands', 'execution-group': 'execution_group', 'machines': 'machines', 'parallel': 'parallel', 'timeout': 'timeout', 'units': 'units', 'workload-context': 'workload_context'} - def __init__(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None, **unknown_fields): +class StoragePoolDeleteArg(Type): + _toSchema = {'name': 'name'} + _toPy = {'name': 'name'} + def __init__(self, name=None, **unknown_fields): ''' - applications : typing.Sequence[str] - commands : str - execution_group : str - machines : typing.Sequence[str] - parallel : bool - timeout : int - units : typing.Sequence[str] - workload_context : bool + name : str ''' - applications_ = applications - commands_ = commands - execution_group_ = execution_group - machines_ = machines - parallel_ = parallel - timeout_ = timeout - units_ = units - workload_context_ = workload_context + name_ = name # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - - if commands_ is not None and not isinstance(commands_, (bytes, str)): - raise Exception("Expected commands_ to be a str, received: {}".format(type(commands_))) - - if execution_group_ is not None and not isinstance(execution_group_, (bytes, str)): - raise Exception("Expected execution_group_ to be a str, received: {}".format(type(execution_group_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if machines_ is not None and not isinstance(machines_, (bytes, str, list)): - raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + self.name = name_ + self.unknown_fields = unknown_fields - if parallel_ is not None and not isinstance(parallel_, bool): - raise Exception("Expected parallel_ to be a bool, received: {}".format(type(parallel_))) - if timeout_ is not None and not isinstance(timeout_, int): - raise Exception("Expected timeout_ to be a int, received: {}".format(type(timeout_))) - if units_ is not None and not isinstance(units_, (bytes, str, list)): - raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) +class StoragePoolDeleteArgs(Type): + _toSchema = {'pools': 'pools'} + _toPy = {'pools': 'pools'} + def __init__(self, pools=None, **unknown_fields): + ''' + pools : typing.Sequence[~StoragePoolDeleteArg] + ''' + pools_ = [StoragePoolDeleteArg.from_json(o) for o in pools or []] - if workload_context_ is not None and not isinstance(workload_context_, bool): - raise Exception("Expected workload_context_ to be a bool, received: {}".format(type(workload_context_))) + # Validate arguments against known Juju API types. + if pools_ is not None and not isinstance(pools_, (bytes, str, list)): + raise Exception("Expected pools_ to be a Sequence, received: {}".format(type(pools_))) - self.applications = applications_ - self.commands = commands_ - self.execution_group = execution_group_ - self.machines = machines_ - self.parallel = parallel_ - self.timeout = timeout_ - self.units = units_ - self.workload_context = workload_context_ + self.pools = pools_ self.unknown_fields = unknown_fields -class SSHAddressResult(Type): - _toSchema = {'address': 'address', 'error': 'error'} - _toPy = {'address': 'address', 'error': 'error'} - def __init__(self, address=None, error=None, **unknown_fields): +class StoragePoolFilter(Type): + _toSchema = {'names': 'names', 'providers': 'providers'} + _toPy = {'names': 'names', 'providers': 'providers'} + def __init__(self, names=None, providers=None, **unknown_fields): ''' - address : str - error : Error + names : typing.Sequence[str] + providers : typing.Sequence[str] ''' - address_ = address - error_ = Error.from_json(error) if error else None + names_ = names + providers_ = providers # Validate arguments against known Juju API types. - if address_ is not None and not isinstance(address_, (bytes, str)): - raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + if names_ is not None and not isinstance(names_, (bytes, str, list)): + raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if providers_ is not None and not isinstance(providers_, (bytes, str, list)): + raise Exception("Expected providers_ to be a Sequence, received: {}".format(type(providers_))) - self.address = address_ - self.error = error_ + self.names = names_ + self.providers = providers_ self.unknown_fields = unknown_fields -class SSHAddressResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class StoragePoolFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' - results : typing.Sequence[~SSHAddressResult] + filters : typing.Sequence[~StoragePoolFilter] ''' - results_ = [SSHAddressResult.from_json(o) for o in results or []] + filters_ = [StoragePoolFilter.from_json(o) for o in filters or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) - self.results = results_ + self.filters = filters_ self.unknown_fields = unknown_fields -class SSHAddressesResult(Type): - _toSchema = {'addresses': 'addresses', 'error': 'error'} - _toPy = {'addresses': 'addresses', 'error': 'error'} - def __init__(self, addresses=None, error=None, **unknown_fields): +class StoragePoolsResult(Type): + _toSchema = {'error': 'error', 'storage_pools': 'storage-pools'} + _toPy = {'error': 'error', 'storage-pools': 'storage_pools'} + def __init__(self, error=None, storage_pools=None, **unknown_fields): ''' - addresses : typing.Sequence[str] error : Error + storage_pools : typing.Sequence[~StoragePool] ''' - addresses_ = addresses error_ = Error.from_json(error) if error else None + storage_pools_ = [StoragePool.from_json(o) for o in storage_pools or []] # Validate arguments against known Juju API types. - if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): - raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.addresses = addresses_ + if storage_pools_ is not None and not isinstance(storage_pools_, (bytes, str, list)): + raise Exception("Expected storage_pools_ to be a Sequence, received: {}".format(type(storage_pools_))) + self.error = error_ + self.storage_pools = storage_pools_ self.unknown_fields = unknown_fields -class SSHAddressesResults(Type): +class StoragePoolsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~SSHAddressesResult] + results : typing.Sequence[~StoragePoolsResult] ''' - results_ = [SSHAddressesResult.from_json(o) for o in results or []] + results_ = [StoragePoolsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -12959,56 +24298,62 @@ def __init__(self, results=None, **unknown_fields): -class SSHProxyResult(Type): - _toSchema = {'use_proxy': 'use-proxy'} - _toPy = {'use-proxy': 'use_proxy'} - def __init__(self, use_proxy=None, **unknown_fields): +class StoragesAddParams(Type): + _toSchema = {'storages': 'storages'} + _toPy = {'storages': 'storages'} + def __init__(self, storages=None, **unknown_fields): ''' - use_proxy : bool + storages : typing.Sequence[~StorageAddParams] ''' - use_proxy_ = use_proxy + storages_ = [StorageAddParams.from_json(o) for o in storages or []] # Validate arguments against known Juju API types. - if use_proxy_ is not None and not isinstance(use_proxy_, bool): - raise Exception("Expected use_proxy_ to be a bool, received: {}".format(type(use_proxy_))) + if storages_ is not None and not isinstance(storages_, (bytes, str, list)): + raise Exception("Expected storages_ to be a Sequence, received: {}".format(type(storages_))) - self.use_proxy = use_proxy_ + self.storages = storages_ self.unknown_fields = unknown_fields -class SSHPublicKeysResult(Type): - _toSchema = {'error': 'error', 'public_keys': 'public-keys'} - _toPy = {'error': 'error', 'public-keys': 'public_keys'} - def __init__(self, error=None, public_keys=None, **unknown_fields): +class StringBoolResult(Type): + _toSchema = {'error': 'error', 'ok': 'ok', 'result': 'result'} + _toPy = {'error': 'error', 'ok': 'ok', 'result': 'result'} + def __init__(self, error=None, ok=None, result=None, **unknown_fields): ''' error : Error - public_keys : typing.Sequence[str] + ok : bool + result : str ''' error_ = Error.from_json(error) if error else None - public_keys_ = public_keys + ok_ = ok + result_ = result # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if public_keys_ is not None and not isinstance(public_keys_, (bytes, str, list)): - raise Exception("Expected public_keys_ to be a Sequence, received: {}".format(type(public_keys_))) + if ok_ is not None and not isinstance(ok_, bool): + raise Exception("Expected ok_ to be a bool, received: {}".format(type(ok_))) + + if result_ is not None and not isinstance(result_, (bytes, str)): + raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) self.error = error_ - self.public_keys = public_keys_ + self.ok = ok_ + self.result = result_ self.unknown_fields = unknown_fields -class SSHPublicKeysResults(Type): +class StringBoolResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~SSHPublicKeysResult] + results : typing.Sequence[~StringBoolResult] ''' - results_ = [SSHPublicKeysResult.from_json(o) for o in results or []] + results_ = [StringBoolResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -13019,92 +24364,38 @@ def __init__(self, results=None, **unknown_fields): -class ScaleApplicationInfo(Type): - _toSchema = {'num_units': 'num-units'} - _toPy = {'num-units': 'num_units'} - def __init__(self, num_units=None, **unknown_fields): - ''' - num_units : int - ''' - num_units_ = num_units - - # Validate arguments against known Juju API types. - if num_units_ is not None and not isinstance(num_units_, int): - raise Exception("Expected num_units_ to be a int, received: {}".format(type(num_units_))) - - self.num_units = num_units_ - self.unknown_fields = unknown_fields - - - -class ScaleApplicationParams(Type): - _toSchema = {'application_tag': 'application-tag', 'force': 'force', 'scale': 'scale', 'scale_change': 'scale-change'} - _toPy = {'application-tag': 'application_tag', 'force': 'force', 'scale': 'scale', 'scale-change': 'scale_change'} - def __init__(self, application_tag=None, force=None, scale=None, scale_change=None, **unknown_fields): - ''' - application_tag : str - force : bool - scale : int - scale_change : int - ''' - application_tag_ = application_tag - force_ = force - scale_ = scale - scale_change_ = scale_change - - # Validate arguments against known Juju API types. - if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): - raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - - if scale_ is not None and not isinstance(scale_, int): - raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) - - if scale_change_ is not None and not isinstance(scale_change_, int): - raise Exception("Expected scale_change_ to be a int, received: {}".format(type(scale_change_))) - - self.application_tag = application_tag_ - self.force = force_ - self.scale = scale_ - self.scale_change = scale_change_ - self.unknown_fields = unknown_fields - - - -class ScaleApplicationResult(Type): - _toSchema = {'error': 'error', 'info': 'info'} - _toPy = {'error': 'error', 'info': 'info'} - def __init__(self, error=None, info=None, **unknown_fields): +class StringResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - info : ScaleApplicationInfo + result : str ''' error_ = Error.from_json(error) if error else None - info_ = ScaleApplicationInfo.from_json(info) if info else None + result_ = result # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if info_ is not None and not isinstance(info_, (dict, ScaleApplicationInfo)): - raise Exception("Expected info_ to be a ScaleApplicationInfo, received: {}".format(type(info_))) + if result_ is not None and not isinstance(result_, (bytes, str)): + raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) self.error = error_ - self.info = info_ + self.result = result_ self.unknown_fields = unknown_fields -class ScaleApplicationResults(Type): +class StringResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ScaleApplicationResult] + results : typing.Sequence[~StringResult] ''' - results_ = [ScaleApplicationResult.from_json(o) for o in results or []] + results_ = [StringResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -13115,350 +24406,398 @@ def __init__(self, results=None, **unknown_fields): -class ScaleApplicationsParams(Type): - _toSchema = {'applications': 'applications'} - _toPy = {'applications': 'applications'} - def __init__(self, applications=None, **unknown_fields): +class StringsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - applications : typing.Sequence[~ScaleApplicationParams] + error : Error + result : typing.Sequence[str] ''' - applications_ = [ScaleApplicationParams.from_json(o) for o in applications or []] + error_ = Error.from_json(error) if error else None + result_ = result # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.applications = applications_ + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class SecretBackend(Type): - _toSchema = {'backend_type': 'backend-type', 'config': 'config', 'name': 'name', 'token_rotate_interval': 'token-rotate-interval'} - _toPy = {'backend-type': 'backend_type', 'config': 'config', 'name': 'name', 'token-rotate-interval': 'token_rotate_interval'} - def __init__(self, backend_type=None, config=None, name=None, token_rotate_interval=None, **unknown_fields): +class StringsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - backend_type : str - config : typing.Mapping[str, typing.Any] - name : str - token_rotate_interval : int + results : typing.Sequence[~StringsResult] ''' - backend_type_ = backend_type - config_ = config - name_ = name - token_rotate_interval_ = token_rotate_interval + results_ = [StringsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if backend_type_ is not None and not isinstance(backend_type_, (bytes, str)): - raise Exception("Expected backend_type_ to be a str, received: {}".format(type(backend_type_))) - - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if token_rotate_interval_ is not None and not isinstance(token_rotate_interval_, int): - raise Exception("Expected token_rotate_interval_ to be a int, received: {}".format(type(token_rotate_interval_))) - - self.backend_type = backend_type_ - self.config = config_ - self.name = name_ - self.token_rotate_interval = token_rotate_interval_ + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ self.unknown_fields = unknown_fields -class SecretBackendResult(Type): - _toSchema = {'error': 'error', 'id_': 'id', 'message': 'message', 'num_secrets': 'num-secrets', 'result': 'result', 'status': 'status'} - _toPy = {'error': 'error', 'id': 'id_', 'message': 'message', 'num-secrets': 'num_secrets', 'result': 'result', 'status': 'status'} - def __init__(self, error=None, id_=None, message=None, num_secrets=None, result=None, status=None, **unknown_fields): +class StringsWatchResult(Type): + _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} + _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' + changes : typing.Sequence[str] error : Error - id_ : str - message : str - num_secrets : int - result : SecretBackend - status : str + watcher_id : str ''' + changes_ = changes error_ = Error.from_json(error) if error else None - id__ = id_ - message_ = message - num_secrets_ = num_secrets - result_ = SecretBackend.from_json(result) if result else None - status_ = status + watcher_id_ = watcher_id # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) - - if message_ is not None and not isinstance(message_, (bytes, str)): - raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - - if num_secrets_ is not None and not isinstance(num_secrets_, int): - raise Exception("Expected num_secrets_ to be a int, received: {}".format(type(num_secrets_))) - - if result_ is not None and not isinstance(result_, (dict, SecretBackend)): - raise Exception("Expected result_ to be a SecretBackend, received: {}".format(type(result_))) - - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + self.changes = changes_ self.error = error_ - self.id_ = id__ - self.message = message_ - self.num_secrets = num_secrets_ - self.result = result_ - self.status = status_ + self.watcher_id = watcher_id_ self.unknown_fields = unknown_fields -class SecretContentParams(Type): - _toSchema = {'data': 'data', 'value_ref': 'value-ref'} - _toPy = {'data': 'data', 'value-ref': 'value_ref'} - def __init__(self, data=None, value_ref=None, **unknown_fields): +class StringsWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - data : typing.Mapping[str, str] - value_ref : SecretValueRef + results : typing.Sequence[~StringsWatchResult] ''' - data_ = data - value_ref_ = SecretValueRef.from_json(value_ref) if value_ref else None + results_ = [StringsWatchResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if data_ is not None and not isinstance(data_, dict): - raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) - - if value_ref_ is not None and not isinstance(value_ref_, (dict, SecretValueRef)): - raise Exception("Expected value_ref_ to be a SecretValueRef, received: {}".format(type(value_ref_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.data = data_ - self.value_ref = value_ref_ + self.results = results_ self.unknown_fields = unknown_fields -class SecretRevision(Type): - _toSchema = {'backend_name': 'backend-name', 'create_time': 'create-time', 'expire_time': 'expire-time', 'revision': 'revision', 'update_time': 'update-time', 'value_ref': 'value-ref'} - _toPy = {'backend-name': 'backend_name', 'create-time': 'create_time', 'expire-time': 'expire_time', 'revision': 'revision', 'update-time': 'update_time', 'value-ref': 'value_ref'} - def __init__(self, backend_name=None, create_time=None, expire_time=None, revision=None, update_time=None, value_ref=None, **unknown_fields): +class Subnet(Type): + _toSchema = {'cidr': 'cidr', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_tag': 'space-tag', 'status': 'status', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} + _toPy = {'cidr': 'cidr', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, cidr=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): ''' - backend_name : str - create_time : str - expire_time : str - revision : int - update_time : str - value_ref : SecretValueRef + cidr : str + life : str + provider_id : str + provider_network_id : str + provider_space_id : str + space_tag : str + status : str + vlan_tag : int + zones : typing.Sequence[str] ''' - backend_name_ = backend_name - create_time_ = create_time - expire_time_ = expire_time - revision_ = revision - update_time_ = update_time - value_ref_ = SecretValueRef.from_json(value_ref) if value_ref else None + cidr_ = cidr + life_ = life + provider_id_ = provider_id + provider_network_id_ = provider_network_id + provider_space_id_ = provider_space_id + space_tag_ = space_tag + status_ = status + vlan_tag_ = vlan_tag + zones_ = zones # Validate arguments against known Juju API types. - if backend_name_ is not None and not isinstance(backend_name_, (bytes, str)): - raise Exception("Expected backend_name_ to be a str, received: {}".format(type(backend_name_))) + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) - if create_time_ is not None and not isinstance(create_time_, (bytes, str)): - raise Exception("Expected create_time_ to be a str, received: {}".format(type(create_time_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): - raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) - if update_time_ is not None and not isinstance(update_time_, (bytes, str)): - raise Exception("Expected update_time_ to be a str, received: {}".format(type(update_time_))) + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) - if value_ref_ is not None and not isinstance(value_ref_, (dict, SecretValueRef)): - raise Exception("Expected value_ref_ to be a SecretValueRef, received: {}".format(type(value_ref_))) + if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): + raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) - self.backend_name = backend_name_ - self.create_time = create_time_ - self.expire_time = expire_time_ - self.revision = revision_ - self.update_time = update_time_ - self.value_ref = value_ref_ + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.cidr = cidr_ + self.life = life_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.space_tag = space_tag_ + self.status = status_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ self.unknown_fields = unknown_fields -class SecretValueRef(Type): - _toSchema = {'backend_id': 'backend-id', 'revision_id': 'revision-id'} - _toPy = {'backend-id': 'backend_id', 'revision-id': 'revision_id'} - def __init__(self, backend_id=None, revision_id=None, **unknown_fields): +class SubnetV2(Type): + _toSchema = {'cidr': 'cidr', 'id_': 'id', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_tag': 'space-tag', 'status': 'status', 'subnet': 'Subnet', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} + _toPy = {'Subnet': 'subnet', 'cidr': 'cidr', 'id': 'id_', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, subnet=None, cidr=None, id_=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): ''' - backend_id : str - revision_id : str + subnet : Subnet + cidr : str + id_ : str + life : str + provider_id : str + provider_network_id : str + provider_space_id : str + space_tag : str + status : str + vlan_tag : int + zones : typing.Sequence[str] ''' - backend_id_ = backend_id - revision_id_ = revision_id + subnet_ = Subnet.from_json(subnet) if subnet else None + cidr_ = cidr + id__ = id_ + life_ = life + provider_id_ = provider_id + provider_network_id_ = provider_network_id + provider_space_id_ = provider_space_id + space_tag_ = space_tag + status_ = status + vlan_tag_ = vlan_tag + zones_ = zones # Validate arguments against known Juju API types. - if backend_id_ is not None and not isinstance(backend_id_, (bytes, str)): - raise Exception("Expected backend_id_ to be a str, received: {}".format(type(backend_id_))) + if subnet_ is not None and not isinstance(subnet_, (dict, Subnet)): + raise Exception("Expected subnet_ to be a Subnet, received: {}".format(type(subnet_))) - if revision_id_ is not None and not isinstance(revision_id_, (bytes, str)): - raise Exception("Expected revision_id_ to be a str, received: {}".format(type(revision_id_))) + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) - self.backend_id = backend_id_ - self.revision_id = revision_id_ - self.unknown_fields = unknown_fields + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) -class SecretValueResult(Type): - _toSchema = {'data': 'data', 'error': 'error'} - _toPy = {'data': 'data', 'error': 'error'} - def __init__(self, data=None, error=None, **unknown_fields): - ''' - data : typing.Mapping[str, str] - error : Error - ''' - data_ = data - error_ = Error.from_json(error) if error else None + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) - # Validate arguments against known Juju API types. - if data_ is not None and not isinstance(data_, dict): - raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): + raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) - self.data = data_ - self.error = error_ + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.subnet = subnet_ + self.cidr = cidr_ + self.id_ = id__ + self.life = life_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.space_tag = space_tag_ + self.status = status_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ self.unknown_fields = unknown_fields -class SecretsFilter(Type): - _toSchema = {'label': 'label', 'owner_tag': 'owner-tag', 'revision': 'revision', 'uri': 'uri'} - _toPy = {'label': 'label', 'owner-tag': 'owner_tag', 'revision': 'revision', 'uri': 'uri'} - def __init__(self, label=None, owner_tag=None, revision=None, uri=None, **unknown_fields): +class SubnetV3(Type): + _toSchema = {'cidr': 'cidr', 'fan_info': 'fan-info', 'id_': 'id', 'is_public': 'is-public', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_id': 'space-id', 'space_tag': 'space-tag', 'status': 'status', 'subnet': 'Subnet', 'subnetv2': 'SubnetV2', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} + _toPy = {'Subnet': 'subnet', 'SubnetV2': 'subnetv2', 'cidr': 'cidr', 'fan-info': 'fan_info', 'id': 'id_', 'is-public': 'is_public', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-id': 'space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, subnet=None, subnetv2=None, cidr=None, fan_info=None, id_=None, is_public=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): ''' - label : str - owner_tag : str - revision : int - uri : str + subnet : Subnet + subnetv2 : SubnetV2 + cidr : str + fan_info : FanConfigEntry + id_ : str + is_public : bool + life : str + provider_id : str + provider_network_id : str + provider_space_id : str + space_id : str + space_tag : str + status : str + vlan_tag : int + zones : typing.Sequence[str] ''' - label_ = label - owner_tag_ = owner_tag - revision_ = revision - uri_ = uri + subnet_ = Subnet.from_json(subnet) if subnet else None + subnetv2_ = SubnetV2.from_json(subnetv2) if subnetv2 else None + cidr_ = cidr + fan_info_ = FanConfigEntry.from_json(fan_info) if fan_info else None + id__ = id_ + is_public_ = is_public + life_ = life + provider_id_ = provider_id + provider_network_id_ = provider_network_id + provider_space_id_ = provider_space_id + space_id_ = space_id + space_tag_ = space_tag + status_ = status + vlan_tag_ = vlan_tag + zones_ = zones # Validate arguments against known Juju API types. - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + if subnet_ is not None and not isinstance(subnet_, (dict, Subnet)): + raise Exception("Expected subnet_ to be a Subnet, received: {}".format(type(subnet_))) - 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 subnetv2_ is not None and not isinstance(subnetv2_, (dict, SubnetV2)): + raise Exception("Expected subnetv2_ to be a SubnetV2, received: {}".format(type(subnetv2_))) - if revision_ is not None and not isinstance(revision_, int): - raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) - if uri_ is not None and not isinstance(uri_, (bytes, str)): - raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + if fan_info_ is not None and not isinstance(fan_info_, (dict, FanConfigEntry)): + raise Exception("Expected fan_info_ to be a FanConfigEntry, received: {}".format(type(fan_info_))) - self.label = label_ - self.owner_tag = owner_tag_ - self.revision = revision_ - self.uri = uri_ - self.unknown_fields = unknown_fields + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + if is_public_ is not None and not isinstance(is_public_, bool): + raise Exception("Expected is_public_ to be a bool, received: {}".format(type(is_public_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) -class SetConstraints(Type): - _toSchema = {'application': 'application', 'constraints': 'constraints'} - _toPy = {'application': 'application', 'constraints': 'constraints'} - def __init__(self, application=None, constraints=None, **unknown_fields): - ''' - application : str - constraints : Value - ''' - application_ = application - constraints_ = Value.from_json(constraints) if constraints else None + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - # Validate arguments against known Juju API types. - if application_ is not None and not isinstance(application_, (bytes, str)): - raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) - if constraints_ is not None and not isinstance(constraints_, (dict, Value)): - raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) - self.application = application_ - self.constraints = constraints_ + if space_id_ is not None and not isinstance(space_id_, (bytes, str)): + raise Exception("Expected space_id_ to be a str, received: {}".format(type(space_id_))) + + if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): + raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.subnet = subnet_ + self.subnetv2 = subnetv2_ + self.cidr = cidr_ + self.fan_info = fan_info_ + self.id_ = id__ + self.is_public = is_public_ + self.life = life_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.space_id = space_id_ + self.space_tag = space_tag_ + self.status = status_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ self.unknown_fields = unknown_fields -class SetModelDefaults(Type): - _toSchema = {'config': 'config'} - _toPy = {'config': 'config'} - def __init__(self, config=None, **unknown_fields): +class SubnetsFilters(Type): + _toSchema = {'space_tag': 'space-tag', 'zone': 'zone'} + _toPy = {'space-tag': 'space_tag', 'zone': 'zone'} + def __init__(self, space_tag=None, zone=None, **unknown_fields): ''' - config : typing.Sequence[~ModelDefaultValues] + space_tag : str + zone : str ''' - config_ = [ModelDefaultValues.from_json(o) for o in config or []] + space_tag_ = space_tag + zone_ = zone # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, (bytes, str, list)): - raise Exception("Expected config_ to be a Sequence, received: {}".format(type(config_))) + if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): + raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) - self.config = config_ + if zone_ is not None and not isinstance(zone_, (bytes, str)): + raise Exception("Expected zone_ to be a str, received: {}".format(type(zone_))) + + self.space_tag = space_tag_ + self.zone = zone_ self.unknown_fields = unknown_fields -class ShowSpaceResult(Type): - _toSchema = {'applications': 'applications', 'error': 'error', 'machine_count': 'machine-count', 'space': 'space'} - _toPy = {'applications': 'applications', 'error': 'error', 'machine-count': 'machine_count', 'space': 'space'} - def __init__(self, applications=None, error=None, machine_count=None, space=None, **unknown_fields): +class SubnetsResult(Type): + _toSchema = {'error': 'error', 'subnets': 'subnets'} + _toPy = {'error': 'error', 'subnets': 'subnets'} + def __init__(self, error=None, subnets=None, **unknown_fields): ''' - applications : typing.Sequence[str] error : Error - machine_count : int - space : Space + subnets : typing.Sequence[~SubnetV2] ''' - applications_ = applications error_ = Error.from_json(error) if error else None - machine_count_ = machine_count - space_ = Space.from_json(space) if space else None + subnets_ = [SubnetV2.from_json(o) for o in subnets or []] # Validate arguments against known Juju API types. - if applications_ is not None and not isinstance(applications_, (bytes, str, list)): - raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if machine_count_ is not None and not isinstance(machine_count_, int): - raise Exception("Expected machine_count_ to be a int, received: {}".format(type(machine_count_))) - - if space_ is not None and not isinstance(space_, (dict, Space)): - raise Exception("Expected space_ to be a Space, received: {}".format(type(space_))) + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) - self.applications = applications_ self.error = error_ - self.machine_count = machine_count_ - self.space = space_ + self.subnets = subnets_ self.unknown_fields = unknown_fields -class ShowSpaceResults(Type): +class SubnetsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~ShowSpaceResult] + results : typing.Sequence[~SubnetsResult] ''' - results_ = [ShowSpaceResult.from_json(o) for o in results or []] + results_ = [SubnetsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -13469,164 +24808,146 @@ def __init__(self, results=None, **unknown_fields): -class Space(Type): - _toSchema = {'error': 'error', 'id_': 'id', 'name': 'name', 'subnets': 'subnets'} - _toPy = {'error': 'error', 'id': 'id_', 'name': 'name', 'subnets': 'subnets'} - def __init__(self, error=None, id_=None, name=None, subnets=None, **unknown_fields): +class SummaryWatcherID(Type): + _toSchema = {'watcher_id': 'watcher-id'} + _toPy = {'watcher-id': 'watcher_id'} + def __init__(self, watcher_id=None, **unknown_fields): ''' - error : Error - id_ : str - name : str - subnets : typing.Sequence[~Subnet] + watcher_id : str ''' - error_ = Error.from_json(error) if error else None - id__ = id_ - name_ = name - subnets_ = [Subnet.from_json(o) for o in subnets or []] + watcher_id_ = watcher_id # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) - if id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): - raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) - self.error = error_ - self.id_ = id__ - self.name = name_ - self.subnets = subnets_ +class SummaryWatcherNextResults(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~ModelAbstract] + ''' + models_ = [ModelAbstract.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ self.unknown_fields = unknown_fields -class StatusHistoryFilter(Type): - _toSchema = {'date': 'date', 'delta': 'delta', 'exclude': 'exclude', 'size': 'size'} - _toPy = {'date': 'date', 'delta': 'delta', 'exclude': 'exclude', 'size': 'size'} - def __init__(self, date=None, delta=None, exclude=None, size=None, **unknown_fields): +class SupportedFeature(Type): + _toSchema = {'description': 'description', 'name': 'name', 'version': 'version'} + _toPy = {'description': 'description', 'name': 'name', 'version': 'version'} + def __init__(self, description=None, name=None, version=None, **unknown_fields): ''' - date : str - delta : int - exclude : typing.Sequence[str] - size : int + description : str + name : str + version : str ''' - date_ = date - delta_ = delta - exclude_ = exclude - size_ = size + description_ = description + name_ = name + version_ = version # Validate arguments against known Juju API types. - if date_ is not None and not isinstance(date_, (bytes, str)): - raise Exception("Expected date_ to be a str, received: {}".format(type(date_))) - - if delta_ is not None and not isinstance(delta_, int): - raise Exception("Expected delta_ to be a int, received: {}".format(type(delta_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - if exclude_ is not None and not isinstance(exclude_, (bytes, str, list)): - raise Exception("Expected exclude_ to be a Sequence, received: {}".format(type(exclude_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) - self.date = date_ - self.delta = delta_ - self.exclude = exclude_ - self.size = size_ + self.description = description_ + self.name = name_ + self.version = version_ self.unknown_fields = unknown_fields -class StatusHistoryRequest(Type): - _toSchema = {'filter_': 'filter', 'historykind': 'historyKind', 'size': 'size', 'tag': 'tag'} - _toPy = {'filter': 'filter_', 'historyKind': 'historykind', 'size': 'size', 'tag': 'tag'} - def __init__(self, filter_=None, historykind=None, size=None, tag=None, **unknown_fields): +class TaggedCredential(Type): + _toSchema = {'credential': 'credential', 'tag': 'tag'} + _toPy = {'credential': 'credential', 'tag': 'tag'} + def __init__(self, credential=None, tag=None, **unknown_fields): ''' - filter_ : StatusHistoryFilter - historykind : str - size : int + credential : CloudCredential tag : str ''' - filter__ = StatusHistoryFilter.from_json(filter_) if filter_ else None - historykind_ = historykind - size_ = size + credential_ = CloudCredential.from_json(credential) if credential else None tag_ = tag # Validate arguments against known Juju API types. - if filter__ is not None and not isinstance(filter__, (dict, StatusHistoryFilter)): - raise Exception("Expected filter__ to be a StatusHistoryFilter, received: {}".format(type(filter__))) - - if historykind_ is not None and not isinstance(historykind_, (bytes, str)): - raise Exception("Expected historykind_ to be a str, received: {}".format(type(historykind_))) - - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): + raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) if tag_ is not None and not isinstance(tag_, (bytes, str)): raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) - self.filter_ = filter__ - self.historykind = historykind_ - self.size = size_ + self.credential = credential_ self.tag = tag_ self.unknown_fields = unknown_fields -class StatusHistoryRequests(Type): - _toSchema = {'requests': 'requests'} - _toPy = {'requests': 'requests'} - def __init__(self, requests=None, **unknown_fields): +class TaggedCredentials(Type): + _toSchema = {'credentials': 'credentials'} + _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): ''' - requests : typing.Sequence[~StatusHistoryRequest] + credentials : typing.Sequence[~TaggedCredential] ''' - requests_ = [StatusHistoryRequest.from_json(o) for o in requests or []] + credentials_ = [TaggedCredential.from_json(o) for o in credentials or []] # Validate arguments against known Juju API types. - if requests_ is not None and not isinstance(requests_, (bytes, str, list)): - raise Exception("Expected requests_ to be a Sequence, received: {}".format(type(requests_))) + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) - self.requests = requests_ + self.credentials = credentials_ self.unknown_fields = unknown_fields -class StatusHistoryResult(Type): - _toSchema = {'error': 'error', 'history': 'history'} - _toPy = {'error': 'error', 'history': 'history'} - def __init__(self, error=None, history=None, **unknown_fields): +class TokenResult(Type): + _toSchema = {'error': 'error', 'token': 'token'} + _toPy = {'error': 'error', 'token': 'token'} + def __init__(self, error=None, token=None, **unknown_fields): ''' error : Error - history : History + token : str ''' error_ = Error.from_json(error) if error else None - history_ = History.from_json(history) if history else None + token_ = token # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if history_ is not None and not isinstance(history_, (dict, History)): - raise Exception("Expected history_ to be a History, received: {}".format(type(history_))) + if token_ is not None and not isinstance(token_, (bytes, str)): + raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) self.error = error_ - self.history = history_ + self.token = token_ self.unknown_fields = unknown_fields -class StatusHistoryResults(Type): +class TokenResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~StatusHistoryResult] + results : typing.Sequence[~TokenResult] ''' - results_ = [StatusHistoryResult.from_json(o) for o in results or []] + results_ = [TokenResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -13637,589 +24958,776 @@ def __init__(self, results=None, **unknown_fields): -class StatusParams(Type): - _toSchema = {'include_storage': 'include-storage', 'patterns': 'patterns'} - _toPy = {'include-storage': 'include_storage', 'patterns': 'patterns'} - def __init__(self, include_storage=None, patterns=None, **unknown_fields): +class Tools(Type): + _toSchema = {'sha256': 'sha256', 'size': 'size', 'url': 'url', 'version': 'version'} + _toPy = {'sha256': 'sha256', 'size': 'size', 'url': 'url', 'version': 'version'} + def __init__(self, sha256=None, size=None, url=None, version=None, **unknown_fields): ''' - include_storage : bool - patterns : typing.Sequence[str] + sha256 : str + size : int + url : str + version : Binary ''' - include_storage_ = include_storage - patterns_ = patterns + sha256_ = sha256 + size_ = size + url_ = url + version_ = Binary.from_json(version) if version else None # Validate arguments against known Juju API types. - if include_storage_ is not None and not isinstance(include_storage_, bool): - raise Exception("Expected include_storage_ to be a bool, received: {}".format(type(include_storage_))) + if sha256_ is not None and not isinstance(sha256_, (bytes, str)): + raise Exception("Expected sha256_ to be a str, received: {}".format(type(sha256_))) - if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): - raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) - self.include_storage = include_storage_ - self.patterns = patterns_ + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + if version_ is not None and not isinstance(version_, (dict, Binary)): + raise Exception("Expected version_ to be a Binary, received: {}".format(type(version_))) + + self.sha256 = sha256_ + self.size = size_ + self.url = url_ + self.version = version_ self.unknown_fields = unknown_fields -class StorageAddParams(Type): - _toSchema = {'name': 'name', 'storage': 'storage', 'unit': 'unit'} - _toPy = {'name': 'name', 'storage': 'storage', 'unit': 'unit'} - def __init__(self, name=None, storage=None, unit=None, **unknown_fields): +class ToolsResult(Type): + _toSchema = {'error': 'error', 'tools': 'tools'} + _toPy = {'error': 'error', 'tools': 'tools'} + def __init__(self, error=None, tools=None, **unknown_fields): ''' - name : str - storage : StorageConstraints - unit : str + error : Error + tools : typing.Sequence[~Tools] ''' - name_ = name - storage_ = StorageConstraints.from_json(storage) if storage else None - unit_ = unit + error_ = Error.from_json(error) if error else None + tools_ = [Tools.from_json(o) for o in tools or []] # Validate arguments against known Juju API types. - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if storage_ is not None and not isinstance(storage_, (dict, StorageConstraints)): - raise Exception("Expected storage_ to be a StorageConstraints, received: {}".format(type(storage_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if unit_ is not None and not isinstance(unit_, (bytes, str)): - raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + if tools_ is not None and not isinstance(tools_, (bytes, str, list)): + raise Exception("Expected tools_ to be a Sequence, received: {}".format(type(tools_))) - self.name = name_ - self.storage = storage_ - self.unit = unit_ + self.error = error_ + self.tools = tools_ self.unknown_fields = unknown_fields -class StorageAttachmentDetails(Type): - _toSchema = {'life': 'life', 'location': 'location', 'machine_tag': 'machine-tag', 'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} - _toPy = {'life': 'life', 'location': 'location', 'machine-tag': 'machine_tag', 'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} - def __init__(self, life=None, location=None, machine_tag=None, storage_tag=None, unit_tag=None, **unknown_fields): +class ToolsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - life : str - location : str - machine_tag : str - storage_tag : str - unit_tag : str + results : typing.Sequence[~ToolsResult] ''' - life_ = life - location_ = location - machine_tag_ = machine_tag - storage_tag_ = storage_tag - unit_tag_ = unit_tag + results_ = [ToolsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if location_ is not None and not isinstance(location_, (bytes, str)): - raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + self.results = results_ + self.unknown_fields = unknown_fields - if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): - raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) - if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): - raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) - if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): - raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) +class TrackPayloadArgs(Type): + _toSchema = {'payloads': 'payloads'} + _toPy = {'payloads': 'payloads'} + def __init__(self, payloads=None, **unknown_fields): + ''' + payloads : typing.Sequence[~Payload] + ''' + payloads_ = [Payload.from_json(o) for o in payloads or []] - self.life = life_ - self.location = location_ - self.machine_tag = machine_tag_ - self.storage_tag = storage_tag_ - self.unit_tag = unit_tag_ + # Validate arguments against known Juju API types. + if payloads_ is not None and not isinstance(payloads_, (bytes, str, list)): + raise Exception("Expected payloads_ to be a Sequence, received: {}".format(type(payloads_))) + + self.payloads = payloads_ self.unknown_fields = unknown_fields -class StorageAttachmentId(Type): - _toSchema = {'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} - _toPy = {'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} - def __init__(self, storage_tag=None, unit_tag=None, **unknown_fields): +class UndertakerModelInfo(Type): + _toSchema = {'destroy_timeout': 'destroy-timeout', 'force_destroyed': 'force-destroyed', 'global_name': 'global-name', 'is_system': 'is-system', 'life': 'life', 'name': 'name', 'uuid': 'uuid'} + _toPy = {'destroy-timeout': 'destroy_timeout', 'force-destroyed': 'force_destroyed', 'global-name': 'global_name', 'is-system': 'is_system', 'life': 'life', 'name': 'name', 'uuid': 'uuid'} + def __init__(self, destroy_timeout=None, force_destroyed=None, global_name=None, is_system=None, life=None, name=None, uuid=None, **unknown_fields): ''' - storage_tag : str - unit_tag : str + destroy_timeout : int + force_destroyed : bool + global_name : str + is_system : bool + life : str + name : str + uuid : str ''' - storage_tag_ = storage_tag - unit_tag_ = unit_tag + destroy_timeout_ = destroy_timeout + force_destroyed_ = force_destroyed + global_name_ = global_name + is_system_ = is_system + life_ = life + name_ = name + uuid_ = uuid # Validate arguments against known Juju API types. - if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): - raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + if destroy_timeout_ is not None and not isinstance(destroy_timeout_, int): + raise Exception("Expected destroy_timeout_ to be a int, received: {}".format(type(destroy_timeout_))) - if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): - raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + if force_destroyed_ is not None and not isinstance(force_destroyed_, bool): + raise Exception("Expected force_destroyed_ to be a bool, received: {}".format(type(force_destroyed_))) - self.storage_tag = storage_tag_ - self.unit_tag = unit_tag_ + if global_name_ is not None and not isinstance(global_name_, (bytes, str)): + raise Exception("Expected global_name_ to be a str, received: {}".format(type(global_name_))) + + if is_system_ is not None and not isinstance(is_system_, bool): + raise Exception("Expected is_system_ to be a bool, received: {}".format(type(is_system_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.destroy_timeout = destroy_timeout_ + self.force_destroyed = force_destroyed_ + self.global_name = global_name_ + self.is_system = is_system_ + self.life = life_ + self.name = name_ + self.uuid = uuid_ self.unknown_fields = unknown_fields -class StorageAttachmentIds(Type): - _toSchema = {'ids': 'ids'} - _toPy = {'ids': 'ids'} - def __init__(self, ids=None, **unknown_fields): +class UndertakerModelInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - ids : typing.Sequence[~StorageAttachmentId] + error : Error + result : UndertakerModelInfo ''' - ids_ = [StorageAttachmentId.from_json(o) for o in ids or []] + error_ = Error.from_json(error) if error else None + result_ = UndertakerModelInfo.from_json(result) if result else None # Validate arguments against known Juju API types. - if ids_ is not None and not isinstance(ids_, (bytes, str, list)): - raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.ids = ids_ + if result_ is not None and not isinstance(result_, (dict, UndertakerModelInfo)): + raise Exception("Expected result_ to be a UndertakerModelInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class StorageConstraints(Type): - _toSchema = {'count': 'count', 'pool': 'pool', 'size': 'size'} - _toPy = {'count': 'count', 'pool': 'pool', 'size': 'size'} - def __init__(self, count=None, pool=None, size=None, **unknown_fields): +class UnitInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - count : int - pool : str - size : int + error : Error + result : UnitResult ''' - count_ = count - pool_ = pool - size_ = size + error_ = Error.from_json(error) if error else None + result_ = UnitResult.from_json(result) if result else None # Validate arguments against known Juju API types. - if count_ is not None and not isinstance(count_, int): - raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) - - if pool_ is not None and not isinstance(pool_, (bytes, str)): - raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + if result_ is not None and not isinstance(result_, (dict, UnitResult)): + raise Exception("Expected result_ to be a UnitResult, received: {}".format(type(result_))) - self.count = count_ - self.pool = pool_ - self.size = size_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class StorageDetachmentParams(Type): - _toSchema = {'force': 'force', 'ids': 'ids', 'max_wait': 'max-wait'} - _toPy = {'force': 'force', 'ids': 'ids', 'max-wait': 'max_wait'} - def __init__(self, force=None, ids=None, max_wait=None, **unknown_fields): +class UnitInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - force : bool - ids : StorageAttachmentIds - max_wait : int + results : typing.Sequence[~UnitInfoResult] ''' - force_ = force - ids_ = StorageAttachmentIds.from_json(ids) if ids else None - max_wait_ = max_wait + results_ = [UnitInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - - if ids_ is not None and not isinstance(ids_, (dict, StorageAttachmentIds)): - raise Exception("Expected ids_ to be a StorageAttachmentIds, received: {}".format(type(ids_))) - - if max_wait_ is not None and not isinstance(max_wait_, int): - raise Exception("Expected max_wait_ to be a int, received: {}".format(type(max_wait_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.force = force_ - self.ids = ids_ - self.max_wait = max_wait_ + self.results = results_ self.unknown_fields = unknown_fields -class StorageDetails(Type): - _toSchema = {'attachments': 'attachments', 'kind': 'kind', 'life': 'life', 'owner_tag': 'owner-tag', 'persistent': 'persistent', 'status': 'status', 'storage_tag': 'storage-tag'} - _toPy = {'attachments': 'attachments', 'kind': 'kind', 'life': 'life', 'owner-tag': 'owner_tag', 'persistent': 'persistent', 'status': 'status', 'storage-tag': 'storage_tag'} - def __init__(self, attachments=None, kind=None, life=None, owner_tag=None, persistent=None, status=None, storage_tag=None, **unknown_fields): +class UnitRefreshResult(Type): + _toSchema = {'error': 'Error', 'life': 'Life', 'provider_id': 'provider-id', 'resolved': 'Resolved'} + _toPy = {'Error': 'error', 'Life': 'life', 'Resolved': 'resolved', 'provider-id': 'provider_id'} + def __init__(self, error=None, life=None, resolved=None, provider_id=None, **unknown_fields): ''' - attachments : typing.Mapping[str, ~StorageAttachmentDetails] - kind : int + error : Error life : str - owner_tag : str - persistent : bool - status : EntityStatus - storage_tag : str + resolved : str + provider_id : str ''' - attachments_ = {k: StorageAttachmentDetails.from_json(v) for k, v in (attachments or dict()).items()} - kind_ = kind + error_ = Error.from_json(error) if error else None life_ = life - owner_tag_ = owner_tag - persistent_ = persistent - status_ = EntityStatus.from_json(status) if status else None - storage_tag_ = storage_tag + resolved_ = resolved + provider_id_ = provider_id # Validate arguments against known Juju API types. - if attachments_ is not None and not isinstance(attachments_, dict): - raise Exception("Expected attachments_ to be a Mapping, received: {}".format(type(attachments_))) - - if kind_ is not None and not isinstance(kind_, int): - raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) if life_ is not None and not isinstance(life_, (bytes, str)): raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if 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 resolved_ is not None and not isinstance(resolved_, (bytes, str)): + raise Exception("Expected resolved_ to be a str, received: {}".format(type(resolved_))) - if persistent_ is not None and not isinstance(persistent_, bool): - raise Exception("Expected persistent_ to be a bool, received: {}".format(type(persistent_))) + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - if status_ is not None and not isinstance(status_, (dict, EntityStatus)): - raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + self.error = error_ + self.life = life_ + self.resolved = resolved_ + self.provider_id = provider_id_ + self.unknown_fields = unknown_fields - if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): - raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) - self.attachments = attachments_ - self.kind = kind_ - self.life = life_ - self.owner_tag = owner_tag_ - self.persistent = persistent_ - self.status = status_ - self.storage_tag = storage_tag_ + +class UnitRefreshResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UnitRefreshResult] + ''' + results_ = [UnitRefreshResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ self.unknown_fields = unknown_fields -class StorageDetailsListResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class UnitResourceResult(Type): + _toSchema = {'error': 'error', 'errorresult': 'ErrorResult', 'resource': 'resource'} + _toPy = {'ErrorResult': 'errorresult', 'error': 'error', 'resource': 'resource'} + def __init__(self, errorresult=None, error=None, resource=None, **unknown_fields): ''' + errorresult : ErrorResult error : Error - result : typing.Sequence[~StorageDetails] + resource : Resource ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None error_ = Error.from_json(error) if error else None - result_ = [StorageDetails.from_json(o) for o in result or []] + resource_ = Resource.from_json(resource) if resource else None # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (bytes, str, list)): - raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + if resource_ is not None and not isinstance(resource_, (dict, Resource)): + raise Exception("Expected resource_ to be a Resource, received: {}".format(type(resource_))) + self.errorresult = errorresult_ self.error = error_ - self.result = result_ + self.resource = resource_ self.unknown_fields = unknown_fields -class StorageDetailsListResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class UnitResources(Type): + _toSchema = {'download_progress': 'download-progress', 'entity': 'Entity', 'resources': 'resources', 'tag': 'tag'} + _toPy = {'Entity': 'entity', 'download-progress': 'download_progress', 'resources': 'resources', 'tag': 'tag'} + def __init__(self, entity=None, download_progress=None, resources=None, tag=None, **unknown_fields): ''' - results : typing.Sequence[~StorageDetailsListResult] + entity : Entity + download_progress : typing.Mapping[str, int] + resources : typing.Sequence[~Resource] + tag : str ''' - results_ = [StorageDetailsListResult.from_json(o) for o in results or []] + entity_ = Entity.from_json(entity) if entity else None + download_progress_ = download_progress + resources_ = [Resource.from_json(o) for o in resources or []] + tag_ = tag # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - self.results = results_ + if download_progress_ is not None and not isinstance(download_progress_, dict): + raise Exception("Expected download_progress_ to be a Mapping, received: {}".format(type(download_progress_))) + + if resources_ is not None and not isinstance(resources_, (bytes, str, list)): + raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.entity = entity_ + self.download_progress = download_progress_ + self.resources = resources_ + self.tag = tag_ self.unknown_fields = unknown_fields -class StorageDetailsResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class UnitResourcesResult(Type): + _toSchema = {'error': 'error', 'errorresult': 'ErrorResult', 'resources': 'resources'} + _toPy = {'ErrorResult': 'errorresult', 'error': 'error', 'resources': 'resources'} + def __init__(self, errorresult=None, error=None, resources=None, **unknown_fields): ''' + errorresult : ErrorResult error : Error - result : StorageDetails + resources : typing.Sequence[~UnitResourceResult] ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None error_ = Error.from_json(error) if error else None - result_ = StorageDetails.from_json(result) if result else None + resources_ = [UnitResourceResult.from_json(o) for o in resources or []] # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, StorageDetails)): - raise Exception("Expected result_ to be a StorageDetails, received: {}".format(type(result_))) + if resources_ is not None and not isinstance(resources_, (bytes, str, list)): + raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) + self.errorresult = errorresult_ self.error = error_ - self.result = result_ + self.resources = resources_ self.unknown_fields = unknown_fields -class StorageDetailsResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class UnitResult(Type): + _toSchema = {'address': 'address', 'charm': 'charm', 'leader': 'leader', 'life': 'life', 'machine': 'machine', 'opened_ports': 'opened-ports', 'provider_id': 'provider-id', 'public_address': 'public-address', 'relation_data': 'relation-data', 'tag': 'tag', 'workload_version': 'workload-version'} + _toPy = {'address': 'address', 'charm': 'charm', 'leader': 'leader', 'life': 'life', 'machine': 'machine', 'opened-ports': 'opened_ports', 'provider-id': 'provider_id', 'public-address': 'public_address', 'relation-data': 'relation_data', 'tag': 'tag', 'workload-version': 'workload_version'} + def __init__(self, address=None, charm=None, leader=None, life=None, machine=None, opened_ports=None, provider_id=None, public_address=None, relation_data=None, tag=None, workload_version=None, **unknown_fields): ''' - results : typing.Sequence[~StorageDetailsResult] + address : str + charm : str + leader : bool + life : str + machine : str + opened_ports : typing.Sequence[str] + provider_id : str + public_address : str + relation_data : typing.Sequence[~EndpointRelationData] + tag : str + workload_version : str ''' - results_ = [StorageDetailsResult.from_json(o) for o in results or []] + address_ = address + charm_ = charm + leader_ = leader + life_ = life + machine_ = machine + opened_ports_ = opened_ports + provider_id_ = provider_id + public_address_ = public_address + relation_data_ = [EndpointRelationData.from_json(o) for o in relation_data or []] + tag_ = tag + workload_version_ = workload_version # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) - self.results = results_ - self.unknown_fields = unknown_fields + if charm_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + if leader_ is not None and not isinstance(leader_, bool): + raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) -class StorageFilter(Type): - _toSchema = {} - _toPy = {} - def __init__(self, **unknown_fields): - ''' + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) - ''' + if opened_ports_ is not None and not isinstance(opened_ports_, (bytes, str, list)): + raise Exception("Expected opened_ports_ to be a Sequence, received: {}".format(type(opened_ports_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if public_address_ is not None and not isinstance(public_address_, (bytes, str)): + raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + + if relation_data_ is not None and not isinstance(relation_data_, (bytes, str, list)): + raise Exception("Expected relation_data_ to be a Sequence, received: {}".format(type(relation_data_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + + self.address = address_ + self.charm = charm_ + self.leader = leader_ + self.life = life_ + self.machine = machine_ + self.opened_ports = opened_ports_ + self.provider_id = provider_id_ + self.public_address = public_address_ + self.relation_data = relation_data_ + self.tag = tag_ + self.workload_version = workload_version_ self.unknown_fields = unknown_fields -class StorageFilters(Type): - _toSchema = {'filters': 'filters'} - _toPy = {'filters': 'filters'} - def __init__(self, filters=None, **unknown_fields): +class UnitSettings(Type): + _toSchema = {'version': 'version'} + _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): ''' - filters : typing.Sequence[~StorageFilter] + version : int ''' - filters_ = [StorageFilter.from_json(o) for o in filters or []] + version_ = version # Validate arguments against known Juju API types. - if filters_ is not None and not isinstance(filters_, (bytes, str, list)): - raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) - self.filters = filters_ + self.version = version_ self.unknown_fields = unknown_fields -class StoragePool(Type): - _toSchema = {'attrs': 'attrs', 'name': 'name', 'provider': 'provider'} - _toPy = {'attrs': 'attrs', 'name': 'name', 'provider': 'provider'} - def __init__(self, attrs=None, name=None, provider=None, **unknown_fields): +class UnitStateResult(Type): + _toSchema = {'charm_state': 'charm-state', 'error': 'error', 'meter_status_state': 'meter-status-state', 'relation_state': 'relation-state', 'secret_state': 'secret-state', 'storage_state': 'storage-state', 'uniter_state': 'uniter-state'} + _toPy = {'charm-state': 'charm_state', 'error': 'error', 'meter-status-state': 'meter_status_state', 'relation-state': 'relation_state', 'secret-state': 'secret_state', 'storage-state': 'storage_state', 'uniter-state': 'uniter_state'} + def __init__(self, charm_state=None, error=None, meter_status_state=None, relation_state=None, secret_state=None, storage_state=None, uniter_state=None, **unknown_fields): ''' - attrs : typing.Mapping[str, typing.Any] - name : str - provider : str + charm_state : typing.Mapping[str, str] + error : Error + meter_status_state : str + relation_state : typing.Mapping[str, str] + secret_state : str + storage_state : str + uniter_state : str ''' - attrs_ = attrs - name_ = name - provider_ = provider + charm_state_ = charm_state + error_ = Error.from_json(error) if error else None + meter_status_state_ = meter_status_state + relation_state_ = relation_state + secret_state_ = secret_state + storage_state_ = storage_state + uniter_state_ = uniter_state # Validate arguments against known Juju API types. - if attrs_ is not None and not isinstance(attrs_, dict): - raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) + if charm_state_ is not None and not isinstance(charm_state_, dict): + raise Exception("Expected charm_state_ to be a Mapping, received: {}".format(type(charm_state_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if provider_ is not None and not isinstance(provider_, (bytes, str)): - raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + if meter_status_state_ is not None and not isinstance(meter_status_state_, (bytes, str)): + raise Exception("Expected meter_status_state_ to be a str, received: {}".format(type(meter_status_state_))) - self.attrs = attrs_ - self.name = name_ - self.provider = provider_ + if relation_state_ is not None and not isinstance(relation_state_, dict): + raise Exception("Expected relation_state_ to be a Mapping, received: {}".format(type(relation_state_))) + + if secret_state_ is not None and not isinstance(secret_state_, (bytes, str)): + raise Exception("Expected secret_state_ to be a str, received: {}".format(type(secret_state_))) + + if storage_state_ is not None and not isinstance(storage_state_, (bytes, str)): + raise Exception("Expected storage_state_ to be a str, received: {}".format(type(storage_state_))) + + if uniter_state_ is not None and not isinstance(uniter_state_, (bytes, str)): + raise Exception("Expected uniter_state_ to be a str, received: {}".format(type(uniter_state_))) + + self.charm_state = charm_state_ + self.error = error_ + self.meter_status_state = meter_status_state_ + self.relation_state = relation_state_ + self.secret_state = secret_state_ + self.storage_state = storage_state_ + self.uniter_state = uniter_state_ self.unknown_fields = unknown_fields -class StoragePoolArgs(Type): - _toSchema = {'pools': 'pools'} - _toPy = {'pools': 'pools'} - def __init__(self, pools=None, **unknown_fields): +class UnitStateResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - pools : typing.Sequence[~StoragePool] + results : typing.Sequence[~UnitStateResult] ''' - pools_ = [StoragePool.from_json(o) for o in pools or []] + results_ = [UnitStateResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if pools_ is not None and not isinstance(pools_, (bytes, str, list)): - raise Exception("Expected pools_ to be a Sequence, received: {}".format(type(pools_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.pools = pools_ + self.results = results_ self.unknown_fields = unknown_fields -class StoragePoolDeleteArg(Type): - _toSchema = {'name': 'name'} - _toPy = {'name': 'name'} - def __init__(self, name=None, **unknown_fields): +class UnitStatus(Type): + _toSchema = {'address': 'address', 'agent_status': 'agent-status', 'charm': 'charm', 'leader': 'leader', 'machine': 'machine', 'opened_ports': 'opened-ports', 'provider_id': 'provider-id', 'public_address': 'public-address', 'subordinates': 'subordinates', 'workload_status': 'workload-status', 'workload_version': 'workload-version'} + _toPy = {'address': 'address', 'agent-status': 'agent_status', 'charm': 'charm', 'leader': 'leader', 'machine': 'machine', 'opened-ports': 'opened_ports', 'provider-id': 'provider_id', 'public-address': 'public_address', 'subordinates': 'subordinates', 'workload-status': 'workload_status', 'workload-version': 'workload_version'} + def __init__(self, address=None, agent_status=None, charm=None, leader=None, machine=None, opened_ports=None, provider_id=None, public_address=None, subordinates=None, workload_status=None, workload_version=None, **unknown_fields): ''' - name : str + address : str + agent_status : DetailedStatus + charm : str + leader : bool + machine : str + opened_ports : typing.Sequence[str] + provider_id : str + public_address : str + subordinates : typing.Mapping[str, ~UnitStatus] + workload_status : DetailedStatus + workload_version : str ''' - name_ = name + address_ = address + agent_status_ = DetailedStatus.from_json(agent_status) if agent_status else None + charm_ = charm + leader_ = leader + machine_ = machine + opened_ports_ = opened_ports + provider_id_ = provider_id + public_address_ = public_address + subordinates_ = {k: UnitStatus.from_json(v) for k, v in (subordinates or dict()).items()} + workload_status_ = DetailedStatus.from_json(workload_status) if workload_status else None + workload_version_ = workload_version # Validate arguments against known Juju API types. - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) - self.name = name_ - self.unknown_fields = unknown_fields + if agent_status_ is not None and not isinstance(agent_status_, (dict, DetailedStatus)): + raise Exception("Expected agent_status_ to be a DetailedStatus, received: {}".format(type(agent_status_))) + if charm_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + if leader_ is not None and not isinstance(leader_, bool): + raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) -class StoragePoolDeleteArgs(Type): - _toSchema = {'pools': 'pools'} - _toPy = {'pools': 'pools'} - def __init__(self, pools=None, **unknown_fields): - ''' - pools : typing.Sequence[~StoragePoolDeleteArg] - ''' - pools_ = [StoragePoolDeleteArg.from_json(o) for o in pools or []] + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) - # Validate arguments against known Juju API types. - if pools_ is not None and not isinstance(pools_, (bytes, str, list)): - raise Exception("Expected pools_ to be a Sequence, received: {}".format(type(pools_))) + if opened_ports_ is not None and not isinstance(opened_ports_, (bytes, str, list)): + raise Exception("Expected opened_ports_ to be a Sequence, received: {}".format(type(opened_ports_))) - self.pools = pools_ + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if public_address_ is not None and not isinstance(public_address_, (bytes, str)): + raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + + if subordinates_ is not None and not isinstance(subordinates_, dict): + raise Exception("Expected subordinates_ to be a Mapping, received: {}".format(type(subordinates_))) + + if workload_status_ is not None and not isinstance(workload_status_, (dict, DetailedStatus)): + raise Exception("Expected workload_status_ to be a DetailedStatus, received: {}".format(type(workload_status_))) + + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + + self.address = address_ + self.agent_status = agent_status_ + self.charm = charm_ + self.leader = leader_ + self.machine = machine_ + self.opened_ports = opened_ports_ + self.provider_id = provider_id_ + self.public_address = public_address_ + self.subordinates = subordinates_ + self.workload_status = workload_status_ + self.workload_version = workload_version_ self.unknown_fields = unknown_fields -class StoragePoolFilter(Type): - _toSchema = {'names': 'names', 'providers': 'providers'} - _toPy = {'names': 'names', 'providers': 'providers'} - def __init__(self, names=None, providers=None, **unknown_fields): +class UnitsResolved(Type): + _toSchema = {'all_': 'all', 'retry': 'retry', 'tags': 'tags'} + _toPy = {'all': 'all_', 'retry': 'retry', 'tags': 'tags'} + def __init__(self, all_=None, retry=None, tags=None, **unknown_fields): ''' - names : typing.Sequence[str] - providers : typing.Sequence[str] + all_ : bool + retry : bool + tags : Entities ''' - names_ = names - providers_ = providers + all__ = all_ + retry_ = retry + tags_ = Entities.from_json(tags) if tags else None # Validate arguments against known Juju API types. - if names_ is not None and not isinstance(names_, (bytes, str, list)): - raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) - if providers_ is not None and not isinstance(providers_, (bytes, str, list)): - raise Exception("Expected providers_ to be a Sequence, received: {}".format(type(providers_))) + if retry_ is not None and not isinstance(retry_, bool): + raise Exception("Expected retry_ to be a bool, received: {}".format(type(retry_))) - self.names = names_ - self.providers = providers_ + if tags_ is not None and not isinstance(tags_, (dict, Entities)): + raise Exception("Expected tags_ to be a Entities, received: {}".format(type(tags_))) + + self.all_ = all__ + self.retry = retry_ + self.tags = tags_ self.unknown_fields = unknown_fields -class StoragePoolFilters(Type): - _toSchema = {'filters': 'filters'} - _toPy = {'filters': 'filters'} - def __init__(self, filters=None, **unknown_fields): +class UnsetModelDefaults(Type): + _toSchema = {'keys': 'keys'} + _toPy = {'keys': 'keys'} + def __init__(self, keys=None, **unknown_fields): ''' - filters : typing.Sequence[~StoragePoolFilter] + keys : typing.Sequence[~ModelUnsetKeys] ''' - filters_ = [StoragePoolFilter.from_json(o) for o in filters or []] + keys_ = [ModelUnsetKeys.from_json(o) for o in keys or []] # Validate arguments against known Juju API types. - if filters_ is not None and not isinstance(filters_, (bytes, str, list)): - raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + if keys_ is not None and not isinstance(keys_, (bytes, str, list)): + raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) - self.filters = filters_ + self.keys = keys_ self.unknown_fields = unknown_fields -class StoragePoolsResult(Type): - _toSchema = {'error': 'error', 'storage_pools': 'storage-pools'} - _toPy = {'error': 'error', 'storage-pools': 'storage_pools'} - def __init__(self, error=None, storage_pools=None, **unknown_fields): +class UpdateApplicationServiceArg(Type): + _toSchema = {'addresses': 'addresses', 'application_tag': 'application-tag', 'generation': 'generation', 'provider_id': 'provider-id', 'scale': 'scale'} + _toPy = {'addresses': 'addresses', 'application-tag': 'application_tag', 'generation': 'generation', 'provider-id': 'provider_id', 'scale': 'scale'} + def __init__(self, addresses=None, application_tag=None, generation=None, provider_id=None, scale=None, **unknown_fields): ''' - error : Error - storage_pools : typing.Sequence[~StoragePool] + addresses : typing.Sequence[~Address] + application_tag : str + generation : int + provider_id : str + scale : int ''' - error_ = Error.from_json(error) if error else None - storage_pools_ = [StoragePool.from_json(o) for o in storage_pools or []] + addresses_ = [Address.from_json(o) for o in addresses or []] + application_tag_ = application_tag + generation_ = generation + provider_id_ = provider_id + scale_ = scale # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) - if storage_pools_ is not None and not isinstance(storage_pools_, (bytes, str, list)): - raise Exception("Expected storage_pools_ to be a Sequence, received: {}".format(type(storage_pools_))) + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - self.error = error_ - self.storage_pools = storage_pools_ + if generation_ is not None and not isinstance(generation_, int): + raise Exception("Expected generation_ to be a int, received: {}".format(type(generation_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + self.addresses = addresses_ + self.application_tag = application_tag_ + self.generation = generation_ + self.provider_id = provider_id_ + self.scale = scale_ self.unknown_fields = unknown_fields -class StoragePoolsResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class UpdateApplicationServiceArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - results : typing.Sequence[~StoragePoolsResult] + args : typing.Sequence[~UpdateApplicationServiceArg] ''' - results_ = [StoragePoolsResult.from_json(o) for o in results or []] + args_ = [UpdateApplicationServiceArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.results = results_ + self.args = args_ self.unknown_fields = unknown_fields -class StoragesAddParams(Type): - _toSchema = {'storages': 'storages'} - _toPy = {'storages': 'storages'} - def __init__(self, storages=None, **unknown_fields): +class UpdateApplicationUnitArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - storages : typing.Sequence[~StorageAddParams] + args : typing.Sequence[~UpdateApplicationUnits] ''' - storages_ = [StorageAddParams.from_json(o) for o in storages or []] + args_ = [UpdateApplicationUnits.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if storages_ is not None and not isinstance(storages_, (bytes, str, list)): - raise Exception("Expected storages_ to be a Sequence, received: {}".format(type(storages_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.storages = storages_ + self.args = args_ self.unknown_fields = unknown_fields -class StringResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class UpdateApplicationUnitResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error - result : str + info : UpdateApplicationUnitsInfo ''' error_ = Error.from_json(error) if error else None - result_ = result + info_ = UpdateApplicationUnitsInfo.from_json(info) if info else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (bytes, str)): - raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) + if info_ is not None and not isinstance(info_, (dict, UpdateApplicationUnitsInfo)): + raise Exception("Expected info_ to be a UpdateApplicationUnitsInfo, received: {}".format(type(info_))) self.error = error_ - self.result = result_ + self.info = info_ self.unknown_fields = unknown_fields -class StringResults(Type): +class UpdateApplicationUnitResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~StringResult] + results : typing.Sequence[~UpdateApplicationUnitResult] ''' - results_ = [StringResult.from_json(o) for o in results or []] + results_ = [UpdateApplicationUnitResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -14230,296 +25738,290 @@ def __init__(self, results=None, **unknown_fields): -class StringsResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class UpdateApplicationUnits(Type): + _toSchema = {'application_tag': 'application-tag', 'generation': 'generation', 'scale': 'scale', 'status': 'status', 'units': 'units'} + _toPy = {'application-tag': 'application_tag', 'generation': 'generation', 'scale': 'scale', 'status': 'status', 'units': 'units'} + def __init__(self, application_tag=None, generation=None, scale=None, status=None, units=None, **unknown_fields): ''' - error : Error - result : typing.Sequence[str] + application_tag : str + generation : int + scale : int + status : EntityStatus + units : typing.Sequence[~ApplicationUnitParams] ''' - error_ = Error.from_json(error) if error else None - result_ = result + application_tag_ = application_tag + generation_ = generation + scale_ = scale + status_ = EntityStatus.from_json(status) if status else None + units_ = [ApplicationUnitParams.from_json(o) for o in units or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) - if result_ is not None and not isinstance(result_, (bytes, str, list)): - raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + if generation_ is not None and not isinstance(generation_, int): + raise Exception("Expected generation_ to be a int, received: {}".format(type(generation_))) - self.error = error_ - self.result = result_ + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + self.application_tag = application_tag_ + self.generation = generation_ + self.scale = scale_ + self.status = status_ + self.units = units_ self.unknown_fields = unknown_fields -class StringsResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class UpdateApplicationUnitsInfo(Type): + _toSchema = {'units': 'units'} + _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): ''' - results : typing.Sequence[~StringsResult] + units : typing.Sequence[~ApplicationUnitInfo] ''' - results_ = [StringsResult.from_json(o) for o in results or []] + units_ = [ApplicationUnitInfo.from_json(o) for o in units or []] # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) - self.results = results_ + self.units = units_ self.unknown_fields = unknown_fields -class StringsWatchResult(Type): - _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} - _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} - def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): +class UpdateBehavior(Type): + _toSchema = {'enable_os_refresh_update': 'enable-os-refresh-update', 'enable_os_upgrade': 'enable-os-upgrade'} + _toPy = {'enable-os-refresh-update': 'enable_os_refresh_update', 'enable-os-upgrade': 'enable_os_upgrade'} + def __init__(self, enable_os_refresh_update=None, enable_os_upgrade=None, **unknown_fields): ''' - changes : typing.Sequence[str] - error : Error - watcher_id : str + enable_os_refresh_update : bool + enable_os_upgrade : bool ''' - changes_ = changes - error_ = Error.from_json(error) if error else None - watcher_id_ = watcher_id + enable_os_refresh_update_ = enable_os_refresh_update + enable_os_upgrade_ = enable_os_upgrade # Validate arguments against known Juju API types. - if changes_ is not None and not isinstance(changes_, (bytes, str, list)): - raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) - - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if enable_os_refresh_update_ is not None and not isinstance(enable_os_refresh_update_, bool): + raise Exception("Expected enable_os_refresh_update_ to be a bool, received: {}".format(type(enable_os_refresh_update_))) - if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): - raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + if enable_os_upgrade_ is not None and not isinstance(enable_os_upgrade_, bool): + raise Exception("Expected enable_os_upgrade_ to be a bool, received: {}".format(type(enable_os_upgrade_))) - self.changes = changes_ - self.error = error_ - self.watcher_id = watcher_id_ + self.enable_os_refresh_update = enable_os_refresh_update_ + self.enable_os_upgrade = enable_os_upgrade_ self.unknown_fields = unknown_fields -class StringsWatchResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): +class UpdateChannelArg(Type): + _toSchema = {'channel': 'channel', 'force': 'force', 'tag': 'tag'} + _toPy = {'channel': 'channel', 'force': 'force', 'tag': 'tag'} + def __init__(self, channel=None, force=None, tag=None, **unknown_fields): ''' - results : typing.Sequence[~StringsWatchResult] + channel : str + force : bool + tag : Entity ''' - results_ = [StringsWatchResult.from_json(o) for o in results or []] + channel_ = channel + force_ = force + tag_ = Entity.from_json(tag) if tag else None # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) - self.results = results_ + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if tag_ is not None and not isinstance(tag_, (dict, Entity)): + raise Exception("Expected tag_ to be a Entity, received: {}".format(type(tag_))) + + self.channel = channel_ + self.force = force_ + self.tag = tag_ self.unknown_fields = unknown_fields -class Subnet(Type): - _toSchema = {'cidr': 'cidr', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_tag': 'space-tag', 'status': 'status', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} - _toPy = {'cidr': 'cidr', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} - def __init__(self, cidr=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): +class UpdateChannelArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - cidr : str - life : str - provider_id : str - provider_network_id : str - provider_space_id : str - space_tag : str - status : str - vlan_tag : int - zones : typing.Sequence[str] + args : typing.Sequence[~UpdateChannelArg] ''' - cidr_ = cidr - life_ = life - provider_id_ = provider_id - provider_network_id_ = provider_network_id - provider_space_id_ = provider_space_id - space_tag_ = space_tag - status_ = status - vlan_tag_ = vlan_tag - zones_ = zones + args_ = [UpdateChannelArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if cidr_ is not None and not isinstance(cidr_, (bytes, str)): - raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) - - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - - if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): - raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): - raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + self.args = args_ + self.unknown_fields = unknown_fields - if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): - raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - if vlan_tag_ is not None and not isinstance(vlan_tag_, int): - raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) +class UpdateCloudArgs(Type): + _toSchema = {'clouds': 'clouds'} + _toPy = {'clouds': 'clouds'} + def __init__(self, clouds=None, **unknown_fields): + ''' + clouds : typing.Sequence[~AddCloudArgs] + ''' + clouds_ = [AddCloudArgs.from_json(o) for o in clouds or []] - if zones_ is not None and not isinstance(zones_, (bytes, str, list)): - raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + # Validate arguments against known Juju API types. + if clouds_ is not None and not isinstance(clouds_, (bytes, str, list)): + raise Exception("Expected clouds_ to be a Sequence, received: {}".format(type(clouds_))) - self.cidr = cidr_ - self.life = life_ - self.provider_id = provider_id_ - self.provider_network_id = provider_network_id_ - self.provider_space_id = provider_space_id_ - self.space_tag = space_tag_ - self.status = status_ - self.vlan_tag = vlan_tag_ - self.zones = zones_ + self.clouds = clouds_ self.unknown_fields = unknown_fields -class SubnetV2(Type): - _toSchema = {'cidr': 'cidr', 'id_': 'id', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_tag': 'space-tag', 'status': 'status', 'subnet': 'Subnet', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} - _toPy = {'Subnet': 'subnet', 'cidr': 'cidr', 'id': 'id_', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} - def __init__(self, subnet=None, cidr=None, id_=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): +class UpdateControllerForModel(Type): + _toSchema = {'info': 'info', 'model_tag': 'model-tag'} + _toPy = {'info': 'info', 'model-tag': 'model_tag'} + def __init__(self, info=None, model_tag=None, **unknown_fields): ''' - subnet : Subnet - cidr : str - id_ : str - life : str - provider_id : str - provider_network_id : str - provider_space_id : str - space_tag : str - status : str - vlan_tag : int - zones : typing.Sequence[str] + info : ExternalControllerInfo + model_tag : str ''' - subnet_ = Subnet.from_json(subnet) if subnet else None - cidr_ = cidr - id__ = id_ - life_ = life - provider_id_ = provider_id - provider_network_id_ = provider_network_id - provider_space_id_ = provider_space_id - space_tag_ = space_tag - status_ = status - vlan_tag_ = vlan_tag - zones_ = zones + info_ = ExternalControllerInfo.from_json(info) if info else None + model_tag_ = model_tag # Validate arguments against known Juju API types. - if subnet_ is not None and not isinstance(subnet_, (dict, Subnet)): - raise Exception("Expected subnet_ to be a Subnet, received: {}".format(type(subnet_))) + if info_ is not None and not isinstance(info_, (dict, ExternalControllerInfo)): + raise Exception("Expected info_ to be a ExternalControllerInfo, received: {}".format(type(info_))) - if cidr_ is not None and not isinstance(cidr_, (bytes, str)): - raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + 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 id__ is not None and not isinstance(id__, (bytes, str)): - raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + self.info = info_ + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): - raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) +class UpdateControllersForModelsParams(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~UpdateControllerForModel] + ''' + changes_ = [UpdateControllerForModel.from_json(o) for o in changes or []] - if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): - raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) - if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): - raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) + self.changes = changes_ + self.unknown_fields = unknown_fields - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - if vlan_tag_ is not None and not isinstance(vlan_tag_, int): - raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) - if zones_ is not None and not isinstance(zones_, (bytes, str, list)): - raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) +class UpdateCredentialArgs(Type): + _toSchema = {'credentials': 'credentials', 'force': 'force'} + _toPy = {'credentials': 'credentials', 'force': 'force'} + def __init__(self, credentials=None, force=None, **unknown_fields): + ''' + credentials : typing.Sequence[~TaggedCredential] + force : bool + ''' + credentials_ = [TaggedCredential.from_json(o) for o in credentials or []] + force_ = force + + # Validate arguments against known Juju API types. + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - self.subnet = subnet_ - self.cidr = cidr_ - self.id_ = id__ - self.life = life_ - self.provider_id = provider_id_ - self.provider_network_id = provider_network_id_ - self.provider_space_id = provider_space_id_ - self.space_tag = space_tag_ - self.status = status_ - self.vlan_tag = vlan_tag_ - self.zones = zones_ + self.credentials = credentials_ + self.force = force_ self.unknown_fields = unknown_fields -class SubnetsFilters(Type): - _toSchema = {'space_tag': 'space-tag', 'zone': 'zone'} - _toPy = {'space-tag': 'space_tag', 'zone': 'zone'} - def __init__(self, space_tag=None, zone=None, **unknown_fields): +class UpdateCredentialModelResult(Type): + _toSchema = {'errors': 'errors', 'name': 'name', 'uuid': 'uuid'} + _toPy = {'errors': 'errors', 'name': 'name', 'uuid': 'uuid'} + def __init__(self, errors=None, name=None, uuid=None, **unknown_fields): ''' - space_tag : str - zone : str + errors : typing.Sequence[~ErrorResult] + name : str + uuid : str ''' - space_tag_ = space_tag - zone_ = zone + errors_ = [ErrorResult.from_json(o) for o in errors or []] + name_ = name + uuid_ = uuid # Validate arguments against known Juju API types. - if space_tag_ is not None and not isinstance(space_tag_, (bytes, str)): - raise Exception("Expected space_tag_ to be a str, received: {}".format(type(space_tag_))) + if errors_ is not None and not isinstance(errors_, (bytes, str, list)): + raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) - if zone_ is not None and not isinstance(zone_, (bytes, str)): - raise Exception("Expected zone_ to be a str, received: {}".format(type(zone_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - self.space_tag = space_tag_ - self.zone = zone_ + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.errors = errors_ + self.name = name_ + self.uuid = uuid_ self.unknown_fields = unknown_fields -class SubnetsResult(Type): - _toSchema = {'error': 'error', 'subnets': 'subnets'} - _toPy = {'error': 'error', 'subnets': 'subnets'} - def __init__(self, error=None, subnets=None, **unknown_fields): +class UpdateCredentialResult(Type): + _toSchema = {'error': 'error', 'models': 'models', 'tag': 'tag'} + _toPy = {'error': 'error', 'models': 'models', 'tag': 'tag'} + def __init__(self, error=None, models=None, tag=None, **unknown_fields): ''' error : Error - subnets : typing.Sequence[~SubnetV2] + models : typing.Sequence[~UpdateCredentialModelResult] + tag : str ''' error_ = Error.from_json(error) if error else None - subnets_ = [SubnetV2.from_json(o) for o in subnets or []] + models_ = [UpdateCredentialModelResult.from_json(o) for o in models or []] + tag_ = tag # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): - raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) self.error = error_ - self.subnets = subnets_ + self.models = models_ + self.tag = tag_ self.unknown_fields = unknown_fields -class SubnetsResults(Type): +class UpdateCredentialResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~SubnetsResult] + results : typing.Sequence[~UpdateCredentialResult] ''' - results_ = [SubnetsResult.from_json(o) for o in results or []] + results_ = [UpdateCredentialResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -14530,572 +26032,614 @@ def __init__(self, results=None, **unknown_fields): -class SummaryWatcherID(Type): - _toSchema = {'watcher_id': 'watcher-id'} - _toPy = {'watcher-id': 'watcher_id'} - def __init__(self, watcher_id=None, **unknown_fields): +class UpdateSecretArg(Type): + _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} + _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, content=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' - watcher_id : str + upsertsecretarg : UpsertSecretArg + content : SecretContentParams + description : str + expire_time : str + label : str + params : typing.Mapping[str, typing.Any] + rotate_policy : str + uri : str ''' - watcher_id_ = watcher_id + upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None + content_ = SecretContentParams.from_json(content) if content else None + description_ = description + expire_time_ = expire_time + label_ = label + params_ = params + rotate_policy_ = rotate_policy + uri_ = uri # Validate arguments against known Juju API types. - if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): - raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): + raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) - self.watcher_id = watcher_id_ - self.unknown_fields = unknown_fields + if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): + raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) -class SupportedFeature(Type): - _toSchema = {'description': 'description', 'name': 'name', 'version': 'version'} - _toPy = {'description': 'description', 'name': 'name', 'version': 'version'} - def __init__(self, description=None, name=None, version=None, **unknown_fields): - ''' - description : str - name : str - version : str - ''' - description_ = description - name_ = name - version_ = version + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - # Validate arguments against known Juju API types. - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) - if version_ is not None and not isinstance(version_, (bytes, str)): - raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + self.upsertsecretarg = upsertsecretarg_ + self.content = content_ self.description = description_ - self.name = name_ - self.version = version_ + self.expire_time = expire_time_ + self.label = label_ + self.params = params_ + self.rotate_policy = rotate_policy_ + self.uri = uri_ self.unknown_fields = unknown_fields -class TaggedCredential(Type): - _toSchema = {'credential': 'credential', 'tag': 'tag'} - _toPy = {'credential': 'credential', 'tag': 'tag'} - def __init__(self, credential=None, tag=None, **unknown_fields): +class UpdateSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - credential : CloudCredential - tag : str + args : typing.Sequence[~UpdateSecretArg] ''' - credential_ = CloudCredential.from_json(credential) if credential else None - tag_ = tag + args_ = [UpdateSecretArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): - raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) - - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.credential = credential_ - self.tag = tag_ + self.args = args_ self.unknown_fields = unknown_fields -class TaggedCredentials(Type): - _toSchema = {'credentials': 'credentials'} - _toPy = {'credentials': 'credentials'} - def __init__(self, credentials=None, **unknown_fields): +class UpdateSecretBackendArg(Type): + _toSchema = {'config': 'config', 'force': 'force', 'name': 'name', 'name_change': 'name-change', 'reset': 'reset', 'token_rotate_interval': 'token-rotate-interval'} + _toPy = {'config': 'config', 'force': 'force', 'name': 'name', 'name-change': 'name_change', 'reset': 'reset', 'token-rotate-interval': 'token_rotate_interval'} + def __init__(self, config=None, force=None, name=None, name_change=None, reset=None, token_rotate_interval=None, **unknown_fields): ''' - credentials : typing.Sequence[~TaggedCredential] + config : typing.Mapping[str, typing.Any] + force : bool + name : str + name_change : str + reset : typing.Sequence[str] + token_rotate_interval : int ''' - credentials_ = [TaggedCredential.from_json(o) for o in credentials or []] + config_ = config + force_ = force + name_ = name + name_change_ = name_change + reset_ = reset + token_rotate_interval_ = token_rotate_interval # Validate arguments against known Juju API types. - if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): - raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - self.credentials = credentials_ - self.unknown_fields = unknown_fields + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if name_change_ is not None and not isinstance(name_change_, (bytes, str)): + raise Exception("Expected name_change_ to be a str, received: {}".format(type(name_change_))) -class Tools(Type): - _toSchema = {'sha256': 'sha256', 'size': 'size', 'url': 'url', 'version': 'version'} - _toPy = {'sha256': 'sha256', 'size': 'size', 'url': 'url', 'version': 'version'} - def __init__(self, sha256=None, size=None, url=None, version=None, **unknown_fields): - ''' - sha256 : str - size : int - url : str - version : Binary - ''' - sha256_ = sha256 - size_ = size - url_ = url - version_ = Binary.from_json(version) if version else None + if reset_ is not None and not isinstance(reset_, (bytes, str, list)): + raise Exception("Expected reset_ to be a Sequence, received: {}".format(type(reset_))) - # Validate arguments against known Juju API types. - if sha256_ is not None and not isinstance(sha256_, (bytes, str)): - raise Exception("Expected sha256_ to be a str, received: {}".format(type(sha256_))) + if token_rotate_interval_ is not None and not isinstance(token_rotate_interval_, int): + raise Exception("Expected token_rotate_interval_ to be a int, received: {}".format(type(token_rotate_interval_))) - if size_ is not None and not isinstance(size_, int): - raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + self.config = config_ + self.force = force_ + self.name = name_ + self.name_change = name_change_ + self.reset = reset_ + self.token_rotate_interval = token_rotate_interval_ + self.unknown_fields = unknown_fields - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) - if version_ is not None and not isinstance(version_, (dict, Binary)): - raise Exception("Expected version_ to be a Binary, received: {}".format(type(version_))) - self.sha256 = sha256_ - self.size = size_ - self.url = url_ - self.version = version_ +class UpdateSecretBackendArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~UpdateSecretBackendArg] + ''' + args_ = [UpdateSecretBackendArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ self.unknown_fields = unknown_fields -class UnitInfoResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class UpdateUserSecretArg(Type): + _toSchema = {'auto_prune': 'auto-prune', 'content': 'content', 'description': 'description', 'existing_label': 'existing-label', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} + _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'auto-prune': 'auto_prune', 'content': 'content', 'description': 'description', 'existing-label': 'existing_label', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, auto_prune=None, content=None, description=None, existing_label=None, expire_time=None, label=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' - error : Error - result : UnitResult + upsertsecretarg : UpsertSecretArg + auto_prune : bool + content : SecretContentParams + description : str + existing_label : str + expire_time : str + label : str + params : typing.Mapping[str, typing.Any] + rotate_policy : str + uri : str ''' - error_ = Error.from_json(error) if error else None - result_ = UnitResult.from_json(result) if result else None + upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None + auto_prune_ = auto_prune + content_ = SecretContentParams.from_json(content) if content else None + description_ = description + existing_label_ = existing_label + expire_time_ = expire_time + label_ = label + params_ = params + rotate_policy_ = rotate_policy + uri_ = uri # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): + raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) - if result_ is not None and not isinstance(result_, (dict, UnitResult)): - raise Exception("Expected result_ to be a UnitResult, received: {}".format(type(result_))) + if auto_prune_ is not None and not isinstance(auto_prune_, bool): + raise Exception("Expected auto_prune_ to be a bool, received: {}".format(type(auto_prune_))) - self.error = error_ - self.result = result_ - self.unknown_fields = unknown_fields + if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): + raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if existing_label_ is not None and not isinstance(existing_label_, (bytes, str)): + raise Exception("Expected existing_label_ to be a str, received: {}".format(type(existing_label_))) -class UnitInfoResults(Type): - _toSchema = {'results': 'results'} - _toPy = {'results': 'results'} - def __init__(self, results=None, **unknown_fields): - ''' - results : typing.Sequence[~UnitInfoResult] - ''' - results_ = [UnitInfoResult.from_json(o) for o in results or []] + if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) - # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - self.results = results_ + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.upsertsecretarg = upsertsecretarg_ + self.auto_prune = auto_prune_ + self.content = content_ + self.description = description_ + self.existing_label = existing_label_ + self.expire_time = expire_time_ + self.label = label_ + self.params = params_ + self.rotate_policy = rotate_policy_ + self.uri = uri_ self.unknown_fields = unknown_fields -class UnitResources(Type): - _toSchema = {'download_progress': 'download-progress', 'entity': 'Entity', 'resources': 'resources', 'tag': 'tag'} - _toPy = {'Entity': 'entity', 'download-progress': 'download_progress', 'resources': 'resources', 'tag': 'tag'} - def __init__(self, entity=None, download_progress=None, resources=None, tag=None, **unknown_fields): +class UpdateUserSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' - entity : Entity - download_progress : typing.Mapping[str, int] - resources : typing.Sequence[~Resource] - tag : str + args : typing.Sequence[~UpdateUserSecretArg] ''' - entity_ = Entity.from_json(entity) if entity else None - download_progress_ = download_progress - resources_ = [Resource.from_json(o) for o in resources or []] - tag_ = tag + args_ = [UpdateUserSecretArg.from_json(o) for o in args or []] # Validate arguments against known Juju API types. - if entity_ is not None and not isinstance(entity_, (dict, Entity)): - raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - - if download_progress_ is not None and not isinstance(download_progress_, dict): - raise Exception("Expected download_progress_ to be a Mapping, received: {}".format(type(download_progress_))) - - if resources_ is not None and not isinstance(resources_, (bytes, str, list)): - raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) - - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) - self.entity = entity_ - self.download_progress = download_progress_ - self.resources = resources_ - self.tag = tag_ + self.args = args_ self.unknown_fields = unknown_fields -class UnitResult(Type): - _toSchema = {'address': 'address', 'charm': 'charm', 'leader': 'leader', 'life': 'life', 'machine': 'machine', 'opened_ports': 'opened-ports', 'provider_id': 'provider-id', 'public_address': 'public-address', 'relation_data': 'relation-data', 'tag': 'tag', 'workload_version': 'workload-version'} - _toPy = {'address': 'address', 'charm': 'charm', 'leader': 'leader', 'life': 'life', 'machine': 'machine', 'opened-ports': 'opened_ports', 'provider-id': 'provider_id', 'public-address': 'public_address', 'relation-data': 'relation_data', 'tag': 'tag', 'workload-version': 'workload_version'} - def __init__(self, address=None, charm=None, leader=None, life=None, machine=None, opened_ports=None, provider_id=None, public_address=None, relation_data=None, tag=None, workload_version=None, **unknown_fields): +class UpgradeModelParams(Type): + _toSchema = {'agent_stream': 'agent-stream', 'dry_run': 'dry-run', 'ignore_agent_versions': 'ignore-agent-versions', 'model_tag': 'model-tag', 'target_version': 'target-version'} + _toPy = {'agent-stream': 'agent_stream', 'dry-run': 'dry_run', 'ignore-agent-versions': 'ignore_agent_versions', 'model-tag': 'model_tag', 'target-version': 'target_version'} + def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None, **unknown_fields): ''' - address : str - charm : str - leader : bool - life : str - machine : str - opened_ports : typing.Sequence[str] - provider_id : str - public_address : str - relation_data : typing.Sequence[~EndpointRelationData] - tag : str - workload_version : str + agent_stream : str + dry_run : bool + ignore_agent_versions : bool + model_tag : str + target_version : Number ''' - address_ = address - charm_ = charm - leader_ = leader - life_ = life - machine_ = machine - opened_ports_ = opened_ports - provider_id_ = provider_id - public_address_ = public_address - relation_data_ = [EndpointRelationData.from_json(o) for o in relation_data or []] - tag_ = tag - workload_version_ = workload_version + agent_stream_ = agent_stream + dry_run_ = dry_run + ignore_agent_versions_ = ignore_agent_versions + model_tag_ = model_tag + target_version_ = Number.from_json(target_version) if target_version else None # Validate arguments against known Juju API types. - if address_ is not None and not isinstance(address_, (bytes, str)): - raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + 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 charm_ is not None and not isinstance(charm_, (bytes, str)): - raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + 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 leader_ is not None and not isinstance(leader_, bool): - raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) + 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 life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + 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 machine_ is not None and not isinstance(machine_, (bytes, str)): - raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + 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_))) - if opened_ports_ is not None and not isinstance(opened_ports_, (bytes, str, list)): - raise Exception("Expected opened_ports_ to be a Sequence, received: {}".format(type(opened_ports_))) + self.agent_stream = agent_stream_ + self.dry_run = dry_run_ + self.ignore_agent_versions = ignore_agent_versions_ + self.model_tag = model_tag_ + self.target_version = target_version_ + self.unknown_fields = unknown_fields - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) - if public_address_ is not None and not isinstance(public_address_, (bytes, str)): - raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) - if relation_data_ is not None and not isinstance(relation_data_, (bytes, str, list)): - raise Exception("Expected relation_data_ to be a Sequence, received: {}".format(type(relation_data_))) +class UpgradeModelResult(Type): + _toSchema = {'chosen_version': 'chosen-version', 'error': 'error'} + _toPy = {'chosen-version': 'chosen_version', 'error': 'error'} + def __init__(self, chosen_version=None, error=None, **unknown_fields): + ''' + chosen_version : Number + error : Error + ''' + chosen_version_ = Number.from_json(chosen_version) if chosen_version else None + error_ = Error.from_json(error) if error else None - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + # Validate arguments against known Juju API types. + if chosen_version_ is not None and not isinstance(chosen_version_, (dict, Number)): + raise Exception("Expected chosen_version_ to be a Number, received: {}".format(type(chosen_version_))) - if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): - raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.address = address_ - self.charm = charm_ - self.leader = leader_ - self.life = life_ - self.machine = machine_ - self.opened_ports = opened_ports_ - self.provider_id = provider_id_ - self.public_address = public_address_ - self.relation_data = relation_data_ - self.tag = tag_ - self.workload_version = workload_version_ + self.chosen_version = chosen_version_ + self.error = error_ self.unknown_fields = unknown_fields -class UnitStatus(Type): - _toSchema = {'address': 'address', 'agent_status': 'agent-status', 'charm': 'charm', 'leader': 'leader', 'machine': 'machine', 'opened_ports': 'opened-ports', 'provider_id': 'provider-id', 'public_address': 'public-address', 'subordinates': 'subordinates', 'workload_status': 'workload-status', 'workload_version': 'workload-version'} - _toPy = {'address': 'address', 'agent-status': 'agent_status', 'charm': 'charm', 'leader': 'leader', 'machine': 'machine', 'opened-ports': 'opened_ports', 'provider-id': 'provider_id', 'public-address': 'public_address', 'subordinates': 'subordinates', 'workload-status': 'workload_status', 'workload-version': 'workload_version'} - def __init__(self, address=None, agent_status=None, charm=None, leader=None, machine=None, opened_ports=None, provider_id=None, public_address=None, subordinates=None, workload_status=None, workload_version=None, **unknown_fields): +class UpgradeSeriesNotificationParam(Type): + _toSchema = {'entity': 'entity', 'watcher_id': 'watcher-id'} + _toPy = {'entity': 'entity', 'watcher-id': 'watcher_id'} + def __init__(self, entity=None, watcher_id=None, **unknown_fields): ''' - address : str - agent_status : DetailedStatus - charm : str - leader : bool - machine : str - opened_ports : typing.Sequence[str] - provider_id : str - public_address : str - subordinates : typing.Mapping[str, ~UnitStatus] - workload_status : DetailedStatus - workload_version : str + entity : Entity + watcher_id : str ''' - address_ = address - agent_status_ = DetailedStatus.from_json(agent_status) if agent_status else None - charm_ = charm - leader_ = leader - machine_ = machine - opened_ports_ = opened_ports - provider_id_ = provider_id - public_address_ = public_address - subordinates_ = {k: UnitStatus.from_json(v) for k, v in (subordinates or dict()).items()} - workload_status_ = DetailedStatus.from_json(workload_status) if workload_status else None - workload_version_ = workload_version + entity_ = Entity.from_json(entity) if entity else None + watcher_id_ = watcher_id # Validate arguments against known Juju API types. - if address_ is not None and not isinstance(address_, (bytes, str)): - raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - if agent_status_ is not None and not isinstance(agent_status_, (dict, DetailedStatus)): - raise Exception("Expected agent_status_ to be a DetailedStatus, received: {}".format(type(agent_status_))) + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) - if charm_ is not None and not isinstance(charm_, (bytes, str)): - raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + self.entity = entity_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields - if leader_ is not None and not isinstance(leader_, bool): - raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) - if machine_ is not None and not isinstance(machine_, (bytes, str)): - raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) - if opened_ports_ is not None and not isinstance(opened_ports_, (bytes, str, list)): - raise Exception("Expected opened_ports_ to be a Sequence, received: {}".format(type(opened_ports_))) +class UpgradeSeriesNotificationParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~UpgradeSeriesNotificationParam] + ''' + params_ = [UpgradeSeriesNotificationParam.from_json(o) for o in params or []] - if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): - raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) - if public_address_ is not None and not isinstance(public_address_, (bytes, str)): - raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + self.params = params_ + self.unknown_fields = unknown_fields - if subordinates_ is not None and not isinstance(subordinates_, dict): - raise Exception("Expected subordinates_ to be a Mapping, received: {}".format(type(subordinates_))) - if workload_status_ is not None and not isinstance(workload_status_, (dict, DetailedStatus)): - raise Exception("Expected workload_status_ to be a DetailedStatus, received: {}".format(type(workload_status_))) - if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): - raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) +class UpgradeSeriesStartUnitCompletionParam(Type): + _toSchema = {'entities': 'entities', 'message': 'message'} + _toPy = {'entities': 'entities', 'message': 'message'} + def __init__(self, entities=None, message=None, **unknown_fields): + ''' + entities : typing.Sequence[~Entity] + message : str + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + message_ = message - self.address = address_ - self.agent_status = agent_status_ - self.charm = charm_ - self.leader = leader_ - self.machine = machine_ - self.opened_ports = opened_ports_ - self.provider_id = provider_id_ - self.public_address = public_address_ - self.subordinates = subordinates_ - self.workload_status = workload_status_ - self.workload_version = workload_version_ + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.entities = entities_ + self.message = message_ self.unknown_fields = unknown_fields -class UnitsResolved(Type): - _toSchema = {'all_': 'all', 'retry': 'retry', 'tags': 'tags'} - _toPy = {'all': 'all_', 'retry': 'retry', 'tags': 'tags'} - def __init__(self, all_=None, retry=None, tags=None, **unknown_fields): +class UpgradeSeriesStatusParam(Type): + _toSchema = {'entity': 'entity', 'message': 'message', 'status': 'status'} + _toPy = {'entity': 'entity', 'message': 'message', 'status': 'status'} + def __init__(self, entity=None, message=None, status=None, **unknown_fields): ''' - all_ : bool - retry : bool - tags : Entities + entity : Entity + message : str + status : str ''' - all__ = all_ - retry_ = retry - tags_ = Entities.from_json(tags) if tags else None + entity_ = Entity.from_json(entity) if entity else None + message_ = message + status_ = status # Validate arguments against known Juju API types. - if all__ is not None and not isinstance(all__, bool): - raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - if retry_ is not None and not isinstance(retry_, bool): - raise Exception("Expected retry_ to be a bool, received: {}".format(type(retry_))) + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - if tags_ is not None and not isinstance(tags_, (dict, Entities)): - raise Exception("Expected tags_ to be a Entities, received: {}".format(type(tags_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - self.all_ = all__ - self.retry = retry_ - self.tags = tags_ + self.entity = entity_ + self.message = message_ + self.status = status_ self.unknown_fields = unknown_fields -class UnsetModelDefaults(Type): - _toSchema = {'keys': 'keys'} - _toPy = {'keys': 'keys'} - def __init__(self, keys=None, **unknown_fields): +class UpgradeSeriesStatusParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' - keys : typing.Sequence[~ModelUnsetKeys] + params : typing.Sequence[~UpgradeSeriesStatusParam] ''' - keys_ = [ModelUnsetKeys.from_json(o) for o in keys or []] + params_ = [UpgradeSeriesStatusParam.from_json(o) for o in params or []] # Validate arguments against known Juju API types. - if keys_ is not None and not isinstance(keys_, (bytes, str, list)): - raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) - self.keys = keys_ + self.params = params_ self.unknown_fields = unknown_fields -class UpdateChannelArg(Type): - _toSchema = {'channel': 'channel', 'force': 'force', 'tag': 'tag'} - _toPy = {'channel': 'channel', 'force': 'force', 'tag': 'tag'} - def __init__(self, channel=None, force=None, tag=None, **unknown_fields): +class UpgradeSeriesStatusResult(Type): + _toSchema = {'error': 'error', 'status': 'status', 'target': 'target'} + _toPy = {'error': 'error', 'status': 'status', 'target': 'target'} + def __init__(self, error=None, status=None, target=None, **unknown_fields): ''' - channel : str - force : bool - tag : Entity + error : Error + status : str + target : str ''' - channel_ = channel - force_ = force - tag_ = Entity.from_json(tag) if tag else None + error_ = Error.from_json(error) if error else None + status_ = status + target_ = target # Validate arguments against known Juju API types. - if channel_ is not None and not isinstance(channel_, (bytes, str)): - raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - if tag_ is not None and not isinstance(tag_, (dict, Entity)): - raise Exception("Expected tag_ to be a Entity, received: {}".format(type(tag_))) + if target_ is not None and not isinstance(target_, (bytes, str)): + raise Exception("Expected target_ to be a str, received: {}".format(type(target_))) - self.channel = channel_ - self.force = force_ - self.tag = tag_ + self.error = error_ + self.status = status_ + self.target = target_ self.unknown_fields = unknown_fields -class UpdateChannelArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class UpgradeSeriesStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - args : typing.Sequence[~UpdateChannelArg] + results : typing.Sequence[~UpgradeSeriesStatusResult] ''' - args_ = [UpdateChannelArg.from_json(o) for o in args or []] + results_ = [UpgradeSeriesStatusResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.args = args_ + self.results = results_ self.unknown_fields = unknown_fields -class UpdateCloudArgs(Type): - _toSchema = {'clouds': 'clouds'} - _toPy = {'clouds': 'clouds'} - def __init__(self, clouds=None, **unknown_fields): +class UpgradeSeriesUnitsResult(Type): + _toSchema = {'error': 'error', 'unit_names': 'unit-names'} + _toPy = {'error': 'error', 'unit-names': 'unit_names'} + def __init__(self, error=None, unit_names=None, **unknown_fields): ''' - clouds : typing.Sequence[~AddCloudArgs] + error : Error + unit_names : typing.Sequence[str] ''' - clouds_ = [AddCloudArgs.from_json(o) for o in clouds or []] + error_ = Error.from_json(error) if error else None + unit_names_ = unit_names # Validate arguments against known Juju API types. - if clouds_ is not None and not isinstance(clouds_, (bytes, str, list)): - raise Exception("Expected clouds_ to be a Sequence, received: {}".format(type(clouds_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.clouds = clouds_ + if unit_names_ is not None and not isinstance(unit_names_, (bytes, str, list)): + raise Exception("Expected unit_names_ to be a Sequence, received: {}".format(type(unit_names_))) + + self.error = error_ + self.unit_names = unit_names_ self.unknown_fields = unknown_fields -class UpdateCredentialArgs(Type): - _toSchema = {'credentials': 'credentials', 'force': 'force'} - _toPy = {'credentials': 'credentials', 'force': 'force'} - def __init__(self, credentials=None, force=None, **unknown_fields): +class UpgradeSeriesUnitsResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - credentials : typing.Sequence[~TaggedCredential] - force : bool + results : typing.Sequence[~UpgradeSeriesUnitsResult] ''' - credentials_ = [TaggedCredential.from_json(o) for o in credentials or []] - force_ = force + results_ = [UpgradeSeriesUnitsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): - raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class UpsertSecretArg(Type): + _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy'} + _toPy = {'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy'} + def __init__(self, content=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, **unknown_fields): + ''' + content : SecretContentParams + description : str + expire_time : str + label : str + params : typing.Mapping[str, typing.Any] + rotate_policy : str + ''' + content_ = SecretContentParams.from_json(content) if content else None + description_ = description + expire_time_ = expire_time + label_ = label + params_ = params + rotate_policy_ = rotate_policy + + # Validate arguments against known Juju API types. + if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): + raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) + + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) - self.credentials = credentials_ - self.force = force_ + self.content = content_ + self.description = description_ + self.expire_time = expire_time_ + self.label = label_ + self.params = params_ + self.rotate_policy = rotate_policy_ self.unknown_fields = unknown_fields -class UpdateCredentialModelResult(Type): - _toSchema = {'errors': 'errors', 'name': 'name', 'uuid': 'uuid'} - _toPy = {'errors': 'errors', 'name': 'name', 'uuid': 'uuid'} - def __init__(self, errors=None, name=None, uuid=None, **unknown_fields): +class UserAccess(Type): + _toSchema = {'access': 'access', 'user_tag': 'user-tag'} + _toPy = {'access': 'access', 'user-tag': 'user_tag'} + def __init__(self, access=None, user_tag=None, **unknown_fields): ''' - errors : typing.Sequence[~ErrorResult] - name : str - uuid : str + access : str + user_tag : str ''' - errors_ = [ErrorResult.from_json(o) for o in errors or []] - name_ = name - uuid_ = uuid + access_ = access + user_tag_ = user_tag # Validate arguments against known Juju API types. - if errors_ is not None and not isinstance(errors_, (bytes, str, list)): - raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - if uuid_ is not None and not isinstance(uuid_, (bytes, str)): - raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) - self.errors = errors_ - self.name = name_ - self.uuid = uuid_ + self.access = access_ + self.user_tag = user_tag_ self.unknown_fields = unknown_fields -class UpdateCredentialResult(Type): - _toSchema = {'error': 'error', 'models': 'models', 'tag': 'tag'} - _toPy = {'error': 'error', 'models': 'models', 'tag': 'tag'} - def __init__(self, error=None, models=None, tag=None, **unknown_fields): +class UserAccessResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - models : typing.Sequence[~UpdateCredentialModelResult] - tag : str + result : UserAccess ''' error_ = Error.from_json(error) if error else None - models_ = [UpdateCredentialModelResult.from_json(o) for o in models or []] - tag_ = tag + result_ = UserAccess.from_json(result) if result else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if models_ is not None and not isinstance(models_, (bytes, str, list)): - raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) - - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if result_ is not None and not isinstance(result_, (dict, UserAccess)): + raise Exception("Expected result_ to be a UserAccess, received: {}".format(type(result_))) self.error = error_ - self.models = models_ - self.tag = tag_ + self.result = result_ self.unknown_fields = unknown_fields -class UpdateCredentialResults(Type): +class UserAccessResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~UpdateCredentialResult] + results : typing.Sequence[~UserAccessResult] ''' - results_ = [UpdateCredentialResult.from_json(o) for o in results or []] + results_ = [UserAccessResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -15106,416 +26650,362 @@ def __init__(self, results=None, **unknown_fields): -class UpdateSecretBackendArg(Type): - _toSchema = {'config': 'config', 'force': 'force', 'name': 'name', 'name_change': 'name-change', 'reset': 'reset', 'token_rotate_interval': 'token-rotate-interval'} - _toPy = {'config': 'config', 'force': 'force', 'name': 'name', 'name-change': 'name_change', 'reset': 'reset', 'token-rotate-interval': 'token_rotate_interval'} - def __init__(self, config=None, force=None, name=None, name_change=None, reset=None, token_rotate_interval=None, **unknown_fields): +class UserCloud(Type): + _toSchema = {'cloud_tag': 'cloud-tag', 'user_tag': 'user-tag'} + _toPy = {'cloud-tag': 'cloud_tag', 'user-tag': 'user_tag'} + def __init__(self, cloud_tag=None, user_tag=None, **unknown_fields): ''' - config : typing.Mapping[str, typing.Any] - force : bool - name : str - name_change : str - reset : typing.Sequence[str] - token_rotate_interval : int + cloud_tag : str + user_tag : str ''' - config_ = config - force_ = force - name_ = name - name_change_ = name_change - reset_ = reset - token_rotate_interval_ = token_rotate_interval + cloud_tag_ = cloud_tag + user_tag_ = user_tag # Validate arguments against known Juju API types. - if config_ is not None and not isinstance(config_, dict): - raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) - - if force_ is not None and not isinstance(force_, bool): - raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) - - if name_ is not None and not isinstance(name_, (bytes, str)): - raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) - - if name_change_ is not None and not isinstance(name_change_, (bytes, str)): - raise Exception("Expected name_change_ to be a str, received: {}".format(type(name_change_))) - - if reset_ is not None and not isinstance(reset_, (bytes, str, list)): - raise Exception("Expected reset_ to be a Sequence, received: {}".format(type(reset_))) + if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): + raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) - if token_rotate_interval_ is not None and not isinstance(token_rotate_interval_, int): - raise Exception("Expected token_rotate_interval_ to be a int, received: {}".format(type(token_rotate_interval_))) + if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): + raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) - self.config = config_ - self.force = force_ - self.name = name_ - self.name_change = name_change_ - self.reset = reset_ - self.token_rotate_interval = token_rotate_interval_ + self.cloud_tag = cloud_tag_ + self.user_tag = user_tag_ self.unknown_fields = unknown_fields -class UpdateSecretBackendArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): +class UserClouds(Type): + _toSchema = {'user_clouds': 'user-clouds'} + _toPy = {'user-clouds': 'user_clouds'} + def __init__(self, user_clouds=None, **unknown_fields): ''' - args : typing.Sequence[~UpdateSecretBackendArg] + user_clouds : typing.Sequence[~UserCloud] ''' - args_ = [UpdateSecretBackendArg.from_json(o) for o in args or []] + user_clouds_ = [UserCloud.from_json(o) for o in user_clouds or []] # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if user_clouds_ is not None and not isinstance(user_clouds_, (bytes, str, list)): + raise Exception("Expected user_clouds_ to be a Sequence, received: {}".format(type(user_clouds_))) - self.args = args_ + self.user_clouds = user_clouds_ self.unknown_fields = unknown_fields -class UpdateUserSecretArg(Type): - _toSchema = {'auto_prune': 'auto-prune', 'content': 'content', 'description': 'description', 'existing_label': 'existing-label', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} - _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'auto-prune': 'auto_prune', 'content': 'content', 'description': 'description', 'existing-label': 'existing_label', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} - def __init__(self, upsertsecretarg=None, auto_prune=None, content=None, description=None, existing_label=None, expire_time=None, label=None, params=None, rotate_policy=None, uri=None, **unknown_fields): +class UserInfo(Type): + _toSchema = {'access': 'access', 'created_by': 'created-by', 'date_created': 'date-created', 'disabled': 'disabled', 'display_name': 'display-name', 'last_connection': 'last-connection', 'username': 'username'} + _toPy = {'access': 'access', 'created-by': 'created_by', 'date-created': 'date_created', 'disabled': 'disabled', 'display-name': 'display_name', 'last-connection': 'last_connection', 'username': 'username'} + def __init__(self, access=None, created_by=None, date_created=None, disabled=None, display_name=None, last_connection=None, username=None, **unknown_fields): ''' - upsertsecretarg : UpsertSecretArg - auto_prune : bool - content : SecretContentParams - description : str - existing_label : str - expire_time : str - label : str - params : typing.Mapping[str, typing.Any] - rotate_policy : str - uri : str + access : str + created_by : str + date_created : str + disabled : bool + display_name : str + last_connection : str + username : str ''' - upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None - auto_prune_ = auto_prune - content_ = SecretContentParams.from_json(content) if content else None - description_ = description - existing_label_ = existing_label - expire_time_ = expire_time - label_ = label - params_ = params - rotate_policy_ = rotate_policy - uri_ = uri + access_ = access + created_by_ = created_by + date_created_ = date_created + disabled_ = disabled + display_name_ = display_name + last_connection_ = last_connection + username_ = username # Validate arguments against known Juju API types. - if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): - raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) - - if auto_prune_ is not None and not isinstance(auto_prune_, bool): - raise Exception("Expected auto_prune_ to be a bool, received: {}".format(type(auto_prune_))) - - if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): - raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) - - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) - - if existing_label_ is not None and not isinstance(existing_label_, (bytes, str)): - raise Exception("Expected existing_label_ to be a str, received: {}".format(type(existing_label_))) - - if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): - raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) - - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - - if params_ is not None and not isinstance(params_, dict): - raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - - if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): - raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - if uri_ is not None and not isinstance(uri_, (bytes, str)): - raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + if created_by_ is not None and not isinstance(created_by_, (bytes, str)): + raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) - self.upsertsecretarg = upsertsecretarg_ - self.auto_prune = auto_prune_ - self.content = content_ - self.description = description_ - self.existing_label = existing_label_ - self.expire_time = expire_time_ - self.label = label_ - self.params = params_ - self.rotate_policy = rotate_policy_ - self.uri = uri_ - self.unknown_fields = unknown_fields + if date_created_ is not None and not isinstance(date_created_, (bytes, str)): + raise Exception("Expected date_created_ to be a str, received: {}".format(type(date_created_))) + if disabled_ is not None and not isinstance(disabled_, bool): + raise Exception("Expected disabled_ to be a bool, received: {}".format(type(disabled_))) + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) -class UpdateUserSecretArgs(Type): - _toSchema = {'args': 'args'} - _toPy = {'args': 'args'} - def __init__(self, args=None, **unknown_fields): - ''' - args : typing.Sequence[~UpdateUserSecretArg] - ''' - args_ = [UpdateUserSecretArg.from_json(o) for o in args or []] + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) - # Validate arguments against known Juju API types. - if args_ is not None and not isinstance(args_, (bytes, str, list)): - raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) - self.args = args_ + self.access = access_ + self.created_by = created_by_ + self.date_created = date_created_ + self.disabled = disabled_ + self.display_name = display_name_ + self.last_connection = last_connection_ + self.username = username_ self.unknown_fields = unknown_fields -class UpgradeModelParams(Type): - _toSchema = {'agent_stream': 'agent-stream', 'dry_run': 'dry-run', 'ignore_agent_versions': 'ignore-agent-versions', 'model_tag': 'model-tag', 'target_version': 'target-version'} - _toPy = {'agent-stream': 'agent_stream', 'dry-run': 'dry_run', 'ignore-agent-versions': 'ignore_agent_versions', 'model-tag': 'model_tag', 'target-version': 'target_version'} - def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None, **unknown_fields): +class UserInfoRequest(Type): + _toSchema = {'entities': 'entities', 'include_disabled': 'include-disabled'} + _toPy = {'entities': 'entities', 'include-disabled': 'include_disabled'} + def __init__(self, entities=None, include_disabled=None, **unknown_fields): ''' - agent_stream : str - dry_run : bool - ignore_agent_versions : bool - model_tag : str - target_version : Number + entities : typing.Sequence[~Entity] + include_disabled : bool ''' - agent_stream_ = agent_stream - dry_run_ = dry_run - ignore_agent_versions_ = ignore_agent_versions - model_tag_ = model_tag - target_version_ = Number.from_json(target_version) if target_version else None + entities_ = [Entity.from_json(o) for o in entities or []] + include_disabled_ = include_disabled # Validate arguments against known Juju API types. - if agent_stream_ is not None and not isinstance(agent_stream_, (bytes, str)): - raise Exception("Expected agent_stream_ to be a str, received: {}".format(type(agent_stream_))) - - if dry_run_ is not None and not isinstance(dry_run_, bool): - raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) - - if ignore_agent_versions_ is not None and not isinstance(ignore_agent_versions_, bool): - raise Exception("Expected ignore_agent_versions_ to be a bool, received: {}".format(type(ignore_agent_versions_))) - - if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): - raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) - if target_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_))) + if include_disabled_ is not None and not isinstance(include_disabled_, bool): + raise Exception("Expected include_disabled_ to be a bool, received: {}".format(type(include_disabled_))) - self.agent_stream = agent_stream_ - self.dry_run = dry_run_ - self.ignore_agent_versions = ignore_agent_versions_ - self.model_tag = model_tag_ - self.target_version = target_version_ + self.entities = entities_ + self.include_disabled = include_disabled_ self.unknown_fields = unknown_fields -class UpgradeModelResult(Type): - _toSchema = {'chosen_version': 'chosen-version', 'error': 'error'} - _toPy = {'chosen-version': 'chosen_version', 'error': 'error'} - def __init__(self, chosen_version=None, error=None, **unknown_fields): +class UserInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - chosen_version : Number error : Error + result : UserInfo ''' - chosen_version_ = Number.from_json(chosen_version) if chosen_version else None error_ = Error.from_json(error) if error else None + result_ = UserInfo.from_json(result) if result else None # Validate arguments against known Juju API types. - if chosen_version_ is not None and not isinstance(chosen_version_, (dict, Number)): - raise Exception("Expected chosen_version_ to be a Number, received: {}".format(type(chosen_version_))) - if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - self.chosen_version = chosen_version_ + if result_ is not None and not isinstance(result_, (dict, UserInfo)): + raise Exception("Expected result_ to be a UserInfo, received: {}".format(type(result_))) + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class UpgradeSeriesNotificationParam(Type): - _toSchema = {'entity': 'entity', 'watcher_id': 'watcher-id'} - _toPy = {'entity': 'entity', 'watcher-id': 'watcher_id'} - def __init__(self, entity=None, watcher_id=None, **unknown_fields): +class UserInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - entity : Entity - watcher_id : str + results : typing.Sequence[~UserInfoResult] ''' - entity_ = Entity.from_json(entity) if entity else None - watcher_id_ = watcher_id + results_ = [UserInfoResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if entity_ is not None and not isinstance(entity_, (dict, Entity)): - raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) - - if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): - raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - self.entity = entity_ - self.watcher_id = watcher_id_ + self.results = results_ self.unknown_fields = unknown_fields -class UpgradeSeriesNotificationParams(Type): - _toSchema = {'params': 'params'} - _toPy = {'params': 'params'} - def __init__(self, params=None, **unknown_fields): +class UserModel(Type): + _toSchema = {'last_connection': 'last-connection', 'model': 'model'} + _toPy = {'last-connection': 'last_connection', 'model': 'model'} + def __init__(self, last_connection=None, model=None, **unknown_fields): ''' - params : typing.Sequence[~UpgradeSeriesNotificationParam] + last_connection : str + model : Model ''' - params_ = [UpgradeSeriesNotificationParam.from_json(o) for o in params or []] + last_connection_ = last_connection + model_ = Model.from_json(model) if model else None # Validate arguments against known Juju API types. - if params_ is not None and not isinstance(params_, (bytes, str, list)): - raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) - self.params = params_ + if model_ is not None and not isinstance(model_, (dict, Model)): + raise Exception("Expected model_ to be a Model, received: {}".format(type(model_))) + + self.last_connection = last_connection_ + self.model = model_ self.unknown_fields = unknown_fields -class UpgradeSeriesUnitsResult(Type): - _toSchema = {'error': 'error', 'unit_names': 'unit-names'} - _toPy = {'error': 'error', 'unit-names': 'unit_names'} - def __init__(self, error=None, unit_names=None, **unknown_fields): +class UserModelList(Type): + _toSchema = {'user_models': 'user-models'} + _toPy = {'user-models': 'user_models'} + def __init__(self, user_models=None, **unknown_fields): ''' - error : Error - unit_names : typing.Sequence[str] + user_models : typing.Sequence[~UserModel] ''' - error_ = Error.from_json(error) if error else None - unit_names_ = unit_names + user_models_ = [UserModel.from_json(o) for o in user_models or []] # Validate arguments against known Juju API types. - if error_ is not None and not isinstance(error_, (dict, Error)): - raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - - if unit_names_ is not None and not isinstance(unit_names_, (bytes, str, list)): - raise Exception("Expected unit_names_ to be a Sequence, received: {}".format(type(unit_names_))) + if user_models_ is not None and not isinstance(user_models_, (bytes, str, list)): + raise Exception("Expected user_models_ to be a Sequence, received: {}".format(type(user_models_))) - self.error = error_ - self.unit_names = unit_names_ + self.user_models = user_models_ self.unknown_fields = unknown_fields -class UpgradeSeriesUnitsResults(Type): - _toSchema = {'results': 'Results'} - _toPy = {'Results': 'results'} - def __init__(self, results=None, **unknown_fields): +class Value(Type): + _toSchema = {'allocate_public_ip': 'allocate-public-ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu_power': 'cpu-power', 'image_id': 'image-id', 'instance_role': 'instance-role', 'instance_type': 'instance-type', 'mem': 'mem', 'root_disk': 'root-disk', 'root_disk_source': 'root-disk-source', 'spaces': 'spaces', 'tags': 'tags', 'virt_type': 'virt-type', 'zones': 'zones'} + _toPy = {'allocate-public-ip': 'allocate_public_ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu-power': 'cpu_power', 'image-id': 'image_id', 'instance-role': 'instance_role', 'instance-type': 'instance_type', 'mem': 'mem', 'root-disk': 'root_disk', 'root-disk-source': 'root_disk_source', 'spaces': 'spaces', 'tags': 'tags', 'virt-type': 'virt_type', 'zones': 'zones'} + def __init__(self, allocate_public_ip=None, arch=None, container=None, cores=None, cpu_power=None, image_id=None, instance_role=None, instance_type=None, mem=None, root_disk=None, root_disk_source=None, spaces=None, tags=None, virt_type=None, zones=None, **unknown_fields): ''' - results : typing.Sequence[~UpgradeSeriesUnitsResult] + allocate_public_ip : bool + arch : str + container : str + cores : int + cpu_power : int + image_id : str + instance_role : str + instance_type : str + mem : int + root_disk : int + root_disk_source : str + spaces : typing.Sequence[str] + tags : typing.Sequence[str] + virt_type : str + zones : typing.Sequence[str] ''' - results_ = [UpgradeSeriesUnitsResult.from_json(o) for o in results or []] + allocate_public_ip_ = allocate_public_ip + arch_ = arch + container_ = container + cores_ = cores + cpu_power_ = cpu_power + image_id_ = image_id + instance_role_ = instance_role + instance_type_ = instance_type + mem_ = mem + root_disk_ = root_disk + root_disk_source_ = root_disk_source + spaces_ = spaces + tags_ = tags + virt_type_ = virt_type + zones_ = zones # Validate arguments against known Juju API types. - if results_ is not None and not isinstance(results_, (bytes, str, list)): - raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + if allocate_public_ip_ is not None and not isinstance(allocate_public_ip_, bool): + raise Exception("Expected allocate_public_ip_ to be a bool, received: {}".format(type(allocate_public_ip_))) - self.results = results_ - self.unknown_fields = unknown_fields + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if container_ is not None and not isinstance(container_, (bytes, str)): + raise Exception("Expected container_ to be a str, received: {}".format(type(container_))) + if cores_ is not None and not isinstance(cores_, int): + raise Exception("Expected cores_ to be a int, received: {}".format(type(cores_))) + if cpu_power_ is not None and not isinstance(cpu_power_, int): + raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) -class UpsertSecretArg(Type): - _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy'} - _toPy = {'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy'} - def __init__(self, content=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, **unknown_fields): - ''' - content : SecretContentParams - description : str - expire_time : str - label : str - params : typing.Mapping[str, typing.Any] - rotate_policy : str - ''' - content_ = SecretContentParams.from_json(content) if content else None - description_ = description - expire_time_ = expire_time - label_ = label - params_ = params - rotate_policy_ = rotate_policy + if image_id_ is not None and not isinstance(image_id_, (bytes, str)): + raise Exception("Expected image_id_ to be a str, received: {}".format(type(image_id_))) - # Validate arguments against known Juju API types. - if content_ is not None and not isinstance(content_, (dict, SecretContentParams)): - raise Exception("Expected content_ to be a SecretContentParams, received: {}".format(type(content_))) + if instance_role_ is not None and not isinstance(instance_role_, (bytes, str)): + raise Exception("Expected instance_role_ to be a str, received: {}".format(type(instance_role_))) - if description_ is not None and not isinstance(description_, (bytes, str)): - raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + if instance_type_ is not None and not isinstance(instance_type_, (bytes, str)): + raise Exception("Expected instance_type_ to be a str, received: {}".format(type(instance_type_))) - if expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): - raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) + if mem_ is not None and not isinstance(mem_, int): + raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) - if label_ is not None and not isinstance(label_, (bytes, str)): - raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) - if params_ is not None and not isinstance(params_, dict): - raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + if root_disk_source_ is not None and not isinstance(root_disk_source_, (bytes, str)): + raise Exception("Expected root_disk_source_ to be a str, received: {}".format(type(root_disk_source_))) - if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): - raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) + if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) - self.content = content_ - self.description = description_ - self.expire_time = expire_time_ - self.label = label_ - self.params = params_ - self.rotate_policy = rotate_policy_ + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + if virt_type_ is not None and not isinstance(virt_type_, (bytes, str)): + raise Exception("Expected virt_type_ to be a str, received: {}".format(type(virt_type_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.allocate_public_ip = allocate_public_ip_ + self.arch = arch_ + self.container = container_ + self.cores = cores_ + self.cpu_power = cpu_power_ + self.image_id = image_id_ + self.instance_role = instance_role_ + self.instance_type = instance_type_ + self.mem = mem_ + self.root_disk = root_disk_ + self.root_disk_source = root_disk_source_ + self.spaces = spaces_ + self.tags = tags_ + self.virt_type = virt_type_ + self.zones = zones_ self.unknown_fields = unknown_fields -class UserAccess(Type): - _toSchema = {'access': 'access', 'user_tag': 'user-tag'} - _toPy = {'access': 'access', 'user-tag': 'user_tag'} - def __init__(self, access=None, user_tag=None, **unknown_fields): +class Version(Type): + _toSchema = {'version': 'version'} + _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): ''' - access : str - user_tag : str + version : Binary ''' - access_ = access - user_tag_ = user_tag + version_ = Binary.from_json(version) if version else None # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) - - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if version_ is not None and not isinstance(version_, (dict, Binary)): + raise Exception("Expected version_ to be a Binary, received: {}".format(type(version_))) - self.access = access_ - self.user_tag = user_tag_ + self.version = version_ self.unknown_fields = unknown_fields -class UserAccessResult(Type): - _toSchema = {'error': 'error', 'result': 'result'} - _toPy = {'error': 'error', 'result': 'result'} - def __init__(self, error=None, result=None, **unknown_fields): +class VersionResult(Type): + _toSchema = {'error': 'error', 'version': 'version'} + _toPy = {'error': 'error', 'version': 'version'} + def __init__(self, error=None, version=None, **unknown_fields): ''' error : Error - result : UserAccess + version : Number ''' error_ = Error.from_json(error) if error else None - result_ = UserAccess.from_json(result) if result else None + version_ = Number.from_json(version) if version else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, UserAccess)): - raise Exception("Expected result_ to be a UserAccess, received: {}".format(type(result_))) + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) self.error = error_ - self.result = result_ + self.version = version_ self.unknown_fields = unknown_fields -class UserAccessResults(Type): +class VersionResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~UserAccessResult] + results : typing.Sequence[~VersionResult] ''' - results_ = [UserAccessResult.from_json(o) for o in results or []] + results_ = [VersionResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -15526,143 +27016,221 @@ def __init__(self, results=None, **unknown_fields): -class UserCloud(Type): - _toSchema = {'cloud_tag': 'cloud-tag', 'user_tag': 'user-tag'} - _toPy = {'cloud-tag': 'cloud_tag', 'user-tag': 'user_tag'} - def __init__(self, cloud_tag=None, user_tag=None, **unknown_fields): +class Volume(Type): + _toSchema = {'info': 'info', 'volume_tag': 'volume-tag'} + _toPy = {'info': 'info', 'volume-tag': 'volume_tag'} + def __init__(self, info=None, volume_tag=None, **unknown_fields): ''' - cloud_tag : str - user_tag : str + info : VolumeInfo + volume_tag : str ''' - cloud_tag_ = cloud_tag - user_tag_ = user_tag + info_ = VolumeInfo.from_json(info) if info else None + volume_tag_ = volume_tag # Validate arguments against known Juju API types. - if cloud_tag_ is not None and not isinstance(cloud_tag_, (bytes, str)): - raise Exception("Expected cloud_tag_ to be a str, received: {}".format(type(cloud_tag_))) + if info_ is not None and not isinstance(info_, (dict, VolumeInfo)): + raise Exception("Expected info_ to be a VolumeInfo, received: {}".format(type(info_))) - if user_tag_ is not None and not isinstance(user_tag_, (bytes, str)): - raise Exception("Expected user_tag_ to be a str, received: {}".format(type(user_tag_))) + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) - self.cloud_tag = cloud_tag_ - self.user_tag = user_tag_ + self.info = info_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class UserClouds(Type): - _toSchema = {'user_clouds': 'user-clouds'} - _toPy = {'user-clouds': 'user_clouds'} - def __init__(self, user_clouds=None, **unknown_fields): +class VolumeAttachment(Type): + _toSchema = {'info': 'info', 'machine_tag': 'machine-tag', 'volume_tag': 'volume-tag'} + _toPy = {'info': 'info', 'machine-tag': 'machine_tag', 'volume-tag': 'volume_tag'} + def __init__(self, info=None, machine_tag=None, volume_tag=None, **unknown_fields): ''' - user_clouds : typing.Sequence[~UserCloud] + info : VolumeAttachmentInfo + machine_tag : str + volume_tag : str ''' - user_clouds_ = [UserCloud.from_json(o) for o in user_clouds or []] + info_ = VolumeAttachmentInfo.from_json(info) if info else None + machine_tag_ = machine_tag + volume_tag_ = volume_tag # Validate arguments against known Juju API types. - if user_clouds_ is not None and not isinstance(user_clouds_, (bytes, str, list)): - raise Exception("Expected user_clouds_ to be a Sequence, received: {}".format(type(user_clouds_))) + if info_ is not None and not isinstance(info_, (dict, VolumeAttachmentInfo)): + raise Exception("Expected info_ to be a VolumeAttachmentInfo, received: {}".format(type(info_))) - self.user_clouds = user_clouds_ + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.info = info_ + self.machine_tag = machine_tag_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class UserInfo(Type): - _toSchema = {'access': 'access', 'created_by': 'created-by', 'date_created': 'date-created', 'disabled': 'disabled', 'display_name': 'display-name', 'last_connection': 'last-connection', 'username': 'username'} - _toPy = {'access': 'access', 'created-by': 'created_by', 'date-created': 'date_created', 'disabled': 'disabled', 'display-name': 'display_name', 'last-connection': 'last_connection', 'username': 'username'} - def __init__(self, access=None, created_by=None, date_created=None, disabled=None, display_name=None, last_connection=None, username=None, **unknown_fields): +class VolumeAttachmentDetails(Type): + _toSchema = {'bus_address': 'bus-address', 'device_link': 'device-link', 'device_name': 'device-name', 'life': 'life', 'plan_info': 'plan-info', 'read_only': 'read-only', 'volumeattachmentinfo': 'VolumeAttachmentInfo'} + _toPy = {'VolumeAttachmentInfo': 'volumeattachmentinfo', 'bus-address': 'bus_address', 'device-link': 'device_link', 'device-name': 'device_name', 'life': 'life', 'plan-info': 'plan_info', 'read-only': 'read_only'} + def __init__(self, volumeattachmentinfo=None, bus_address=None, device_link=None, device_name=None, life=None, plan_info=None, read_only=None, **unknown_fields): ''' - access : str - created_by : str - date_created : str - disabled : bool - display_name : str - last_connection : str - username : str + volumeattachmentinfo : VolumeAttachmentInfo + bus_address : str + device_link : str + device_name : str + life : str + plan_info : VolumeAttachmentPlanInfo + read_only : bool ''' - access_ = access - created_by_ = created_by - date_created_ = date_created - disabled_ = disabled - display_name_ = display_name - last_connection_ = last_connection - username_ = username + volumeattachmentinfo_ = VolumeAttachmentInfo.from_json(volumeattachmentinfo) if volumeattachmentinfo else None + bus_address_ = bus_address + device_link_ = device_link + device_name_ = device_name + life_ = life + plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None + read_only_ = read_only # Validate arguments against known Juju API types. - if access_ is not None and not isinstance(access_, (bytes, str)): - raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + if volumeattachmentinfo_ is not None and not isinstance(volumeattachmentinfo_, (dict, VolumeAttachmentInfo)): + raise Exception("Expected volumeattachmentinfo_ to be a VolumeAttachmentInfo, received: {}".format(type(volumeattachmentinfo_))) - if created_by_ is not None and not isinstance(created_by_, (bytes, str)): - raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) + if bus_address_ is not None and not isinstance(bus_address_, (bytes, str)): + raise Exception("Expected bus_address_ to be a str, received: {}".format(type(bus_address_))) - if date_created_ is not None and not isinstance(date_created_, (bytes, str)): - raise Exception("Expected date_created_ to be a str, received: {}".format(type(date_created_))) + if device_link_ is not None and not isinstance(device_link_, (bytes, str)): + raise Exception("Expected device_link_ to be a str, received: {}".format(type(device_link_))) - if disabled_ is not None and not isinstance(disabled_, bool): - raise Exception("Expected disabled_ to be a bool, received: {}".format(type(disabled_))) + if device_name_ is not None and not isinstance(device_name_, (bytes, str)): + raise Exception("Expected device_name_ to be a str, received: {}".format(type(device_name_))) - if display_name_ is not None and not isinstance(display_name_, (bytes, str)): - raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): - raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): + raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) - if username_ is not None and not isinstance(username_, (bytes, str)): - raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) - self.access = access_ - self.created_by = created_by_ - self.date_created = date_created_ - self.disabled = disabled_ - self.display_name = display_name_ - self.last_connection = last_connection_ - self.username = username_ + self.volumeattachmentinfo = volumeattachmentinfo_ + self.bus_address = bus_address_ + self.device_link = device_link_ + self.device_name = device_name_ + self.life = life_ + self.plan_info = plan_info_ + self.read_only = read_only_ self.unknown_fields = unknown_fields -class UserInfoRequest(Type): - _toSchema = {'entities': 'entities', 'include_disabled': 'include-disabled'} - _toPy = {'entities': 'entities', 'include-disabled': 'include_disabled'} - def __init__(self, entities=None, include_disabled=None, **unknown_fields): +class VolumeAttachmentInfo(Type): + _toSchema = {'bus_address': 'bus-address', 'device_link': 'device-link', 'device_name': 'device-name', 'plan_info': 'plan-info', 'read_only': 'read-only'} + _toPy = {'bus-address': 'bus_address', 'device-link': 'device_link', 'device-name': 'device_name', 'plan-info': 'plan_info', 'read-only': 'read_only'} + def __init__(self, bus_address=None, device_link=None, device_name=None, plan_info=None, read_only=None, **unknown_fields): ''' - entities : typing.Sequence[~Entity] - include_disabled : bool + bus_address : str + device_link : str + device_name : str + plan_info : VolumeAttachmentPlanInfo + read_only : bool ''' - entities_ = [Entity.from_json(o) for o in entities or []] - include_disabled_ = include_disabled + bus_address_ = bus_address + device_link_ = device_link + device_name_ = device_name + plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None + read_only_ = read_only # Validate arguments against known Juju API types. - if entities_ is not None and not isinstance(entities_, (bytes, str, list)): - raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + if bus_address_ is not None and not isinstance(bus_address_, (bytes, str)): + raise Exception("Expected bus_address_ to be a str, received: {}".format(type(bus_address_))) + + if device_link_ is not None and not isinstance(device_link_, (bytes, str)): + raise Exception("Expected device_link_ to be a str, received: {}".format(type(device_link_))) + + if device_name_ is not None and not isinstance(device_name_, (bytes, str)): + raise Exception("Expected device_name_ to be a str, received: {}".format(type(device_name_))) + + if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): + raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.bus_address = bus_address_ + self.device_link = device_link_ + self.device_name = device_name_ + self.plan_info = plan_info_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +class VolumeAttachmentParams(Type): + _toSchema = {'instance_id': 'instance-id', 'machine_tag': 'machine-tag', 'provider': 'provider', 'read_only': 'read-only', 'volume_id': 'volume-id', 'volume_tag': 'volume-tag'} + _toPy = {'instance-id': 'instance_id', 'machine-tag': 'machine_tag', 'provider': 'provider', 'read-only': 'read_only', 'volume-id': 'volume_id', 'volume-tag': 'volume_tag'} + def __init__(self, instance_id=None, machine_tag=None, provider=None, read_only=None, volume_id=None, volume_tag=None, **unknown_fields): + ''' + instance_id : str + machine_tag : str + provider : str + read_only : bool + volume_id : str + volume_tag : str + ''' + instance_id_ = instance_id + machine_tag_ = machine_tag + provider_ = provider + read_only_ = read_only + volume_id_ = volume_id + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) - if include_disabled_ is not None and not isinstance(include_disabled_, bool): - raise Exception("Expected include_disabled_ to be a bool, received: {}".format(type(include_disabled_))) + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) - self.entities = entities_ - self.include_disabled = include_disabled_ + self.instance_id = instance_id_ + self.machine_tag = machine_tag_ + self.provider = provider_ + self.read_only = read_only_ + self.volume_id = volume_id_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class UserInfoResult(Type): +class VolumeAttachmentParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - result : UserInfo + result : VolumeAttachmentParams ''' error_ = Error.from_json(error) if error else None - result_ = UserInfo.from_json(result) if result else None + result_ = VolumeAttachmentParams.from_json(result) if result else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, UserInfo)): - raise Exception("Expected result_ to be a UserInfo, received: {}".format(type(result_))) + if result_ is not None and not isinstance(result_, (dict, VolumeAttachmentParams)): + raise Exception("Expected result_ to be a VolumeAttachmentParams, received: {}".format(type(result_))) self.error = error_ self.result = result_ @@ -15670,14 +27238,14 @@ def __init__(self, error=None, result=None, **unknown_fields): -class UserInfoResults(Type): +class VolumeAttachmentParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} def __init__(self, results=None, **unknown_fields): ''' - results : typing.Sequence[~UserInfoResult] + results : typing.Sequence[~VolumeAttachmentParamsResult] ''' - results_ = [UserInfoResult.from_json(o) for o in results or []] + results_ = [VolumeAttachmentParamsResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. if results_ is not None and not isinstance(results_, (bytes, str, list)): @@ -15688,266 +27256,188 @@ def __init__(self, results=None, **unknown_fields): -class UserModel(Type): - _toSchema = {'last_connection': 'last-connection', 'model': 'model'} - _toPy = {'last-connection': 'last_connection', 'model': 'model'} - def __init__(self, last_connection=None, model=None, **unknown_fields): +class VolumeAttachmentPlan(Type): + _toSchema = {'block_device': 'block-device', 'life': 'life', 'machine_tag': 'machine-tag', 'plan_info': 'plan-info', 'volume_tag': 'volume-tag'} + _toPy = {'block-device': 'block_device', 'life': 'life', 'machine-tag': 'machine_tag', 'plan-info': 'plan_info', 'volume-tag': 'volume_tag'} + def __init__(self, block_device=None, life=None, machine_tag=None, plan_info=None, volume_tag=None, **unknown_fields): ''' - last_connection : str - model : Model + block_device : BlockDevice + life : str + machine_tag : str + plan_info : VolumeAttachmentPlanInfo + volume_tag : str ''' - last_connection_ = last_connection - model_ = Model.from_json(model) if model else None + block_device_ = BlockDevice.from_json(block_device) if block_device else None + life_ = life + machine_tag_ = machine_tag + plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None + volume_tag_ = volume_tag # Validate arguments against known Juju API types. - if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): - raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) - - if model_ is not None and not isinstance(model_, (dict, Model)): - raise Exception("Expected model_ to be a Model, received: {}".format(type(model_))) - - self.last_connection = last_connection_ - self.model = model_ - self.unknown_fields = unknown_fields + if block_device_ is not None and not isinstance(block_device_, (dict, BlockDevice)): + raise Exception("Expected block_device_ to be a BlockDevice, received: {}".format(type(block_device_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) -class UserModelList(Type): - _toSchema = {'user_models': 'user-models'} - _toPy = {'user-models': 'user_models'} - def __init__(self, user_models=None, **unknown_fields): - ''' - user_models : typing.Sequence[~UserModel] - ''' - user_models_ = [UserModel.from_json(o) for o in user_models or []] + if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): + raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) - # Validate arguments against known Juju API types. - if user_models_ is not None and not isinstance(user_models_, (bytes, str, list)): - raise Exception("Expected user_models_ to be a Sequence, received: {}".format(type(user_models_))) + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) - self.user_models = user_models_ + self.block_device = block_device_ + self.life = life_ + self.machine_tag = machine_tag_ + self.plan_info = plan_info_ + self.volume_tag = volume_tag_ self.unknown_fields = unknown_fields -class Value(Type): - _toSchema = {'allocate_public_ip': 'allocate-public-ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu_power': 'cpu-power', 'image_id': 'image-id', 'instance_role': 'instance-role', 'instance_type': 'instance-type', 'mem': 'mem', 'root_disk': 'root-disk', 'root_disk_source': 'root-disk-source', 'spaces': 'spaces', 'tags': 'tags', 'virt_type': 'virt-type', 'zones': 'zones'} - _toPy = {'allocate-public-ip': 'allocate_public_ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu-power': 'cpu_power', 'image-id': 'image_id', 'instance-role': 'instance_role', 'instance-type': 'instance_type', 'mem': 'mem', 'root-disk': 'root_disk', 'root-disk-source': 'root_disk_source', 'spaces': 'spaces', 'tags': 'tags', 'virt-type': 'virt_type', 'zones': 'zones'} - def __init__(self, allocate_public_ip=None, arch=None, container=None, cores=None, cpu_power=None, image_id=None, instance_role=None, instance_type=None, mem=None, root_disk=None, root_disk_source=None, spaces=None, tags=None, virt_type=None, zones=None, **unknown_fields): +class VolumeAttachmentPlanInfo(Type): + _toSchema = {'device_attributes': 'device-attributes', 'device_type': 'device-type'} + _toPy = {'device-attributes': 'device_attributes', 'device-type': 'device_type'} + def __init__(self, device_attributes=None, device_type=None, **unknown_fields): ''' - allocate_public_ip : bool - arch : str - container : str - cores : int - cpu_power : int - image_id : str - instance_role : str - instance_type : str - mem : int - root_disk : int - root_disk_source : str - spaces : typing.Sequence[str] - tags : typing.Sequence[str] - virt_type : str - zones : typing.Sequence[str] + device_attributes : typing.Mapping[str, str] + device_type : str ''' - allocate_public_ip_ = allocate_public_ip - arch_ = arch - container_ = container - cores_ = cores - cpu_power_ = cpu_power - image_id_ = image_id - instance_role_ = instance_role - instance_type_ = instance_type - mem_ = mem - root_disk_ = root_disk - root_disk_source_ = root_disk_source - spaces_ = spaces - tags_ = tags - virt_type_ = virt_type - zones_ = zones + device_attributes_ = device_attributes + device_type_ = device_type # Validate arguments against known Juju API types. - if allocate_public_ip_ is not None and not isinstance(allocate_public_ip_, bool): - raise Exception("Expected allocate_public_ip_ to be a bool, received: {}".format(type(allocate_public_ip_))) - - if arch_ is not None and not isinstance(arch_, (bytes, str)): - raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) - - if container_ is not None and not isinstance(container_, (bytes, str)): - raise Exception("Expected container_ to be a str, received: {}".format(type(container_))) - - if cores_ is not None and not isinstance(cores_, int): - raise Exception("Expected cores_ to be a int, received: {}".format(type(cores_))) - - if cpu_power_ is not None and not isinstance(cpu_power_, int): - raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) - - if image_id_ is not None and not isinstance(image_id_, (bytes, str)): - raise Exception("Expected image_id_ to be a str, received: {}".format(type(image_id_))) - - if instance_role_ is not None and not isinstance(instance_role_, (bytes, str)): - raise Exception("Expected instance_role_ to be a str, received: {}".format(type(instance_role_))) - - if instance_type_ is not None and not isinstance(instance_type_, (bytes, str)): - raise Exception("Expected instance_type_ to be a str, received: {}".format(type(instance_type_))) + if device_attributes_ is not None and not isinstance(device_attributes_, dict): + raise Exception("Expected device_attributes_ to be a Mapping, received: {}".format(type(device_attributes_))) - if mem_ is not None and not isinstance(mem_, int): - raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) + if device_type_ is not None and not isinstance(device_type_, (bytes, str)): + raise Exception("Expected device_type_ to be a str, received: {}".format(type(device_type_))) - if root_disk_ is not None and not isinstance(root_disk_, int): - raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + self.device_attributes = device_attributes_ + self.device_type = device_type_ + self.unknown_fields = unknown_fields - if root_disk_source_ is not None and not isinstance(root_disk_source_, (bytes, str)): - raise Exception("Expected root_disk_source_ to be a str, received: {}".format(type(root_disk_source_))) - if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): - raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) - if tags_ is not None and not isinstance(tags_, (bytes, str, list)): - raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) +class VolumeAttachmentPlanResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : VolumeAttachmentPlan + ''' + error_ = Error.from_json(error) if error else None + result_ = VolumeAttachmentPlan.from_json(result) if result else None - 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_))) + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if zones_ is not None and not isinstance(zones_, (bytes, str, list)): - raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + if result_ is not None and not isinstance(result_, (dict, VolumeAttachmentPlan)): + raise Exception("Expected result_ to be a VolumeAttachmentPlan, received: {}".format(type(result_))) - self.allocate_public_ip = allocate_public_ip_ - self.arch = arch_ - self.container = container_ - self.cores = cores_ - self.cpu_power = cpu_power_ - self.image_id = image_id_ - self.instance_role = instance_role_ - self.instance_type = instance_type_ - self.mem = mem_ - self.root_disk = root_disk_ - self.root_disk_source = root_disk_source_ - self.spaces = spaces_ - self.tags = tags_ - self.virt_type = virt_type_ - self.zones = zones_ + self.error = error_ + self.result = result_ self.unknown_fields = unknown_fields -class VolumeAttachmentDetails(Type): - _toSchema = {'bus_address': 'bus-address', 'device_link': 'device-link', 'device_name': 'device-name', 'life': 'life', 'plan_info': 'plan-info', 'read_only': 'read-only', 'volumeattachmentinfo': 'VolumeAttachmentInfo'} - _toPy = {'VolumeAttachmentInfo': 'volumeattachmentinfo', 'bus-address': 'bus_address', 'device-link': 'device_link', 'device-name': 'device_name', 'life': 'life', 'plan-info': 'plan_info', 'read-only': 'read_only'} - def __init__(self, volumeattachmentinfo=None, bus_address=None, device_link=None, device_name=None, life=None, plan_info=None, read_only=None, **unknown_fields): +class VolumeAttachmentPlanResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' - volumeattachmentinfo : VolumeAttachmentInfo - bus_address : str - device_link : str - device_name : str - life : str - plan_info : VolumeAttachmentPlanInfo - read_only : bool + results : typing.Sequence[~VolumeAttachmentPlanResult] ''' - volumeattachmentinfo_ = VolumeAttachmentInfo.from_json(volumeattachmentinfo) if volumeattachmentinfo else None - bus_address_ = bus_address - device_link_ = device_link - device_name_ = device_name - life_ = life - plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None - read_only_ = read_only + results_ = [VolumeAttachmentPlanResult.from_json(o) for o in results or []] # Validate arguments against known Juju API types. - if volumeattachmentinfo_ is not None and not isinstance(volumeattachmentinfo_, (dict, VolumeAttachmentInfo)): - raise Exception("Expected volumeattachmentinfo_ to be a VolumeAttachmentInfo, received: {}".format(type(volumeattachmentinfo_))) - - if bus_address_ is not None and not isinstance(bus_address_, (bytes, str)): - raise Exception("Expected bus_address_ to be a str, received: {}".format(type(bus_address_))) + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) - if device_link_ is not None and not isinstance(device_link_, (bytes, str)): - raise Exception("Expected device_link_ to be a str, received: {}".format(type(device_link_))) + self.results = results_ + self.unknown_fields = unknown_fields - if device_name_ is not None and not isinstance(device_name_, (bytes, str)): - raise Exception("Expected device_name_ to be a str, received: {}".format(type(device_name_))) - if life_ is not None and not isinstance(life_, (bytes, str)): - raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) - if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): - raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) +class VolumeAttachmentPlans(Type): + _toSchema = {'volume_plans': 'volume-plans'} + _toPy = {'volume-plans': 'volume_plans'} + def __init__(self, volume_plans=None, **unknown_fields): + ''' + volume_plans : typing.Sequence[~VolumeAttachmentPlan] + ''' + volume_plans_ = [VolumeAttachmentPlan.from_json(o) for o in volume_plans or []] - if read_only_ is not None and not isinstance(read_only_, bool): - raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + # Validate arguments against known Juju API types. + if volume_plans_ is not None and not isinstance(volume_plans_, (bytes, str, list)): + raise Exception("Expected volume_plans_ to be a Sequence, received: {}".format(type(volume_plans_))) - self.volumeattachmentinfo = volumeattachmentinfo_ - self.bus_address = bus_address_ - self.device_link = device_link_ - self.device_name = device_name_ - self.life = life_ - self.plan_info = plan_info_ - self.read_only = read_only_ + self.volume_plans = volume_plans_ self.unknown_fields = unknown_fields -class VolumeAttachmentInfo(Type): - _toSchema = {'bus_address': 'bus-address', 'device_link': 'device-link', 'device_name': 'device-name', 'plan_info': 'plan-info', 'read_only': 'read-only'} - _toPy = {'bus-address': 'bus_address', 'device-link': 'device_link', 'device-name': 'device_name', 'plan-info': 'plan_info', 'read-only': 'read_only'} - def __init__(self, bus_address=None, device_link=None, device_name=None, plan_info=None, read_only=None, **unknown_fields): +class VolumeAttachmentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' - bus_address : str - device_link : str - device_name : str - plan_info : VolumeAttachmentPlanInfo - read_only : bool + error : Error + result : VolumeAttachment ''' - bus_address_ = bus_address - device_link_ = device_link - device_name_ = device_name - plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None - read_only_ = read_only + error_ = Error.from_json(error) if error else None + result_ = VolumeAttachment.from_json(result) if result else None # Validate arguments against known Juju API types. - if bus_address_ is not None and not isinstance(bus_address_, (bytes, str)): - raise Exception("Expected bus_address_ to be a str, received: {}".format(type(bus_address_))) + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, VolumeAttachment)): + raise Exception("Expected result_ to be a VolumeAttachment, received: {}".format(type(result_))) - if device_link_ is not None and not isinstance(device_link_, (bytes, str)): - raise Exception("Expected device_link_ to be a str, received: {}".format(type(device_link_))) + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields - if device_name_ is not None and not isinstance(device_name_, (bytes, str)): - raise Exception("Expected device_name_ to be a str, received: {}".format(type(device_name_))) - if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): - raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) - if read_only_ is not None and not isinstance(read_only_, bool): - raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) +class VolumeAttachmentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeAttachmentResult] + ''' + results_ = [VolumeAttachmentResult.from_json(o) for o in results or []] - self.bus_address = bus_address_ - self.device_link = device_link_ - self.device_name = device_name_ - self.plan_info = plan_info_ - self.read_only = read_only_ + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ self.unknown_fields = unknown_fields -class VolumeAttachmentPlanInfo(Type): - _toSchema = {'device_attributes': 'device-attributes', 'device_type': 'device-type'} - _toPy = {'device-attributes': 'device_attributes', 'device-type': 'device_type'} - def __init__(self, device_attributes=None, device_type=None, **unknown_fields): +class VolumeAttachments(Type): + _toSchema = {'volume_attachments': 'volume-attachments'} + _toPy = {'volume-attachments': 'volume_attachments'} + def __init__(self, volume_attachments=None, **unknown_fields): ''' - device_attributes : typing.Mapping[str, str] - device_type : str + volume_attachments : typing.Sequence[~VolumeAttachment] ''' - device_attributes_ = device_attributes - device_type_ = device_type + volume_attachments_ = [VolumeAttachment.from_json(o) for o in volume_attachments or []] # Validate arguments against known Juju API types. - if device_attributes_ is not None and not isinstance(device_attributes_, dict): - raise Exception("Expected device_attributes_ to be a Mapping, received: {}".format(type(device_attributes_))) + if volume_attachments_ is not None and not isinstance(volume_attachments_, (bytes, str, list)): + raise Exception("Expected volume_attachments_ to be a Sequence, received: {}".format(type(volume_attachments_))) - if device_type_ is not None and not isinstance(device_type_, (bytes, str)): - raise Exception("Expected device_type_ to be a str, received: {}".format(type(device_type_))) - - self.device_attributes = device_attributes_ - self.device_type = device_type_ + self.volume_attachments = volume_attachments_ self.unknown_fields = unknown_fields @@ -16132,6 +27622,294 @@ def __init__(self, hardware_id=None, persistent=None, pool=None, size=None, volu +class VolumeParams(Type): + _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume_tag': 'volume-tag'} + _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume-tag': 'volume_tag'} + def __init__(self, attachment=None, attributes=None, provider=None, size=None, tags=None, volume_tag=None, **unknown_fields): + ''' + attachment : VolumeAttachmentParams + attributes : typing.Mapping[str, typing.Any] + provider : str + size : int + tags : typing.Mapping[str, str] + volume_tag : str + ''' + attachment_ = VolumeAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + provider_ = provider + size_ = size + tags_ = tags + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, VolumeAttachmentParams)): + raise Exception("Expected attachment_ to be a VolumeAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.provider = provider_ + self.size = size_ + self.tags = tags_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +class VolumeParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : VolumeParams + ''' + error_ = Error.from_json(error) if error else None + result_ = VolumeParams.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, VolumeParams)): + raise Exception("Expected result_ to be a VolumeParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeParamsResult] + ''' + results_ = [VolumeParamsResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class VolumeResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : Volume + ''' + error_ = Error.from_json(error) if error else None + result_ = Volume.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if result_ is not None and not isinstance(result_, (dict, Volume)): + raise Exception("Expected result_ to be a Volume, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeResult] + ''' + results_ = [VolumeResult.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + +class Volumes(Type): + _toSchema = {'volumes': 'volumes'} + _toPy = {'volumes': 'volumes'} + def __init__(self, volumes=None, **unknown_fields): + ''' + volumes : typing.Sequence[~Volume] + ''' + volumes_ = [Volume.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class WatchContainer(Type): + _toSchema = {'container_type': 'container-type', 'machine_tag': 'machine-tag'} + _toPy = {'container-type': 'container_type', 'machine-tag': 'machine_tag'} + def __init__(self, container_type=None, machine_tag=None, **unknown_fields): + ''' + container_type : str + machine_tag : str + ''' + container_type_ = container_type + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.container_type = container_type_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class WatchContainerStartArg(Type): + _toSchema = {'container': 'container', 'entity': 'entity'} + _toPy = {'container': 'container', 'entity': 'entity'} + def __init__(self, container=None, entity=None, **unknown_fields): + ''' + container : str + entity : Entity + ''' + container_ = container + entity_ = Entity.from_json(entity) if entity else None + + # Validate arguments against known Juju API types. + if container_ is not None and not isinstance(container_, (bytes, str)): + raise Exception("Expected container_ to be a str, received: {}".format(type(container_))) + + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + self.container = container_ + self.entity = entity_ + self.unknown_fields = unknown_fields + + + +class WatchContainerStartArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~WatchContainerStartArg] + ''' + args_ = [WatchContainerStartArg.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + +class WatchContainers(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~WatchContainer] + ''' + params_ = [WatchContainer.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = unknown_fields + + + +class WatchRemoteSecretChangesArg(Type): + _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'relation_token': 'relation-token'} + _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'relation-token': 'relation_token'} + def __init__(self, application_token=None, bakery_version=None, macaroons=None, relation_token=None, **unknown_fields): + ''' + application_token : str + bakery_version : int + macaroons : typing.Sequence[~Macaroon] + relation_token : str + ''' + application_token_ = application_token + bakery_version_ = bakery_version + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) + + if bakery_version_ is not None and not isinstance(bakery_version_, int): + raise Exception("Expected bakery_version_ to be a int, received: {}".format(type(bakery_version_))) + + if macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.macaroons = macaroons_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class WatchRemoteSecretChangesArgs(Type): + _toSchema = {'relations': 'relations'} + _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): + ''' + relations : typing.Sequence[~WatchRemoteSecretChangesArg] + ''' + relations_ = [WatchRemoteSecretChangesArg.from_json(o) for o in relations or []] + + # Validate arguments against known Juju API types. + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) + + self.relations = relations_ + self.unknown_fields = unknown_fields + + + class ZoneResult(Type): _toSchema = {'available': 'available', 'error': 'error', 'name': 'name'} _toPy = {'available': 'available', 'error': 'error', 'name': 'name'}