From 27c2622007ef22a93c286fffb07313ea1e87d565 Mon Sep 17 00:00:00 2001 From: Boden R Date: Thu, 17 Aug 2017 14:32:23 -0600 Subject: [PATCH] rehome project id api definition This patch rehomes neutron's project id extension's API definition into neutron-lib. UTs and a release note are also included. Change-Id: Ibe69134a35d2f2927b194c8353c26b41c55c6954 --- neutron_lib/api/definitions/__init__.py | 2 ++ neutron_lib/api/definitions/project_id.py | 26 +++++++++++++++++++ .../unit/api/definitions/test_project_id.py | 18 +++++++++++++ ...rehome-projid-apidef-a433b1b003f27a20.yaml | 4 +++ 4 files changed, 50 insertions(+) create mode 100644 neutron_lib/api/definitions/project_id.py create mode 100644 neutron_lib/tests/unit/api/definitions/test_project_id.py create mode 100644 releasenotes/notes/rehome-projid-apidef-a433b1b003f27a20.yaml diff --git a/neutron_lib/api/definitions/__init__.py b/neutron_lib/api/definitions/__init__.py index 9e533d4db..9a810c7ae 100644 --- a/neutron_lib/api/definitions/__init__.py +++ b/neutron_lib/api/definitions/__init__.py @@ -37,6 +37,7 @@ from neutron_lib.api.definitions import port from neutron_lib.api.definitions import port_security from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings_extended +from neutron_lib.api.definitions import project_id from neutron_lib.api.definitions import provider_net from neutron_lib.api.definitions import router_availability_zone from neutron_lib.api.definitions import router_interface_fip @@ -75,6 +76,7 @@ _ALL_API_DEFINITIONS = { port_security, portbindings, portbindings_extended, + project_id, provider_net, router_availability_zone, router_interface_fip, diff --git a/neutron_lib/api/definitions/project_id.py b/neutron_lib/api/definitions/project_id.py new file mode 100644 index 000000000..d4a05a3f1 --- /dev/null +++ b/neutron_lib/api/definitions/project_id.py @@ -0,0 +1,26 @@ +# 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. + +ALIAS = 'project-id' +IS_SHIM_EXTENSION = True +IS_STANDARD_ATTR_EXTENSION = False +NAME = 'project_id field enabled' +API_PREFIX = '' +DESCRIPTION = 'Extension that indicates that project_id field is enabled.' +UPDATED_TIMESTAMP = '2016-09-09T09:09:09-09:09' +RESOURCE_ATTRIBUTE_MAP = {} +SUB_RESOURCE_ATTRIBUTE_MAP = {} +ACTION_MAP = {} +REQUIRED_EXTENSIONS = [] +OPTIONAL_EXTENSIONS = [] +ACTION_STATUS = {} diff --git a/neutron_lib/tests/unit/api/definitions/test_project_id.py b/neutron_lib/tests/unit/api/definitions/test_project_id.py new file mode 100644 index 000000000..88fbeea72 --- /dev/null +++ b/neutron_lib/tests/unit/api/definitions/test_project_id.py @@ -0,0 +1,18 @@ +# 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_lib.api.definitions import project_id +from neutron_lib.tests.unit.api.definitions import base + + +class ProjectIdDefinitionTestCase(base.DefinitionBaseTestCase): + extension_module = project_id diff --git a/releasenotes/notes/rehome-projid-apidef-a433b1b003f27a20.yaml b/releasenotes/notes/rehome-projid-apidef-a433b1b003f27a20.yaml new file mode 100644 index 000000000..8b5cf888f --- /dev/null +++ b/releasenotes/notes/rehome-projid-apidef-a433b1b003f27a20.yaml @@ -0,0 +1,4 @@ +--- +features: + - The ``project-id`` API extension's API definition is now available in + ``neutron_lib.api.definitions.project_id``.