From f2d18c2e9989f007a6576be6c9a6fcc5bcd67322 Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Thu, 7 Dec 2017 05:58:40 +0300 Subject: [PATCH] Deprecate API extensions policies Nova API extension concept is removed in Pike. These extensions have their own policies enforcement which are not needed any more. All the below policies which were added mainly for extensions are deprecated for removal- - 'os_compute_api:os-config-drive' - 'os_compute_api:os-extended-availability-zone' - 'os_compute_api:os-extended-status' - 'os_compute_api:os-extended-volumes' - 'os_compute_api:os-keypairs' - 'os_compute_api:os-server-usage' - 'os_compute_api:os-security-groups' (only from /servers APIs) - 'os_compute_api:os-flavor-rxtx' - 'os_compute_api:os-flavor-access' (only from /flavors APIs) - 'os_compute_api:image-size' Implement blueprint api-extensions-policy-removal Depends-On: I6aed4909b0e7efe9c95d1f7398db613eca05e5ce Change-Id: Ie05f4e84519f8a00ffb66ea5ee920d5c7722a66b --- nova/policies/config_drive.py | 10 ++++++- nova/policies/extended_availability_zone.py | 10 ++++++- nova/policies/extended_status.py | 10 ++++++- nova/policies/extended_volumes.py | 10 ++++++- nova/policies/flavor_access.py | 15 ++++++++++- nova/policies/flavor_rxtx.py | 10 ++++++- nova/policies/image_size.py | 10 ++++++- nova/policies/keypairs.py | 10 ++++++- nova/policies/security_groups.py | 14 +++++++++- nova/policies/server_usage.py | 10 ++++++- ...-extensions-policies-5613bc4eea59709d.yaml | 26 +++++++++++++++++++ 11 files changed, 125 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/deprecate-api-extensions-policies-5613bc4eea59709d.yaml diff --git a/nova/policies/config_drive.py b/nova/policies/config_drive.py index 6252a2271aa1..6bce5df8b347 100644 --- a/nova/policies/config_drive.py +++ b/nova/policies/config_drive.py @@ -35,7 +35,15 @@ config_drive_policies = [ 'method': 'GET', 'path': '/servers/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-config-drive" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/extended_availability_zone.py b/nova/policies/extended_availability_zone.py index 533acd1e9156..974b909175a8 100644 --- a/nova/policies/extended_availability_zone.py +++ b/nova/policies/extended_availability_zone.py @@ -35,7 +35,15 @@ extended_availability_zone_policies = [ 'method': 'GET', 'path': '/servers/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-extended-availability-zone"' + ' policy which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/extended_status.py b/nova/policies/extended_status.py index 89ed7af68d28..c65a4a2afb6a 100644 --- a/nova/policies/extended_status.py +++ b/nova/policies/extended_status.py @@ -42,7 +42,15 @@ This policy will control the visibility for a set of attributes: 'method': 'GET', 'path': '/servers/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-extended-status" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/extended_volumes.py b/nova/policies/extended_volumes.py index d561d0f34b9d..bf0202bfc824 100644 --- a/nova/policies/extended_volumes.py +++ b/nova/policies/extended_volumes.py @@ -36,7 +36,15 @@ extended_volumes_policies = [ 'method': 'GET', 'path': '/servers/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-extended-volumes" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/flavor_access.py b/nova/policies/flavor_access.py index 5a780b293a44..035812268400 100644 --- a/nova/policies/flavor_access.py +++ b/nova/policies/flavor_access.py @@ -75,7 +75,20 @@ to a flavor via an os-flavor-access API. 'method': 'PUT', 'path': '/flavors/{flavor_id}' }, - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-flavor-access" policy ' + 'for POST, PUT, GET /flavors which was added for extensions is ' + 'not needed any more. NOTE: This policy is deprecated only for ' + 'POST /flavors, PUT /flavors, GET /flavors/{flavor_id} & ' + 'GET /flavors/detail. This policy for other API operations is ' + 'still valid and not deprecated' + + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/flavor_rxtx.py b/nova/policies/flavor_rxtx.py index 8a654a867bfd..86e399b739bf 100644 --- a/nova/policies/flavor_rxtx.py +++ b/nova/policies/flavor_rxtx.py @@ -44,7 +44,15 @@ flavor_rxtx_policies = [ 'method': 'PUT', 'path': '/flavors/{flavor_id}' }, - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-flavor-rxtx" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/image_size.py b/nova/policies/image_size.py index 0a529a4bc960..1cb08a9e1ef1 100644 --- a/nova/policies/image_size.py +++ b/nova/policies/image_size.py @@ -35,7 +35,15 @@ image_size_policies = [ 'method': 'GET', 'path': '/images/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:image-size" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/keypairs.py b/nova/policies/keypairs.py index 3d9f549423c2..6dd1ea6617fe 100644 --- a/nova/policies/keypairs.py +++ b/nova/policies/keypairs.py @@ -76,7 +76,15 @@ keypairs_policies = [ 'path': '/servers/detail', 'method': 'GET' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-keypairs" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/security_groups.py b/nova/policies/security_groups.py index 0eff86e8d245..b104f1b92c1b 100644 --- a/nova/policies/security_groups.py +++ b/nova/policies/security_groups.py @@ -81,7 +81,19 @@ server representation""", 'method': 'GET', 'path': '/servers/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-security-groups" policy ' + 'for POST, GET /servers which was added for extensions is not ' + 'needed any more. NOTE: This policy is deprecated only for ' + 'POST /servers, GET /servers/{server_id} & GET /servers/detail. ' + 'This policy for other API operations is still valid and not ' + 'deprecated' + ), + deprecated_since='17.0.0'), ] diff --git a/nova/policies/server_usage.py b/nova/policies/server_usage.py index 93e9fcde22fb..a270b19d8baa 100644 --- a/nova/policies/server_usage.py +++ b/nova/policies/server_usage.py @@ -42,7 +42,15 @@ This check is performed only after the check 'method': 'GET', 'path': '/servers/detail' } - ]), + ], + deprecated_for_removal=True, + deprecated_reason=( + 'Nova API extension concept has been removed in Pike. Those ' + 'extensions have their own policies enforcement. As there is ' + 'no extensions now, "os_compute_api:os-server-usage" policy ' + 'which was added for extensions is not needed any more' + ), + deprecated_since='17.0.0'), ] diff --git a/releasenotes/notes/deprecate-api-extensions-policies-5613bc4eea59709d.yaml b/releasenotes/notes/deprecate-api-extensions-policies-5613bc4eea59709d.yaml new file mode 100644 index 000000000000..a5f17b3c994a --- /dev/null +++ b/releasenotes/notes/deprecate-api-extensions-policies-5613bc4eea59709d.yaml @@ -0,0 +1,26 @@ +--- +deprecations: + - | + Nova API extension concept is removed in Pike. These extensions + have their own policies enforcement which are not needed any more. + All the below policies which were added mainly for extensions are + deprecated for removal- + + - Show & List detail server + + - 'os_compute_api:os-config-drive' + - 'os_compute_api:os-extended-availability-zone' + - 'os_compute_api:os-extended-status' + - 'os_compute_api:os-extended-volumes' + - 'os_compute_api:os-keypairs' + - 'os_compute_api:os-server-usage' + - 'os_compute_api:os-security-groups' (only from /servers APIs) + + - Create, Update, Show & List detail flavor + + - 'os_compute_api:os-flavor-rxtx' + - 'os_compute_api:os-flavor-access' (only from /flavors APIs) + + - Show & List detail image + + - 'os_compute_api:image-size'