From: Miguel Angel Ajo Date: Fri, 19 Jun 2015 14:45:13 +0000 (+0200) Subject: QoS service plugin stub X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2ff19be1db96f97b833052af633abda55f497f1d;p=openstack-build%2Fneutron-build.git QoS service plugin stub This patch introduces the QoS service plugin which implements a stub of the API extension. This is patch is a basic step to be able to create an experimental job enabling this service so we can do api tests. Change-Id: Ib583e98c232ca628ba2a4bd48527eb84584c6212 --- diff --git a/doc/source/devref/quality_of_service.rst b/doc/source/devref/quality_of_service.rst new file mode 100644 index 000000000..e69de29bb diff --git a/etc/neutron.conf b/etc/neutron.conf index f5a6da627..d2b838f25 100755 --- a/etc/neutron.conf +++ b/etc/neutron.conf @@ -75,7 +75,7 @@ # of its entrypoint name. # # service_plugins = -# Example: service_plugins = router,firewall,lbaas,vpnaas,metering +# Example: service_plugins = router,firewall,lbaas,vpnaas,metering,qos # Paste configuration file # api_paste_config = api-paste.ini diff --git a/neutron/plugins/common/constants.py b/neutron/plugins/common/constants.py index 659c8d948..df2638e22 100644 --- a/neutron/plugins/common/constants.py +++ b/neutron/plugins/common/constants.py @@ -32,12 +32,13 @@ EXT_TO_SERVICE_MAPPING = { 'fwaas': FIREWALL, 'vpnaas': VPN, 'metering': METERING, - 'router': L3_ROUTER_NAT + 'router': L3_ROUTER_NAT, + 'qos': QOS, } # TODO(salvatore-orlando): Move these (or derive them) from conf file ALLOWED_SERVICES = [CORE, DUMMY, LOADBALANCER, FIREWALL, VPN, METERING, - L3_ROUTER_NAT, LOADBALANCERV2] + L3_ROUTER_NAT, LOADBALANCERV2, QOS] COMMON_PREFIXES = { CORE: "", @@ -48,6 +49,7 @@ COMMON_PREFIXES = { VPN: "/vpn", METERING: "/metering", L3_ROUTER_NAT: "", + QOS: "/qos", } # Service operation status constants diff --git a/neutron/services/qos/__init__.py b/neutron/services/qos/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/neutron/services/qos/qos_plugin.py b/neutron/services/qos/qos_plugin.py new file mode 100644 index 000000000..072c8f635 --- /dev/null +++ b/neutron/services/qos/qos_plugin.py @@ -0,0 +1,85 @@ +# Copyright (c) 2015 Red Hat Inc. +# 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 neutron.extensions import qos + + +class QoSPlugin(qos.QoSPluginBase): + """Implementation of the Neutron QoS Service Plugin. + + This class implements a Quality of Service plugin that + provides quality of service parameters over ports and + networks. + + """ + supported_extension_aliases = ['qos'] + + def __init__(self): + super(QoSPlugin, self).__init__() + #self.register_rpc() + #self.register_port_callbacks() + #self.register_net_callbacks() + + def register_rpc(self): + # RPC support + # TODO(ajo): register ourselves to the generic RPC framework + # so we will provide QoS information for ports and + # networks. + pass + + def register_port_callbacks(self): + # TODO(qos): Register the callbacks to properly manage + # extension of resources + pass + + def register_net_callbacks(self): + # TODO(qos): Register the callbacks to properly manage + # extension of resources + pass + + def create_qos_policy(self, context, qos_policy): + pass + + def update_qos_policy(self, context, qos_policy_id, qos_policy): + pass + + def delete_qos_policy(self, context, qos_policy_id): + pass + + def get_qos_policy(self, context, qos_policy_id, fields=None): + pass + + def get_qos_policies(self, context, filters=None, fields=None, + sorts=None, limit=None, marker=None, + page_reverse=False): + pass + + def create_qos_bandwidth_limit_rule(self, context, + qos_bandwidthlimit_rule): + pass + + def update_qos_bandwidth_limit_rule(self, context, rule_id, rule): + pass + + def get_qos_bandwidth_limit_rule(self, context, rule_id, fields=None): + pass + + def delete_qos_bandwith_limit_rule(self, context, rule_id): + pass + + def get_qos_bandwith_limit_rules(self, context, filters=None, fields=None, + sorts=None, limit=None, marker=None, + page_reverse=False): + pass diff --git a/setup.cfg b/setup.cfg index f2fc00fd3..bf7f76172 100644 --- a/setup.cfg +++ b/setup.cfg @@ -143,6 +143,7 @@ neutron.service_plugins = neutron.services.loadbalancer.plugin.LoadBalancerPlugin = neutron_lbaas.services.loadbalancer.plugin:LoadBalancerPlugin neutron.services.vpn.plugin.VPNDriverPlugin = neutron_vpnaas.services.vpn.plugin:VPNDriverPlugin ibm_l3 = neutron.services.l3_router.l3_sdnve:SdnveL3ServicePlugin + qos = neutron.services.qos.qos_plugin:QoSPlugin neutron.service_providers = # These are for backwards compat with Juno firewall service provider configuration values neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver = neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas:IptablesFwaasDriver