]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Provide doc string pointers for the dhcp agent rpc api
authorRussell Bryant <rbryant@redhat.com>
Wed, 17 Dec 2014 19:55:43 +0000 (19:55 +0000)
committerRussell Bryant <rbryant@redhat.com>
Fri, 9 Jan 2015 16:21:01 +0000 (11:21 -0500)
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
neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py

index 41633a1e76f0dc3763c1f8c9d325f73e555b8117..4e2063aea1fccc97bc587f4f70b1ca71805375f0 100644 (file)
@@ -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.")),
index 775f41352a73fa3db293838c20a7e3c8f17e18c3..815444305c5e17928ebb2a586de79e75a7673e4d 100644 (file)
@@ -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',