23f7da3021
In L2 agent extensions, when the agent extension needed access to a datastructure within the L2 agent, an agent extension API object was created. This API object would be the interface permitting agent extensions to have access to those objects internal to the L2 agent. This change implements a similar agent extension API object for the L3 agent extensions. This is necessary to allow L3 agent extensions to have access to the RouterInfo class, so that they can do lookups on it, for example determining the namespace for a specific router. Without this API object, the L3 agent extension would not have access to this structure. Co-Authored-By: Margaret Frances <margaret_frances@cable.comcast.com> Partially-Implements: blueprint l3-agent-extensions Change-Id: I85f89accbeefd820130335674fd56cb54f1449de
56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
import abc
|
|
|
|
import six
|
|
|
|
from neutron.agent import agent_extension
|
|
|
|
|
|
@six.add_metaclass(abc.ABCMeta)
|
|
class L3AgentCoreResourceExtension(agent_extension.AgentExtension):
|
|
"""Define stable abstract interface for l3 agent extensions.
|
|
|
|
An agent extension extends the agent core functionality.
|
|
"""
|
|
|
|
@abc.abstractmethod
|
|
def add_router(self, context, data):
|
|
"""add agent extension for router.
|
|
|
|
Called on router create.
|
|
|
|
:param context: rpc context
|
|
:param data: router data
|
|
"""
|
|
|
|
@abc.abstractmethod
|
|
def update_router(self, context, data):
|
|
"""Handle agent extension for update.
|
|
|
|
Called on router update.
|
|
|
|
:param context: rpc context
|
|
:param data: router data
|
|
"""
|
|
|
|
@abc.abstractmethod
|
|
def delete_router(self, context, data):
|
|
"""Delete router from agent extension.
|
|
|
|
:param context: rpc context
|
|
:param data: router data
|
|
"""
|