Exemple #1
0
 def __init__(self, topic=None, server=None):
     super(ConsoleAPI, self).__init__()
     topic = topic if topic else CONF.console_topic
     target = messaging.Target(topic=topic, server=server, version='2.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.console,
                                            CONF.upgrade_levels.console)
     self.client = rpc.get_client(target, version_cap=version_cap)
Exemple #2
0
 def __init__(self):
     super(ComputeTaskAPI, self).__init__()
     target = messaging.Target(topic=CONF.conductor.topic,
                               namespace='compute_task',
                               version='1.0')
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, serializer=serializer)
Exemple #3
0
 def __init__(self, topic=None, server=None):
     super(ConsoleAPI, self).__init__()
     topic = topic if topic else CONF.console_topic
     target = messaging.Target(topic=topic, server=server, version='2.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.console,
                                            CONF.upgrade_levels.console)
     self.client = rpc.get_client(target, version_cap=version_cap)
Exemple #4
0
 def __init__(self):
     super(ComputeTaskAPI, self).__init__()
     target = messaging.Target(topic=CONF.conductor.topic,
                               namespace='compute_task',
                               version='1.0')
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, serializer=serializer)
Exemple #5
0
 def __init__(self, topic=None):
     super(NetworkAPI, self).__init__()
     topic = topic or CONF.network_topic
     target = messaging.Target(topic=topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.network,
                                            CONF.upgrade_levels.network)
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, version_cap, serializer)
Exemple #6
0
 def __init__(self, topic):
     super(BaseAPI, self).__init__()
     target = messaging.Target(topic=topic,
                               namespace=_NAMESPACE,
                               version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.baseapi,
                                            CONF.upgrade_levels.baseapi)
     self.client = rpc.get_client(target, version_cap=version_cap)
Exemple #7
0
 def __init__(self):
     super(SchedulerAPI, self).__init__()
     target = messaging.Target(topic=CONF.scheduler_topic, version='4.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.scheduler,
                                            CONF.upgrade_levels.scheduler)
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, version_cap=version_cap,
                                  serializer=serializer)
Exemple #8
0
 def __init__(self, topic=None):
     super(NetworkAPI, self).__init__()
     topic = topic or CONF.network_topic
     target = messaging.Target(topic=topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.network,
                                            CONF.upgrade_levels.network)
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, version_cap, serializer)
Exemple #9
0
 def __init__(self):
     super(VerifyAPI, self).__init__()
     target = messaging.Target(topic=CONF.verify.topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.verify,
                                            CONF.upgrade_levels.verify)
     # serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target,
                                  version_cap=version_cap,
                                  serializer=None)
Exemple #10
0
 def __init__(self):
     super(VerifyAPI, self).__init__()
     target = messaging.Target(topic=CONF.verify.topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.verify,
                                            CONF.upgrade_levels.verify)
     # serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target,
                                  version_cap=version_cap,
                                  serializer=None)
Exemple #11
0
 def __init__(self):
     super(CellsAPI, self).__init__()
     target = messaging.Target(topic=CONF.cells.topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.cells,
                                            CONF.upgrade_levels.cells)
     # NOTE(sbauza): Yes, this is ugly but cells_utils is calling cells.db
     # which itself calls cells.rpcapi... You meant import cycling ? Gah.
     from patron.cells import utils as cells_utils
     serializer = cells_utils.ProxyObjectSerializer()
     self.client = rpc.get_client(target,
                                  version_cap=version_cap,
                                  serializer=serializer)
Exemple #12
0
 def __init__(self):
     super(CellsAPI, self).__init__()
     target = messaging.Target(topic=CONF.cells.topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.cells,
                                            CONF.upgrade_levels.cells)
     # NOTE(sbauza): Yes, this is ugly but cells_utils is calling cells.db
     # which itself calls cells.rpcapi... You meant import cycling ? Gah.
     from patron.cells import utils as cells_utils
     serializer = cells_utils.ProxyObjectSerializer()
     self.client = rpc.get_client(target,
                                  version_cap=version_cap,
                                  serializer=serializer)
Exemple #13
0
 def __init__(self):
     super(CertAPI, self).__init__()
     target = messaging.Target(topic=CONF.cert_topic, version='2.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.cert,
                                            CONF.upgrade_levels.cert)
     self.client = rpc.get_client(target, version_cap=version_cap)
Exemple #14
0
 def _check_version_cap(self, version):
     client = rpc.get_client(self.target, version_cap=self.version_cap)
     if not client.can_send_version(version):
         raise messaging.RPCVersionCapError(version=version,
                                            version_cap=self.version_cap)
Exemple #15
0
 def can_send_version(self, version):
     client = rpc.get_client(self.target, version_cap=self.version_cap)
     return client.can_send_version(version)
Exemple #16
0
 def __init__(self):
     super(ConsoleAuthAPI, self).__init__()
     target = messaging.Target(topic=CONF.consoleauth_topic, version='2.1')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.consoleauth,
                                            CONF.upgrade_levels.consoleauth)
     self.client = rpc.get_client(target, version_cap=version_cap)
Exemple #17
0
 def __init__(self):
     super(ConsoleAuthAPI, self).__init__()
     target = messaging.Target(topic=CONF.consoleauth_topic, version='2.1')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.consoleauth,
                                            CONF.upgrade_levels.consoleauth)
     self.client = rpc.get_client(target, version_cap=version_cap)