本文整理汇总了Python中neutron.common.topics.get_topic_name函数的典型用法代码示例。如果您正苦于以下问题:Python get_topic_name函数的具体用法?Python get_topic_name怎么用?Python get_topic_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_topic_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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)
示例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')
示例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')
示例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')
示例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)