• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python topics.get_topic_name函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

 def __init__(self, topic):
     super(AgentNotifierApi, self).__init__(
         topic=topic, default_version=self.BASE_RPC_API_VERSION)
     self.topic_network_delete = topics.get_topic_name(
         topic, topics.NETWORK, topics.DELETE)
     self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
                                                    topics.UPDATE)
开发者ID:asadoughi,项目名称:neutron,代码行数:7,代码来源:rpc.py


示例2: __init__

 def __init__(self, topic):
     target = oslo_messaging.Target(
         topic=topic, version=self.BASE_RPC_API_VERSION)
     self.client = n_rpc.get_client(target)
     self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
                                                    topics.UPDATE)
     self.topic_subnet_update = topics.get_topic_name(topic, topics.SUBNET,
                                                      topics.UPDATE)
开发者ID:p4cket,项目名称:python-opflex-agent,代码行数:8,代码来源:rpc.py


示例3: __init__

    def __init__(self, topic):
        self.topic = topic
        self.topic_network_delete = topics.get_topic_name(topic, topics.NETWORK, topics.DELETE)
        self.topic_port_update = topics.get_topic_name(topic, topics.PORT, topics.UPDATE)
        self.topic_port_delete = topics.get_topic_name(topic, topics.PORT, topics.DELETE)

        target = oslo_messaging.Target(topic=topic, version="1.0")
        self.client = n_rpc.get_client(target)
开发者ID:zhukejian111,项目名称:neutron,代码行数:8,代码来源:rpc.py


示例4: __init__

 def __init__(self, topic=topics.SERVICEVM_AGENT):
     super(ServiceVMAgentNotifyApi, self).__init__(
         topic=topic, default_version=self.BASE_RPC_API_VERSION)
     self.topic_subnet_delete = topics.get_topic_name(topic,
                                               topics.SUBNET,
                                               topics.DELETE)
     self.topic_subnet_create = topics.get_topic_name(topic,
                                               topics.SUBNET,
                                               topics.CREATE)
     self.topic_subnet_update = topics.get_topic_name(topic,
                                               topics.SUBNET,
                                               topics.UPDATE)
开发者ID:CingHu,项目名称:neutron-ustack,代码行数:12,代码来源:rpc.py


示例5: __init__

    def __init__(self, agent_type, connection, int_br=None, tun_br=None):

        """Create a new BaGPipe-BGP REST service client.

        :param agent_type: bagpipe-bgp agent type (Linux bridge or OVS)
        :param connection: RPC Connection
        :param int_br: OVS integration bridge
        :param tun_br: OVS tunnel bridge
        """
        super(BaGPipeBGPAgent, self).__init__(
            cfg.CONF.BAGPIPE.bagpipe_bgp_ip, cfg.CONF.BAGPIPE.bagpipe_bgp_port, agent_type
        )

        self.agent_type = agent_type

        self.ping_interval = cfg.CONF.BAGPIPE.ping_interval

        self.reg_attachments = defaultdict(list)
        self.gateway_info_for_net = defaultdict(default_gw_info)

        self.bagpipe_bgp_status = self.BAGPIPEBGP_DOWN
        self.seq_num = 0

        # OVS-specific variables:
        if self.agent_type == n_const.AGENT_TYPE_OVS:
            self.int_br = int_br
            self.tun_br = tun_br
            self.setup_mpls_br(cfg.CONF.BAGPIPE.mpls_bridge)

        # RPC setpup
        if self.agent_type == n_const.AGENT_TYPE_LINUXBRIDGE:
            connection.create_consumer(
                topics.get_topic_name(topics.AGENT, topics_BAGPIPE, topics.UPDATE, cfg.CONF.host), [self], fanout=False
            )
        else:
            LOG.info("bagpipe-l2 RPCs disabled for OVS bridge")

        connection.create_consumer(
            topics.get_topic_name(topics.AGENT, topics_BAGPIPE_BGPVPN, topics.UPDATE), [self], fanout=True
        )
        connection.create_consumer(
            topics.get_topic_name(topics.AGENT, topics_BAGPIPE_BGPVPN, topics.UPDATE, cfg.CONF.host),
            [self],
            fanout=False,
        )

        # Starts a greenthread for bagpipe-bgp status polling
        self._start_bagpipe_bgp_status_polling(self.ping_interval)
开发者ID:ythomas1,项目名称:networking-bagpipe,代码行数:48,代码来源:bagpipe_bgp_agent.py


示例6: __init__

    def __init__(self, topic):
        super(AgentNotifierApi, self).__init__(
            topic=topic, default_version=self.BASE_RPC_API_VERSION)

        self.topic_info_update = topics.get_topic_name(topic,
                                                       constants.INFO,
                                                       topics.UPDATE)
开发者ID:brucezy,项目名称:neutron,代码行数:7,代码来源:sdnve_neutron_plugin.py


示例7: __init__

 def __init__(self, topic=topics.AGENT):
     self.topic = topic
     self.topic_l2pop_update = topics.get_topic_name(topic,
                                                     topics.L2POPULATION,
                                                     topics.UPDATE)
     target = oslo_messaging.Target(topic=topic, version='1.0')
     self.client = n_rpc.get_client(target)
开发者ID:21atlas,项目名称:neutron,代码行数:7,代码来源:rpc.py


示例8: __init__

    def __init__(self, topic=topics.AGENT):
        super(L2populationAgentNotifyAPI, self).__init__(
            topic=topic, default_version=self.BASE_RPC_API_VERSION)

        self.topic_l2pop_update = topics.get_topic_name(topic,
                                                        topics.L2POPULATION,
                                                        topics.UPDATE)
开发者ID:NKSG,项目名称:neutron,代码行数:7,代码来源:rpc.py


示例9: create_consumers

def create_consumers(endpoints, prefix, topic_details):
    """Create agent RPC consumers.

    :param endpoints: The list of endpoints to process the incoming messages.
    :param prefix: Common prefix for the plugin/agent message queues.
    :param topic_details: A list of topics. Each topic has a name, an
                          operation, and an optional host param keying the
                          subscription to topic.host for plugin calls.

    :returns: A common Connection.
    """

    connection = n_rpc.create_connection(new=True)
    for details in topic_details:
        topic, operation, node_name = itertools.islice(
            itertools.chain(details, [None]), 3)

        topic_name = topics.get_topic_name(prefix, topic, operation)
        connection.create_consumer(topic_name, endpoints, fanout=True)
        if node_name:
            node_topic_name = '%s.%s' % (topic_name, node_name)
            connection.create_consumer(node_topic_name,
                                       endpoints,
                                       fanout=False)
    connection.consume_in_threads()
    return connection
开发者ID:absolutarin,项目名称:neutron,代码行数:26,代码来源:rpc.py


示例10: __init__

 def __init__(self, topic):
     self.topic = topic
     self.topic_network_delete = topics.get_topic_name(topic,
                                                       topics.NETWORK,
                                                       topics.DELETE)
     self.topic_port_update = topics.get_topic_name(topic,
                                                    topics.PORT,
                                                    topics.UPDATE)
     self.topic_port_delete = topics.get_topic_name(topic,
                                                    topics.PORT,
                                                    topics.DELETE)
     self.topic_tunnel_update = topics.get_topic_name(topic,
                                                      constants.TUNNEL,
                                                      topics.UPDATE)
     target = messaging.Target(topic=topic, version='1.0')
     self.client = n_rpc.get_client(target)
开发者ID:CiscoSystems,项目名称:neutron,代码行数:16,代码来源:agent_notifier_api.py


示例11: set_port_type

    def set_port_type(self, context, ports_info):      
        LOG.debug(_('set_port_type:%(ports_info)s'),{'ports_info':ports_info})
        
        if not ports_info.get('host_id', None):
            return  
                
        self.topic_sc_create = constants.SERVICECHAIN_AGENT_TOPIC
        
        hosts_flows = {}
        if not hosts_flows.has_key(ports_info['host_id']):
            hosts_flows[ports_info['host_id']] = []
        hosts_flows[ports_info['host_id']].append(ports_info)        
        
        
        for host in hosts_flows:
            LOG.debug(_('add flows to host %(host)s, flows:%(flows)s'),
                      {'host':host, 'flows':hosts_flows[host]})

        topic = topics.get_topic_name(self.topic,
                                      'port_type',
                                      'set',
                                      ports_info['host_id'])                                   
        self.cast(context,
                      self.make_msg('set_port_type',
                                    ports_info=hosts_flows[host]),
                                    topic=topic)
开发者ID:nkapotoxin,项目名称:fs_spc111t_plus_hc,代码行数:26,代码来源:rpc.py


示例12: test_delete_network

 def test_delete_network(self):
     rpcapi = plugin_rpc.AgentNotifierApi(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              topics.NETWORK,
                                              topics.DELETE),
                        'network_delete', rpc_method='fanout_cast',
                        network_id='fake_request_spec')
开发者ID:cisco-pnsc,项目名称:neutron,代码行数:8,代码来源:test_rpcapi.py


示例13: test_tunnel_update

 def test_tunnel_update(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              constants.TUNNEL,
                                              topics.UPDATE),
                        'tunnel_update', rpc_method='fanout_cast',
                        tunnel_ip='fake_ip', tunnel_id='fake_id')
开发者ID:CiscoSystems,项目名称:quantum,代码行数:8,代码来源:test_ovs_rpcapi.py


示例14: test_tunnel_update

 def test_tunnel_update(self):
     rpcapi = plugin_rpc.AgentNotifierApi(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              type_tunnel.TUNNEL,
                                              topics.UPDATE),
                        'tunnel_update', rpc_method='fanout_cast',
                        tunnel_ip='fake_ip', tunnel_type='gre')
开发者ID:cisco-pnsc,项目名称:neutron,代码行数:8,代码来源:test_rpcapi.py


示例15: test_device_delete

 def test_device_delete(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              ovsvapp_const.DEVICE,
                                              topics.DELETE),
                        'device_delete', rpc_method='call',
                        network_info='fake_network_info',
                        host=FAKE_HOST)
开发者ID:wsronek,项目名称:networking-vsphere,代码行数:9,代码来源:test_ovsvapp_rpc.py


示例16: enhanced_sg_provider_updated

 def enhanced_sg_provider_updated(self, context, network_id):
     sg_topic = ovsvapp_const.OVSVAPP + '_' + topics.SECURITY_GROUP
     cctxt = self.client.prepare(
         topic=topics.get_topic_name(self.topic,
                                     sg_topic,
                                     topics.UPDATE),
         fanout=True)
     cctxt.cast(context, 'enhanced_sg_provider_updated',
                network_id=network_id)
开发者ID:maestropandy,项目名称:networking-vsphere,代码行数:9,代码来源:ovsvapp_rpc.py


示例17: test_port_delete

 def test_port_delete(self):
     rpcapi = plugin_rpc.AgentNotifierApi(topics.AGENT)
     self._test_rpc_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT,
                               topics.PORT,
                               topics.DELETE),
         'port_delete', rpc_method='cast',
         fanout=True, port_id='fake_port')
开发者ID:eayunstack,项目名称:neutron,代码行数:9,代码来源:test_rpc.py


示例18: test_delete_network

 def test_delete_network(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_neutron_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, topics.NETWORK, topics.DELETE),
         "network_delete",
         rpc_method="fanout_cast",
         network_id="fake_request_spec",
     )
开发者ID:kinglongchen,项目名称:neutron,代码行数:9,代码来源:test_hyperv_rpcapi.py


示例19: test_port_delete

 def test_port_delete(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_neutron_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, topics.PORT, topics.DELETE),
         "port_delete",
         rpc_method="fanout_cast",
         port_id="port_id",
     )
开发者ID:kinglongchen,项目名称:neutron,代码行数:9,代码来源:test_hyperv_rpcapi.py


示例20: test_enhanced_sg_provider_updated

 def test_enhanced_sg_provider_updated(self):
     rpcapi = ovsvapp_rpc.OVSvAppAgentNotifyAPI(topics.AGENT)
     self._test_rpc_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              self.sg_topic,
                                              topics.UPDATE),
                        'enhanced_sg_provider_updated', rpc_method='cast',
                        fanout=True,
                        network_id=FAKE_NETWORK_ID)
开发者ID:VTabolin,项目名称:networking-vsphere,代码行数:9,代码来源:test_ovsvapp_rpc.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.compare_elements函数代码示例发布时间:2022-05-27
下一篇:
Python rpc.init函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap