class DhcpPluginApi(object):
"""Agent side of the dhcp rpc API.
+ This class implements the client side of an rpc interface. The server side
+ of this interface can be found in
+ neutron.api.rpc.handlers.dhcp_rpc.DhcpRpcCallback. For more information
+ about changing rpc interfaces, see doc/source/devref/rpc_api.rst.
+
API version history:
1.0 - Initial version.
1.1 - Added get_active_networks_info, create_dhcp_port,
self.context = context
self.host = cfg.CONF.host
self.use_namespaces = use_namespaces
- target = messaging.Target(topic=topic, version='1.0')
+ target = messaging.Target(
+ topic=topic,
+ namespace=constants.RPC_NAMESPACE_DHCP_PLUGIN,
+ version='1.0')
self.client = n_rpc.get_client(target)
def get_active_networks_info(self):
class DhcpRpcCallback(object):
- """DHCP agent RPC callback in plugin implementations."""
+ """DHCP agent RPC callback in plugin implementations.
+
+ This class implements the server side of an rpc interface. The client
+ side of this interface can be found in
+ neutron.agent.dhcp_agent.DhcpPluginApi. For more information about
+ changing rpc interfaces, see doc/source/devref/rpc_api.rst.
+ """
# API version history:
# 1.0 - Initial version.
# 1.1 - Added get_active_networks_info, create_dhcp_port,
# and update_dhcp_port methods.
- target = messaging.Target(version='1.1')
+ target = messaging.Target(namespace=constants.RPC_NAMESPACE_DHCP_PLUGIN,
+ version='1.1')
def _get_active_networks(self, context, **kwargs):
"""Retrieve and return a list of the active networks."""
# In SQLite integer can be stored in 1, 2, 3, 4, 6, or 8 bytes,
# but here it will be limited by this value for consistency.
DB_INTEGER_MAX_VALUE = 2 ** 31 - 1
+
+# RPC Interface for agents to call DHCP API implemented on the plugin side
+RPC_NAMESPACE_DHCP_PLUGIN = 'dhcp'