diff --git a/neutron_lib/api/definitions/__init__.py b/neutron_lib/api/definitions/__init__.py index 9c9679b1d..75df75d5e 100644 --- a/neutron_lib/api/definitions/__init__.py +++ b/neutron_lib/api/definitions/__init__.py @@ -15,6 +15,7 @@ from neutron_lib.api.definitions import agent from neutron_lib.api.definitions import allowedaddresspairs from neutron_lib.api.definitions import auto_allocated_topology from neutron_lib.api.definitions import availability_zone +from neutron_lib.api.definitions import availability_zone_filter from neutron_lib.api.definitions import bgpvpn from neutron_lib.api.definitions import bgpvpn_routes_control from neutron_lib.api.definitions import bgpvpn_stdattrs @@ -97,6 +98,7 @@ _ALL_API_DEFINITIONS = { allowedaddresspairs, auto_allocated_topology, availability_zone, + availability_zone_filter, bgpvpn, bgpvpn_routes_control, bgpvpn_stdattrs, diff --git a/neutron_lib/api/definitions/availability_zone_filter.py b/neutron_lib/api/definitions/availability_zone_filter.py new file mode 100644 index 000000000..3a6824bed --- /dev/null +++ b/neutron_lib/api/definitions/availability_zone_filter.py @@ -0,0 +1,29 @@ +# 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 availability_zone as az + + +ALIAS = 'availability_zone_filter' +IS_SHIM_EXTENSION = True +IS_STANDARD_ATTR_EXTENSION = False +NAME = 'Availability Zone Filter Extension' +DESCRIPTION = 'Add filter parameters to AvailabilityZone resource' +UPDATED_TIMESTAMP = '2018-06-22T10:00:00-00:00' +RESOURCE_ATTRIBUTE_MAP = {} +SUB_RESOURCE_ATTRIBUTE_MAP = {} +ACTION_MAP = {} +REQUIRED_EXTENSIONS = [ + az.ALIAS +] +OPTIONAL_EXTENSIONS = [] +ACTION_STATUS = {} diff --git a/neutron_lib/tests/unit/api/definitions/test_availability_zone_filter.py b/neutron_lib/tests/unit/api/definitions/test_availability_zone_filter.py new file mode 100644 index 000000000..a06ad0837 --- /dev/null +++ b/neutron_lib/tests/unit/api/definitions/test_availability_zone_filter.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 availability_zone_filter +from neutron_lib.tests.unit.api.definitions import base + + +class AvailabilityZoneFilterDefinitionTestCase(base.DefinitionBaseTestCase): + extension_module = availability_zone_filter diff --git a/releasenotes/notes/add-availability_zone_filter-extension-e91e1e5e822e4133.yaml b/releasenotes/notes/add-availability_zone_filter-extension-e91e1e5e822e4133.yaml new file mode 100644 index 000000000..61e82e610 --- /dev/null +++ b/releasenotes/notes/add-availability_zone_filter-extension-e91e1e5e822e4133.yaml @@ -0,0 +1,5 @@ +--- +other: + - | + Add a shim extension ``availability_zone_filter`` to indicate + if ``availability_zone`` resource supports filter parameters.