| 1 |
# Copyright (C) 2015 Ericsson AB |
| 2 |
# Copyright (c) 2015 Gigamon |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 |
# not use this file except in compliance with the License. You may obtain |
| 6 |
# a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 |
# License for the specific language governing permissions and limitations |
| 14 |
# under the License. |
| 15 |
|
| 16 |
from neutron_lib import rpc as n_rpc |
| 17 |
import oslo_messaging as messaging |
| 18 |
|
| 19 |
|
| 20 |
class TaasPluginApiMixin: |
| 21 |
|
| 22 |
# Currently there are no Calls the Agent makes towards the Plugin. |
| 23 |
|
| 24 |
def __init__(self, topic, host): |
| 25 |
self.host = host |
| 26 |
target = messaging.Target(topic=topic, version='1.0') |
| 27 |
self.client = n_rpc.get_client(target) |
| 28 |
super().__init__() |
| 29 |
|
| 30 |
|
| 31 |
class TaasAgentRpcCallbackMixin: |
| 32 |
"""Mixin for Taas agent Implementations.""" |
| 33 |
|
| 34 |
def __init__(self): |
| 35 |
super().__init__() |
| 36 |
|
| 37 |
def consume_api(self, agent_api): |
| 38 |
"""Receive neutron agent API object |
| 39 |
|
| 40 |
Allows an extension to gain access to resources internal to the |
| 41 |
neutron agent and otherwise unavailable to the extension. |
| 42 |
""" |
| 43 |
self.agent_api = agent_api |
| 44 |
|
| 45 |
def create_tap_service(self, context, tap_service_msg, host): |
| 46 |
"""Handle RPC cast from plugin to create a tap service.""" |
| 47 |
pass |
| 48 |
|
| 49 |
def delete_tap_service(self, context, tap_service_msg, host): |
| 50 |
"""Handle RPC cast from plugin to delete a tap service.""" |
| 51 |
pass |
| 52 |
|
| 53 |
def create_tap_flow(self, context, tap_flow_msg, host): |
| 54 |
"""Handle RPC cast from plugin to create a tap flow""" |
| 55 |
pass |
| 56 |
|
| 57 |
def delete_tap_flow(self, context, tap_flow_msg, host): |
| 58 |
"""Handle RPC cast from plugin to delete a tap flow""" |
| 59 |
pass |
| 60 |
|
| 61 |
def create_tap_mirror(self, context, tap_mirror_msg, host): |
| 62 |
"""Handle RPC cast from plugin to create a Tap Mirror.""" |
| 63 |
pass |
| 64 |
|
| 65 |
def delete_tap_mirror(self, context, tap_mirror_msg, host): |
| 66 |
"""Handle RPC cast from plugin to delete a Tap Mirror.""" |
| 67 |
pass |