Source code for juju.client._client

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

from juju.client._definitions import *

from juju.client import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9, _client10, _client6, _client12


CLIENTS = {
    "2": _client2,
    "1": _client1,
    "3": _client3,
    "4": _client4,
    "5": _client5,
    "8": _client8,
    "7": _client7,
    "9": _client9,
    "10": _client10,
    "6": _client6,
    "12": _client12
}



[docs]def lookup_facade(name, version): """ Given a facade name and version, attempt to pull that facade out of the correct client<version>.py file. """ for _version in range(int(version), 0, -1): try: facade = getattr(CLIENTS[str(_version)], name) return facade except (KeyError, AttributeError): continue else: raise ImportError("No supported version for facade: " "{}".format(name))
[docs]class TypeFactory:
[docs] @classmethod def from_connection(cls, connection): """ Given a connected Connection object, return an initialized and connected instance of an API Interface matching the name of this class. @param connection: initialized Connection object. """ facade_name = cls.__name__ if not facade_name.endswith('Facade'): raise TypeError('Unexpected class name: {}'.format(facade_name)) facade_name = facade_name[:-len('Facade')] version = connection.facades.get(facade_name) if version is None: raise Exception('No facade {} in facades {}'.format(facade_name, connection.facades)) c = lookup_facade(cls.__name__, version) c = c() c.connect(connection) return c
[docs] @classmethod def best_facade_version(cls, connection): """ Returns the best facade version for a given facade. This will help with trying to provide different functionality for different facade versions. @param connection: initialized Connection object. """ facade_name = cls.__name__ if not facade_name.endswith('Facade'): raise TypeError('Unexpected class name: {}'.format(facade_name)) facade_name = facade_name[:-len('Facade')] return connection.facades.get(facade_name)
[docs]class ActionFacade(TypeFactory): pass
[docs]class ActionPrunerFacade(TypeFactory): pass
[docs]class AgentFacade(TypeFactory): pass
[docs]class AgentToolsFacade(TypeFactory): pass
[docs]class AllModelWatcherFacade(TypeFactory): pass
[docs]class AllWatcherFacade(TypeFactory): pass
[docs]class AnnotationsFacade(TypeFactory): pass
[docs]class ApplicationFacade(TypeFactory): pass
[docs]class ApplicationOffersFacade(TypeFactory): pass
[docs]class ApplicationRelationsWatcherFacade(TypeFactory): pass
[docs]class ApplicationScalerFacade(TypeFactory): pass
[docs]class BackupsFacade(TypeFactory): pass
[docs]class BlockFacade(TypeFactory): pass
[docs]class BundleFacade(TypeFactory): pass
[docs]class CAASAgentFacade(TypeFactory): pass
[docs]class CAASFirewallerFacade(TypeFactory): pass
[docs]class CAASOperatorFacade(TypeFactory): pass
[docs]class CAASOperatorProvisionerFacade(TypeFactory): pass
[docs]class CAASOperatorUpgraderFacade(TypeFactory): pass
[docs]class CAASUnitProvisionerFacade(TypeFactory): pass
[docs]class CharmRevisionUpdaterFacade(TypeFactory): pass
[docs]class CharmsFacade(TypeFactory): pass
[docs]class CleanerFacade(TypeFactory): pass
[docs]class ClientFacade(TypeFactory): pass
[docs]class CloudFacade(TypeFactory): pass
[docs]class ControllerFacade(TypeFactory): pass
[docs]class CredentialManagerFacade(TypeFactory): pass
[docs]class CredentialValidatorFacade(TypeFactory): pass
[docs]class CrossControllerFacade(TypeFactory): pass
[docs]class CrossModelRelationsFacade(TypeFactory): pass
[docs]class DeployerFacade(TypeFactory): pass
[docs]class DiscoverSpacesFacade(TypeFactory): pass
[docs]class DiskManagerFacade(TypeFactory): pass
[docs]class EntityWatcherFacade(TypeFactory): pass
[docs]class ExternalControllerUpdaterFacade(TypeFactory): pass
[docs]class FanConfigurerFacade(TypeFactory): pass
[docs]class FilesystemAttachmentsWatcherFacade(TypeFactory): pass
[docs]class FirewallRulesFacade(TypeFactory): pass
[docs]class FirewallerFacade(TypeFactory): pass
[docs]class HighAvailabilityFacade(TypeFactory): pass
[docs]class HostKeyReporterFacade(TypeFactory): pass
[docs]class ImageManagerFacade(TypeFactory): pass
[docs]class ImageMetadataFacade(TypeFactory): pass
[docs]class InstanceMutaterFacade(TypeFactory): pass
[docs]class InstancePollerFacade(TypeFactory): pass
[docs]class KeyManagerFacade(TypeFactory): pass
[docs]class KeyUpdaterFacade(TypeFactory): pass
[docs]class LeadershipServiceFacade(TypeFactory): pass
[docs]class LifeFlagFacade(TypeFactory): pass
[docs]class LogForwardingFacade(TypeFactory): pass
[docs]class LoggerFacade(TypeFactory): pass
[docs]class MachineActionsFacade(TypeFactory): pass
[docs]class MachineManagerFacade(TypeFactory): pass
[docs]class MachineUndertakerFacade(TypeFactory): pass
[docs]class MachinerFacade(TypeFactory): pass
[docs]class MeterStatusFacade(TypeFactory): pass
[docs]class MetricsAdderFacade(TypeFactory): pass
[docs]class MetricsDebugFacade(TypeFactory): pass
[docs]class MetricsManagerFacade(TypeFactory): pass
[docs]class MigrationFlagFacade(TypeFactory): pass
[docs]class MigrationMasterFacade(TypeFactory): pass
[docs]class MigrationMinionFacade(TypeFactory): pass
[docs]class MigrationStatusWatcherFacade(TypeFactory): pass
[docs]class MigrationTargetFacade(TypeFactory): pass
[docs]class ModelConfigFacade(TypeFactory): pass
[docs]class ModelGenerationFacade(TypeFactory): pass
[docs]class ModelManagerFacade(TypeFactory): pass
[docs]class ModelUpgraderFacade(TypeFactory): pass
[docs]class NotifyWatcherFacade(TypeFactory): pass
[docs]class OfferStatusWatcherFacade(TypeFactory): pass
[docs]class PayloadsFacade(TypeFactory): pass
[docs]class PayloadsHookContextFacade(TypeFactory): pass
[docs]class PingerFacade(TypeFactory): pass
[docs]class ProvisionerFacade(TypeFactory): pass
[docs]class ProxyUpdaterFacade(TypeFactory): pass
[docs]class RebootFacade(TypeFactory): pass
[docs]class RelationStatusWatcherFacade(TypeFactory): pass
[docs]class RelationUnitsWatcherFacade(TypeFactory): pass
[docs]class RemoteApplicationWatcherFacade(TypeFactory): pass
[docs]class RemoteRelationsFacade(TypeFactory): pass
[docs]class RemoteRelationsWatcherFacade(TypeFactory): pass
[docs]class ResourcesFacade(TypeFactory): pass
[docs]class ResourcesHookContextFacade(TypeFactory): pass
[docs]class ResumerFacade(TypeFactory): pass
[docs]class RetryStrategyFacade(TypeFactory): pass
[docs]class SSHClientFacade(TypeFactory): pass
[docs]class SingularFacade(TypeFactory): pass
[docs]class SpacesFacade(TypeFactory): pass
[docs]class StatusHistoryFacade(TypeFactory): pass
[docs]class StorageFacade(TypeFactory): pass
[docs]class StorageProvisionerFacade(TypeFactory): pass
[docs]class StringsWatcherFacade(TypeFactory): pass
[docs]class SubnetsFacade(TypeFactory): pass
[docs]class UndertakerFacade(TypeFactory): pass
[docs]class UnitAssignerFacade(TypeFactory): pass
[docs]class UniterFacade(TypeFactory): pass
[docs]class UpgradeSeriesFacade(TypeFactory): pass
[docs]class UpgradeStepsFacade(TypeFactory): pass
[docs]class UpgraderFacade(TypeFactory): pass
[docs]class UserManagerFacade(TypeFactory): pass
[docs]class VolumeAttachmentPlansWatcherFacade(TypeFactory): pass
[docs]class VolumeAttachmentsWatcherFacade(TypeFactory): pass