当前位置: 首页>>代码示例>>Python>>正文


Python rpc.create_connection函数代码示例

本文整理汇总了Python中quantum.openstack.common.rpc.create_connection函数的典型用法代码示例。如果您正苦于以下问题:Python create_connection函数的具体用法?Python create_connection怎么用?Python create_connection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了create_connection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _setup_rpc

 def _setup_rpc(self):
     self.conn = rpc.create_connection(new=True)
     self.notifier = AgentNotifierApi(topics.AGENT)
     self.callbacks = RyuRpcCallbacks(self.ofp_api_host)
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(topics.PLUGIN, self.dispatcher, fanout=False)
     self.conn.consume_in_thread()
开发者ID:alanmeadows,项目名称:quantum,代码行数:7,代码来源:ryu_quantum_plugin.py

示例2: setup_rpc

 def setup_rpc(self):
     # RPC support for dhcp
     self.topic = topics.PLUGIN
     self.conn = rpc.create_connection(new=True)
     self.dispatcher = NVPRpcCallbacks().create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
开发者ID:carriercomm,项目名称:quantum-7,代码行数:8,代码来源:QuantumPlugin.py

示例3: setup_rpc

 def setup_rpc(self):
     self.topic = topics.PLUGIN
     self.conn = rpc.create_connection(new=True)
     self.callbacks = NECPluginV2RPCCallbacks(self)
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
开发者ID:missall,项目名称:quantum,代码行数:8,代码来源:nec_plugin.py

示例4: __init__

 def __init__(self):
     # Set the Queue size to 1 so that messages stay on server rather than
     # being buffered in the process.
     self.queue = eventlet.queue.Queue(1)
     self.connection = rpc.create_connection(new=True)
     topic = "%s.%s" % (rpc_notifier.CONF.notification_topics[0], api.CONF.default_notification_level.lower())
     queue_name = "notification_listener_%s" % uuidutils.generate_uuid()
     self.connection.declare_topic_consumer(topic=topic, queue_name=queue_name, callback=self._add_to_queue)
     self.connection.consume_in_thread()
开发者ID:carriercomm,项目名称:quantum-7,代码行数:9,代码来源:rpc.py

示例5: _setup_rpc

 def _setup_rpc(self):
     # RPC support
     self.topic = topics.PLUGIN
     self.conn = rpc.create_connection(new=True)
     self.callbacks = LinuxBridgeRpcCallbacks()
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
     self.notifier = AgentNotifierApi(topics.AGENT)
开发者ID:lucian,项目名称:quantum,代码行数:10,代码来源:lb_quantum_plugin.py

示例6: __init__

 def __init__(self):
     # Set the Queue size to 1 so that messages stay on server rather than
     # being buffered in the process.
     self.queue = eventlet.queue.Queue(1)
     self.connection = rpc.create_connection(new=True)
     topic = '%s.%s' % (rabbit_notifier.CONF.notification_topics[0],
                        api.CONF.default_notification_level.lower())
     self.connection.declare_topic_consumer(topic=topic,
                                            callback=self._add_to_queue)
     self.connection.consume_in_thread()
开发者ID:Blackspan,项目名称:quantum,代码行数:10,代码来源:rpc.py

示例7: setup_rpc

 def setup_rpc(self):
     # RPC support
     self.topic = topics.PLUGIN
     self.rpc_context = context.RequestContext("quantum", "quantum", is_admin=False)
     self.conn = rpc.create_connection(new=True)
     self.notifier = AgentNotifierApi(topics.AGENT)
     self.callbacks = RgosRpcCallbacks(self.rpc_context, self.notifier)
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
开发者ID:ruijie,项目名称:rgos_quantum_plugin,代码行数:11,代码来源:rgos_quantum_plugin.py

示例8: _setup_rpc

 def _setup_rpc(self):
     self.notifier = rpc.AgentNotifierApi(topics.AGENT)
     self.dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
     self.l3_agent_notifier = l3_rpc_agent_api.L3AgentNotify
     self.callbacks = rpc.RpcCallbacks(self.notifier)
     self.topic = topics.PLUGIN
     self.conn = c_rpc.create_connection(new=True)
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher,
                               fanout=False)
     self.conn.consume_in_thread()
开发者ID:Apsu,项目名称:quantum,代码行数:11,代码来源:plugin.py

示例9: setup_rpc

 def setup_rpc(self):
     # RPC support for dhcp
     self.topic = topics.PLUGIN
     self.rpc_context = context.RequestContext('quantum', 'quantum',
                                               is_admin=False)
     self.conn = rpc.create_connection(new=True)
     self.callbacks = NVPRpcCallbacks(self.rpc_context)
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher,
                               fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
开发者ID:redondos,项目名称:quantum,代码行数:12,代码来源:QuantumPlugin.py

示例10: setup_rpc

 def setup_rpc(self):
     # RPC support
     self.topic = topics.PLUGIN
     self.conn = rpc.create_connection(new=True)
     self.notifier = AgentNotifierApi(topics.AGENT)
     self.dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
     self.l3_agent_notifier = l3_rpc_agent_api.L3AgentNotify
     self.callbacks = OVSRpcCallbacks(self.notifier)
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
开发者ID:JunPark,项目名称:quantum,代码行数:12,代码来源:ovs_quantum_plugin.py

示例11: __init__

    def __init__(self, plugin):
        self.agent_rpc = LoadBalancerAgentApi(
            TOPIC_LOADBALANCER_AGENT,
            cfg.CONF.host
        )
        self.callbacks = LoadBalancerCallbacks(plugin)

        self.conn = rpc.create_connection(new=True)
        self.conn.create_consumer(
            TOPIC_PROCESS_ON_HOST,
            self.callbacks.create_rpc_dispatcher(),
            fanout=False)
        self.conn.consume_in_thread()
        self.plugin = plugin
开发者ID:DestinyOneSystems,项目名称:quantum,代码行数:14,代码来源:plugin_driver.py

示例12: setup_rpc

    def setup_rpc(self):
        self.topic = topics.PLUGIN
        self.conn = rpc.create_connection(new=True)
        self.notifier = NECPluginV2AgentNotifierApi(topics.AGENT)

        self.callback_nec = NECPluginV2RPCCallbacks(self)
        self.callback_dhcp = DhcpRpcCallback()
        self.callback_l3 = L3RpcCallback()
        self.callback_sg = SecurityGroupServerRpcCallback()
        callbacks = [self.callback_nec, self.callback_dhcp,
                     self.callback_l3, self.callback_sg]
        self.dispatcher = q_rpc.PluginRpcDispatcher(callbacks)
        self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
开发者ID:wdec,项目名称:quantum,代码行数:15,代码来源:nec_plugin.py

示例13: _setup_rpc

 def _setup_rpc(self):
     # RPC support
     self.topic = topics.PLUGIN
     self.rpc_context = context.RequestContext('quantum', 'quantum',
                                               is_admin=False)
     self.conn = rpc.create_connection(new=True)
     self.callbacks = BridgeRpcCallbacks()
     self.dispatcher = self.callbacks.create_rpc_dispatcher()
     self.conn.create_consumer(self.topic, self.dispatcher,
                               fanout=False)
     # Consume from all consumers in a thread
     self.conn.consume_in_thread()
     self.notifier = AgentNotifierApi(topics.AGENT)
     self.dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
     self.l3_agent_notifier = l3_rpc_agent_api.L3AgentNotify
开发者ID:JunPark,项目名称:quantum,代码行数:15,代码来源:QuantumPlugin.py

示例14: __init__

    def __init__(self):
        LOG.info(_('QuantumRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())

        # init DB, proxy's persistent store defaults to in-memory sql-lite DB
        options = {"sql_connection": "%s" % cfg.CONF.DATABASE.sql_connection,
                   "sql_max_retries": cfg.CONF.DATABASE.sql_max_retries,
                   "reconnect_interval": cfg.CONF.DATABASE.reconnect_interval,
                   "base": models_v2.model_base.BASEV2,
                   "sql_min_pool_size": cfg.CONF.DATABASE.sql_min_pool_size,
                   "sql_max_pool_size": cfg.CONF.DATABASE.sql_max_pool_size,
                   "sql_idle_timeout": cfg.CONF.DATABASE.sql_idle_timeout,
                   "sql_dbpool_enable": cfg.CONF.DATABASE.sql_dbpool_enable}
        db.configure_db(options)

        # 'servers' is the list of network controller REST end-points
        # (used in order specified till one suceeds, and it is sticky
        # till next failure). Use 'serverauth' to encode api-key
        servers = cfg.CONF.RESTPROXY.servers
        serverauth = cfg.CONF.RESTPROXY.serverauth
        serverssl = cfg.CONF.RESTPROXY.serverssl
        syncdata = cfg.CONF.RESTPROXY.syncdata
        timeout = cfg.CONF.RESTPROXY.servertimeout

        # validate config
        assert servers is not None, 'Servers not defined. Aborting plugin'
        servers = tuple(s.rsplit(':', 1) for s in servers.split(','))
        servers = tuple((server, int(port)) for server, port in servers)
        assert all(len(s) == 2 for s in servers), SYNTAX_ERROR_MESSAGE

        # init network ctrl connections
        self.servers = ServerPool(servers, serverssl, serverauth,
                                  timeout)

        # init dhcp support
        self.topic = topics.PLUGIN
        self.conn = rpc.create_connection(new=True)
        self.callbacks = RpcProxy()
        self.dispatcher = self.callbacks.create_rpc_dispatcher()
        self.conn.create_consumer(self.topic, self.dispatcher,
                                  fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
        if syncdata:
            self._send_all_data()

        LOG.debug(_("QuantumRestProxyV2: initialization done"))
开发者ID:alexpilotti,项目名称:quantum,代码行数:47,代码来源:plugin.py

示例15: __init__

    def __init__(self):
        """Do the initialization for the loadbalancer service plugin here."""
        qdbapi.register_models()

        self.callbacks = LoadBalancerCallbacks(self)

        self.conn = rpc.create_connection(new=True)
        self.conn.create_consumer(
            topics.LOADBALANCER_PLUGIN,
            self.callbacks.create_rpc_dispatcher(),
            fanout=False)
        self.conn.consume_in_thread()

        self.agent_rpc = LoadBalancerAgentApi(
            topics.LOADBALANCER_AGENT,
            cfg.CONF.host
        )
开发者ID:Apsu,项目名称:quantum,代码行数:17,代码来源:plugin.py


注:本文中的quantum.openstack.common.rpc.create_connection函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。