]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
QoS service plugin stub
authorMiguel Angel Ajo <mangelajo@redhat.com>
Fri, 19 Jun 2015 14:45:13 +0000 (16:45 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Mon, 29 Jun 2015 14:51:10 +0000 (17:51 +0300)
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

doc/source/devref/quality_of_service.rst [new file with mode: 0644]
etc/neutron.conf
neutron/plugins/common/constants.py
neutron/services/qos/__init__.py [new file with mode: 0644]
neutron/services/qos/qos_plugin.py [new file with mode: 0644]
setup.cfg

diff --git a/doc/source/devref/quality_of_service.rst b/doc/source/devref/quality_of_service.rst
new file mode 100644 (file)
index 0000000..e69de29
index f5a6da62767e0faea19a194e1c682f08ff19d63c..d2b838f251f332de8a4a54a0066c71e79a670219 100755 (executable)
@@ -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
index 659c8d948297f96cfc5792b7db7d37335674acac..df2638e22d55118a73dae1de977dd32240aca40c 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/neutron/services/qos/qos_plugin.py b/neutron/services/qos/qos_plugin.py
new file mode 100644 (file)
index 0000000..072c8f6
--- /dev/null
@@ -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
index f2fc00fd342a25fcef99e6265bde4449f0c10056..bf7f76172b5082bcf10d82da74cf59991c5539a2 100644 (file)
--- 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