1
# Copyright (c) 2012 OpenStack, LLC.
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
16
from quantum.common import topics
17
from quantum.openstack.common import jsonutils
18
from quantum.openstack.common import log as logging
19
from quantum.openstack.common.rpc import proxy
22
LOG = logging.getLogger(__name__)
25
class L3AgentNotifyAPI(proxy.RpcProxy):
26
"""API for plugin to notify L3 agent."""
27
BASE_RPC_API_VERSION = '1.0'
29
def __init__(self, topic=topics.L3_AGENT):
30
super(L3AgentNotifyAPI, self).__init__(
31
topic=topic, default_version=self.BASE_RPC_API_VERSION)
33
def router_deleted(self, context, router_id):
34
LOG.debug(_('Nofity agent the router %s is deleted'), router_id)
36
self.make_msg('router_deleted',
40
def routers_updated(self, context, routers):
42
LOG.debug(_('Nofity agent routers were updated:\n %s'),
43
jsonutils.dumps(routers, indent=5))
45
self.make_msg('routers_updated',
50
L3AgentNofity = L3AgentNotifyAPI()