From b4c866bab18c1b8bd050a98e1626266c0ed48836 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sun, 6 May 2018 19:01:07 +0000 Subject: [PATCH] Remove APIs for managing security groups These APIs are proxy to Neutron API calls. Users can achieve the equivalent functionality by directly calling the Neutron APIs. In particular, these APIs are removed after microversion 1.15 * POST /containers//add_security_group * POST /containers//remove_security_group Change-Id: Ifd39948fec7e94b6e78298b3a6ccbed947f7ce61 Implements: blueprint rework-security-group-api --- zun/api/controllers/v1/containers.py | 2 ++ zun/api/controllers/versions.py | 3 ++- zun/api/rest_api_version_history.rst | 6 ++++++ zun/tests/unit/api/controllers/test_root.py | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/zun/api/controllers/v1/containers.py b/zun/api/controllers/v1/containers.py index d9872dfbd..2dfa3a9b9 100644 --- a/zun/api/controllers/v1/containers.py +++ b/zun/api/controllers/v1/containers.py @@ -494,6 +494,7 @@ class ContainersController(base.Controller): else: raise + @base.Controller.api_version("1.1", "1.14") @pecan.expose('json') @exception.wrap_pecan_controller_exception @validation.validated(schema.add_security_group) @@ -521,6 +522,7 @@ class ContainersController(base.Controller): security_group_id) pecan.response.status = 202 + @base.Controller.api_version("1.1", "1.14") @pecan.expose('json') @exception.wrap_pecan_controller_exception @validation.validated(schema.remove_security_group) diff --git a/zun/api/controllers/versions.py b/zun/api/controllers/versions.py index fb113d53c..fa3665896 100644 --- a/zun/api/controllers/versions.py +++ b/zun/api/controllers/versions.py @@ -47,10 +47,11 @@ REST_API_VERSION_HISTORY = """REST API Version History: * 1.12 - Add support to stop container before delete * 1.13 - Add support for listing networks of a container * 1.14 - Add support to rename the container from update api + * 1.15 - Remove add_security_group and remove_security_group """ BASE_VER = '1.1' -CURRENT_MAX_VER = '1.14' +CURRENT_MAX_VER = '1.15' class Version(object): diff --git a/zun/api/rest_api_version_history.rst b/zun/api/rest_api_version_history.rst index 891f68d8d..9211a591e 100644 --- a/zun/api/rest_api_version_history.rst +++ b/zun/api/rest_api_version_history.rst @@ -123,3 +123,9 @@ user documentation. a request to the endpoint with the data in the following form: {'name': ''} + +1.15 +---- + + Remove the APIs for adding/removing security group to/from a container. + These APIs are removed because they are proxy APIs to Neutron. diff --git a/zun/tests/unit/api/controllers/test_root.py b/zun/tests/unit/api/controllers/test_root.py index 852d18aee..7cf89ac9e 100644 --- a/zun/tests/unit/api/controllers/test_root.py +++ b/zun/tests/unit/api/controllers/test_root.py @@ -28,7 +28,7 @@ class TestRootController(api_base.FunctionalTest): 'default_version': {'id': 'v1', 'links': [{'href': 'http://localhost/v1/', 'rel': 'self'}], - 'max_version': '1.14', + 'max_version': '1.15', 'min_version': '1.1', 'status': 'CURRENT'}, 'description': 'Zun is an OpenStack project which ' @@ -37,7 +37,7 @@ class TestRootController(api_base.FunctionalTest): 'versions': [{'id': 'v1', 'links': [{'href': 'http://localhost/v1/', 'rel': 'self'}], - 'max_version': '1.14', + 'max_version': '1.15', 'min_version': '1.1', 'status': 'CURRENT'}]}