From e7b001b31588bf8abd990fce31a518980d77730f Mon Sep 17 00:00:00 2001 From: Eugene Nikanorov Date: Thu, 17 Jul 2014 14:23:49 +0400 Subject: [PATCH] Flavor Framework implementation This patch introduces API and DB plugin for flavor framework. API adds Flavors and Service Profiles which are resources available only for admins to operate. This framework then should be leveraged by advanced services. Included tempest API tests in neutron tree Implements: blueprint neutron-flavor-framework Change-Id: I99ba0ce520ae3d8696eca5c994777c7d5ba3d4b1 Co-Authored-By: Doug Wiegley Co-Authored-By: Madhusudhan Kandadai --- etc/policy.json | 13 ++++++++++++- neutron/db/migration/models/head.py | 1 + neutron/tests/etc/policy.json | 13 ++++++++++++- .../tempest/services/network/json/network_client.py | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/etc/policy.json b/etc/policy.json index eaf6d685..72756bdb 100644 --- a/etc/policy.json +++ b/etc/policy.json @@ -163,5 +163,16 @@ "get_service_provider": "rule:regular_user", "get_lsn": "rule:admin_only", - "create_lsn": "rule:admin_only" + "create_lsn": "rule:admin_only", + + "create_flavor": "rule:admin_only", + "update_flavor": "rule:admin_only", + "delete_flavor": "rule:admin_only", + "get_flavors": "rule:regular_user", + "get_flavor": "rule:regular_user", + "create_service_profile": "rule:admin_only", + "update_service_profile": "rule:admin_only", + "delete_service_profile": "rule:admin_only", + "get_service_profiles": "rule:admin_only", + "get_service_profile": "rule:admin_only" } diff --git a/neutron/db/migration/models/head.py b/neutron/db/migration/models/head.py index 7119b4d5..09e1c73b 100644 --- a/neutron/db/migration/models/head.py +++ b/neutron/db/migration/models/head.py @@ -28,6 +28,7 @@ from neutron.db import dvr_mac_db # noqa from neutron.db import external_net_db # noqa from neutron.db import extradhcpopt_db # noqa from neutron.db import extraroute_db # noqa +from neutron.db import flavors_db # noqa from neutron.db import l3_agentschedulers_db # noqa from neutron.db import l3_attrs_db # noqa from neutron.db import l3_db # noqa diff --git a/neutron/tests/etc/policy.json b/neutron/tests/etc/policy.json index eaf6d685..72756bdb 100644 --- a/neutron/tests/etc/policy.json +++ b/neutron/tests/etc/policy.json @@ -163,5 +163,16 @@ "get_service_provider": "rule:regular_user", "get_lsn": "rule:admin_only", - "create_lsn": "rule:admin_only" + "create_lsn": "rule:admin_only", + + "create_flavor": "rule:admin_only", + "update_flavor": "rule:admin_only", + "delete_flavor": "rule:admin_only", + "get_flavors": "rule:regular_user", + "get_flavor": "rule:regular_user", + "create_service_profile": "rule:admin_only", + "update_service_profile": "rule:admin_only", + "delete_service_profile": "rule:admin_only", + "get_service_profiles": "rule:admin_only", + "get_service_profile": "rule:admin_only" } diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py index 54f264c8..4958bc51 100644 --- a/neutron/tests/tempest/services/network/json/network_client.py +++ b/neutron/tests/tempest/services/network/json/network_client.py @@ -45,7 +45,7 @@ class NetworkClientJSON(service_client.ServiceClient): # The following list represents resource names that do not require # changing underscore to a hyphen hyphen_exceptions = ["health_monitors", "firewall_rules", - "firewall_policies"] + "firewall_policies", "service_profiles"] # the following map is used to construct proper URI # for the given neutron resource service_resource_prefix_map = {