import oslo_messaging
from oslo_utils import timeutils
+from neutron.common import constants
from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron.i18n import _LW
class PluginReportStateAPI(object):
+ """RPC client used to report state back to plugin.
+
+ This class implements the client side of an rpc interface. The server side
+ can be found in neutron.db.agents_db.AgentExtRpcCallback. For more
+ information on changing rpc interfaces, see doc/source/devref/rpc_api.rst.
+ """
def __init__(self, topic):
- target = oslo_messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0',
+ namespace=constants.RPC_NAMESPACE_STATE)
self.client = n_rpc.get_client(target)
def report_state(self, context, agent_state, use_call=False):
RPC_NAMESPACE_SECGROUP = 'secgroup'
# RPC interface for agent to plugin DVR api
RPC_NAMESPACE_DVR = 'dvr'
+# RPC interface for reporting state back to the plugin
+RPC_NAMESPACE_STATE = 'report_state'
from sqlalchemy import sql
from neutron.api.v2 import attributes
+from neutron.common import constants
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import agent as ext_agent
class AgentExtRpcCallback(object):
- """Processes the rpc report in plugin implementations."""
+ """Processes the rpc report in plugin implementations.
- target = oslo_messaging.Target(version='1.0')
+ This class implements the server side of an rpc interface. The client side
+ can be found in neutron.agent.rpc.PluginReportStateAPI. For more
+ information on changing rpc interfaces, see doc/source/devref/rpc_api.rst.
+ """
+
+ target = oslo_messaging.Target(version='1.0',
+ namespace=constants.RPC_NAMESPACE_STATE)
START_TIME = timeutils.utcnow()
def __init__(self, plugin=None):