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
This commit is contained in:
parent
6df7f5abf1
commit
bc686f530e
|
@ -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.")),
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue