本文整理汇总了Python中neutron.common.rpc.get_client函数的典型用法代码示例。如果您正苦于以下问题:Python get_client函数的具体用法?Python get_client怎么用?Python get_client使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_client函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, topic):
self.topic = topic
target = oslo_messaging.Target(
topic=self.topic,
version=self.API_VERSION)
self.client = n_rpc.get_client(target)
开发者ID:openstack,项目名称:group-based-policy,代码行数:7,代码来源:controller.py
示例2: __init__
def __init__(self):
self.stub = resources_rpc.ResourcesPullRpcApi()
target = oslo_messaging.Target(
topic=trunk_consts.TRUNK_BASE_TOPIC,
version=self.VERSION,
namespace=trunk_consts.TRUNK_BASE_NAMESPACE)
self.rpc_client = n_rpc.get_client(target)
开发者ID:cubeek,项目名称:neutron,代码行数:7,代码来源:agent.py
示例3: __init__
def __init__(self, topic):
self.topic = topic
target = messaging.Target(topic=self.topic,
version=self.API_VERSION)
self.client = n_rpc.get_client(target)
self.cctxt = self.client.prepare(version=self.API_VERSION,
topic=self.topic)
开发者ID:ashutosh-mishra,项目名称:group-based-policy,代码行数:7,代码来源:transport.py
示例4: __init__
def __init__(self, topic):
self.topic = topic
target = oslo_messaging.Target(topic=topic,
version=self.BASE_RPC_API_VERSION,
namespace=None)
self.client = n_rpc.get_client(target)
开发者ID:XiaolongHu,项目名称:neutron_agent,代码行数:7,代码来源:mechanism_h3c.py
示例5: _setup_rpc
def _setup_rpc(self):
self.agent_id = 'hyperv_%s' % platform.node()
self.topic = topics.AGENT
self.plugin_rpc = agent_rpc.PluginApi(topics.PLUGIN)
self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
# RPC network init
self.context = context.get_admin_context_without_session()
# Handle updates from service
self.endpoints = [self]
# Define the listening consumers for the agent
consumers = [[topics.PORT, topics.UPDATE],
[topics.NETWORK, topics.DELETE],
[topics.PORT, topics.DELETE],
[TUNNEL, topics.UPDATE]]
self.connection = agent_rpc.create_consumers(self.endpoints,
self.topic,
consumers)
self.client = n_rpc.get_client(self.target)
self.sec_groups_agent = HyperVSecurityAgent(
self.context, self.sg_plugin_rpc)
report_interval = CONF.AGENT.report_interval
if report_interval:
heartbeat = loopingcall.FixedIntervalLoopingCall(
self._report_state)
heartbeat.start(interval=report_interval)
开发者ID:dhanunjaya,项目名称:neutron,代码行数:30,代码来源:l2_agent.py
示例6: __init__
def __init__(self):
target = oslo_messaging.Target(
topic=log_const.LOGGING_PLUGIN,
version='1.0',
namespace=log_const.RPC_NAMESPACE_LOGGING)
self.rpc_client = n_rpc.get_client(target)
开发者ID:cubeek,项目名称:neutron,代码行数:7,代码来源:agent.py
示例7: __init__
def __init__(self, topic, host):
self.host = host
target = oslo_messaging.Target(
topic=topic,
namespace=n_const.RPC_NAMESPACE_DHCP_PLUGIN,
version='1.0')
self.client = n_rpc.get_client(target)
开发者ID:gotostack,项目名称:neutron,代码行数:7,代码来源:agent.py
示例8: __init__
def __init__(self, topic, host):
topic = topic if topic else const.FTNT_AGENT
self.host = host
fgt_target = oslo_messaging.Target(
topic=topic, version='1.0')
self.context = n_context.get_admin_context_without_session()
self.fgt_client = n_rpc.get_client(fgt_target)
开发者ID:samsu,项目名称:networking-fortinet,代码行数:7,代码来源:fortinet_agent_rpc.py
示例9: __init__
def __init__(self, topic=topics.DHCP_AGENT, plugin=None):
self._unsubscribed_resources = []
self._plugin = plugin
target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
# register callbacks for router interface changes
registry.subscribe(self._after_router_interface_created,
resources.ROUTER_INTERFACE, events.AFTER_CREATE)
registry.subscribe(self._after_router_interface_deleted,
resources.ROUTER_INTERFACE, events.AFTER_DELETE)
# register callbacks for events pertaining resources affecting DHCP
callback_resources = (
resources.NETWORK,
resources.NETWORKS,
resources.PORT,
resources.PORTS,
resources.SUBNET,
resources.SUBNETS,
)
if not cfg.CONF.dhcp_agent_notification:
return
for resource in callback_resources:
registry.subscribe(self._send_dhcp_notification,
resource, events.BEFORE_RESPONSE)
self.uses_native_notifications = {}
for resource in (resources.NETWORK, resources.PORT, resources.SUBNET):
self.uses_native_notifications[resource] = {'create': False,
'update': False,
'delete': False}
registry.subscribe(self._native_event_send_dhcp_notification,
resource, events.AFTER_CREATE)
registry.subscribe(self._native_event_send_dhcp_notification,
resource, events.AFTER_UPDATE)
registry.subscribe(self._native_event_send_dhcp_notification,
resource, events.AFTER_DELETE)
开发者ID:2020human,项目名称:neutron,代码行数:35,代码来源:dhcp_rpc_agent_api.py
示例10: __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
示例11: _create_rpc_publisher
def _create_rpc_publisher(self):
self.topic = constants.TOPIC_LOADBALANCER_AGENT_V2
if self.driver.env:
self.topic = self.topic + "_" + self.driver.env
target = messaging.Target(topic=self.topic,
version=constants.BASE_RPC_API_VERSION)
self._client = rpc.get_client(target, version_cap=None)
开发者ID:F5Networks,项目名称:f5-openstack-lbaasv2-driver,代码行数:7,代码来源:agent_rpc.py
示例12: __init__
def __init__(self, host):
# NOTE(yamamoto): super.__init__() call here is not only for
# aesthetics. Because of multiple inheritances in MeteringAgent,
# it's actually necessary to initialize parent classes of
# manager.Manager correctly.
super(MeteringPluginRpc, self).__init__()
target = oslo_messaging.Target(topic=topics.METERING_PLUGIN, version="1.0")
self.client = n_rpc.get_client(target)
开发者ID:sebrandon1,项目名称:neutron,代码行数:8,代码来源:metering_agent.py
示例13: __init__
def __init__(self, sc):
self.sc = sc
self.topic = const.NOTIFICATION_QUEUE
target = messaging.Target(topic=self.topic,
version=self.API_VERSION)
self.client = n_rpc.get_client(target)
self.cctxt = self.client.prepare(version=self.API_VERSION,
topic=self.topic)
开发者ID:openstack,项目名称:group-based-policy,代码行数:8,代码来源:agent_base.py
示例14: __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
示例15: __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
示例16: __init__
def __init__(self, topic, context, use_namespaces):
self.context = context
self.host = cfg.CONF.host
self.use_namespaces = use_namespaces
target = oslo_messaging.Target(
topic=topic,
namespace=constants.RPC_NAMESPACE_DHCP_PLUGIN,
version='1.0')
self.client = n_rpc.get_client(target)
开发者ID:bradleyjones,项目名称:neutron,代码行数:9,代码来源:agent.py
示例17: __init__
def __init__(self, topic=topics.AGENT):
self.topic = topic
self.topic_bgpvpn_update = topics.get_topic_name(self.topic,
topics_BAGPIPE_BGPVPN,
topics.UPDATE)
target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
开发者ID:ythomas1,项目名称:networking-bagpipe,代码行数:9,代码来源:rpc_client.py
示例18: __new__
def __new__(cls):
# make it a singleton
if not hasattr(cls, '_instance'):
cls._instance = super(ResourcesPullRpcApi, cls).__new__(cls)
target = oslo_messaging.Target(
topic=topics.PLUGIN, version='1.0',
namespace=constants.RPC_NAMESPACE_RESOURCES)
cls._instance.client = n_rpc.get_client(target)
return cls._instance
开发者ID:cybertan,项目名称:neutron,代码行数:9,代码来源:resources_rpc.py
示例19: __init__
def __init__(self, topic=topics.DHCP_AGENT, plugin=None):
self._plugin = plugin
target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
# register callbacks for router interface changes
registry.subscribe(self._after_router_interface_created,
resources.ROUTER_INTERFACE, events.AFTER_CREATE)
registry.subscribe(self._after_router_interface_deleted,
resources.ROUTER_INTERFACE, events.AFTER_DELETE)
开发者ID:ISCAS-VDI,项目名称:neutron-base,代码行数:9,代码来源:dhcp_rpc_agent_api.py
示例20: __init__
def __init__(self, topic=topics.CASCADING_SERVICE):
target = oslo_messaging.Target(topic=topic,
exchange="tricircle",
namespace="networking",
version='1.0',
fanout=True)
self.client = n_rpc.get_client(
target,
serializer=Serializer(),
)
开发者ID:hannibalhuang,项目名称:tricircle,代码行数:10,代码来源:cascading_networking_api.py
注:本文中的neutron.common.rpc.get_client函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论