From bc686f530ed56494746345a9e48ace694b005f05 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 17 Dec 2014 19:55:43 +0000 Subject: [PATCH] Provide doc string pointers for the dhcp agent rpc api There is an rpc interface defined for the Neutron plugin to be able to execute methods in the DHCP agent. Provide docstring pointers in the client and server side that tells you where to find the other side of the interface. No namespace usage is needed here. This API is the only one exposed via the DHCP agent, so the default namespace used now is fine. The DhcpAgent class was updated to explicitly define the messaging.Target(). Previously it was using the equivalent one defined in the Manager base class. Having it specified here makes it more obvious that this is an rpc endpoint, and also provides the obvious place that must have the version updated if the interface is changed. Part of blueprint rpc-docs-and-namespaces. Change-Id: I4a6eb8dacb9ba01f329a5d5961dc0e0ee6f780ba --- neutron/agent/dhcp_agent.py | 10 ++++++++++ neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/neutron/agent/dhcp_agent.py b/neutron/agent/dhcp_agent.py index 41633a1e7..4e2063aea 100644 --- a/neutron/agent/dhcp_agent.py +++ b/neutron/agent/dhcp_agent.py @@ -48,6 +48,16 @@ LOG = logging.getLogger(__name__) class DhcpAgent(manager.Manager): + """DHCP agent service manager. + + Note that the public methods of this class are exposed as the server side + of an rpc interface. The neutron server uses + neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.DhcpAgentNotifyApi as the + client side to execute the methods here. For more information about + changing rpc interfaces, see doc/source/devref/rpc_api.rst. + """ + target = messaging.Target(version='1.0') + OPTS = [ cfg.IntOpt('resync_interval', default=5, help=_("Interval to resync.")), diff --git a/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py b/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py index 775f41352..815444305 100644 --- a/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py +++ b/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py @@ -28,7 +28,12 @@ LOG = logging.getLogger(__name__) class DhcpAgentNotifyAPI(object): - """API for plugin to notify DHCP agent.""" + """API for plugin to notify DHCP agent. + + This class implements the client side of an rpc interface. The server side + is neutron.agent.dhcp_agent.DhcpAgent. For more information about changing + rpc interfaces, please see doc/source/devref/rpc_api.rst. + """ # It seems dhcp agent does not support bulk operation VALID_RESOURCES = ['network', 'subnet', 'port'] VALID_METHOD_NAMES = ['network.create.end', -- 2.45.2