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