# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2014 Midokura SARL.
# 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.

from midonet.neutron.common import util

from neutron.api.v2 import base

CREATE = base.Controller.CREATE
DELETE = base.Controller.DELETE
LIST = base.Controller.LIST
SHOW = base.Controller.SHOW
UPDATE = base.Controller.UPDATE


@util.generate_methods(LIST, SHOW, CREATE, UPDATE, DELETE)
class TunnelzoneHandlerMixin(object):
    """The mixin of the request handler for the tunnel zones."""


@util.generate_methods(LIST, SHOW, CREATE, UPDATE, DELETE)
class TunnelzonehostHandlerMixin(object):
    """The mixin of the request handler for the tunnel zone hosts."""


class MidoNetApiMixin(TunnelzoneHandlerMixin,
                      TunnelzonehostHandlerMixin):
    """MidoNet REST API plugin."""

Add Tunnel Zone and Tunnel Zone Host API handlers
Add Tunnel Zone and Tunnel Zone Host API handlers

This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.

This patch also adds symbols for 'list', 'show', 'create', 'update'
and 'delete'. It'd be too easy to have typos for them and I added
symbols for them to make it easier to detect typos using the static
checker.

Change-Id: Ia652c5afa0e00a358325b80d6c6dab27152ced56
Signed-off-by: Taku Fukushima <48ddf7139da17a0278f1f27e611ac6b9304f94b2@midokura.com>
