rehome default subnet pools API def
This patch rehomes neutron's default subnet pools extension into neutron-libs API definition layout/structure. UTs and a reno are also included. Change-Id: Ib841f3727e758c0c19c9a4a0acd221ecb4081313
This commit is contained in:
@@ -16,6 +16,7 @@ from neutron_lib.api.definitions import auto_allocated_topology
|
|||||||
from neutron_lib.api.definitions import bgpvpn
|
from neutron_lib.api.definitions import bgpvpn
|
||||||
from neutron_lib.api.definitions import bgpvpn_routes_control
|
from neutron_lib.api.definitions import bgpvpn_routes_control
|
||||||
from neutron_lib.api.definitions import data_plane_status
|
from neutron_lib.api.definitions import data_plane_status
|
||||||
|
from neutron_lib.api.definitions import default_subnetpools
|
||||||
from neutron_lib.api.definitions import dns
|
from neutron_lib.api.definitions import dns
|
||||||
from neutron_lib.api.definitions import dns_domain_ports
|
from neutron_lib.api.definitions import dns_domain_ports
|
||||||
from neutron_lib.api.definitions import extra_dhcp_opt
|
from neutron_lib.api.definitions import extra_dhcp_opt
|
||||||
@@ -46,6 +47,7 @@ _ALL_API_DEFINITIONS = {
|
|||||||
bgpvpn,
|
bgpvpn,
|
||||||
bgpvpn_routes_control,
|
bgpvpn_routes_control,
|
||||||
data_plane_status,
|
data_plane_status,
|
||||||
|
default_subnetpools,
|
||||||
dns,
|
dns,
|
||||||
dns_domain_ports,
|
dns_domain_ports,
|
||||||
extra_dhcp_opt,
|
extra_dhcp_opt,
|
||||||
|
41
neutron_lib/api/definitions/default_subnetpools.py
Normal file
41
neutron_lib/api/definitions/default_subnetpools.py
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# 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 import converters
|
||||||
|
from neutron_lib.api.definitions import subnet as subnet_def
|
||||||
|
from neutron_lib import constants
|
||||||
|
|
||||||
|
USE_DEFAULT_SUBNETPOOL = 'use_default_subnetpool'
|
||||||
|
|
||||||
|
ALIAS = 'default-subnetpools'
|
||||||
|
IS_SHIM_EXTENSION = False
|
||||||
|
IS_STANDARD_ATTR_EXTENSION = False
|
||||||
|
NAME = 'Default Subnetpools'
|
||||||
|
API_PREFIX = ''
|
||||||
|
DESCRIPTION = 'Provides ability to mark and use a subnetpool as the default.'
|
||||||
|
UPDATED_TIMESTAMP = '2016-02-18T18:00:00-00:00'
|
||||||
|
RESOURCE_NAME = subnet_def.RESOURCE_NAME
|
||||||
|
COLLECTION_NAME = subnet_def.COLLECTION_NAME
|
||||||
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
|
COLLECTION_NAME: {
|
||||||
|
USE_DEFAULT_SUBNETPOOL: {'allow_post': True,
|
||||||
|
'allow_put': False,
|
||||||
|
'default': False,
|
||||||
|
'convert_to': converters.convert_to_boolean,
|
||||||
|
'is_visible': False},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||||
|
ACTION_MAP = {}
|
||||||
|
REQUIRED_EXTENSIONS = [constants.SUBNET_ALLOCATION_EXT_ALIAS]
|
||||||
|
OPTIONAL_EXTENSIONS = []
|
||||||
|
ACTION_STATUS = {}
|
@@ -0,0 +1,20 @@
|
|||||||
|
# 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 default_subnetpools
|
||||||
|
from neutron_lib.tests.unit.api.definitions import base
|
||||||
|
|
||||||
|
|
||||||
|
class DefaultSubnetPoolsDefinitionTestCase(base.DefinitionBaseTestCase):
|
||||||
|
extension_module = default_subnetpools
|
||||||
|
extension_resources = ()
|
||||||
|
extension_attributes = (default_subnetpools.USE_DEFAULT_SUBNETPOOL,)
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- The API definition for neutron extension ``default-subnetpools`` is now
|
||||||
|
available in ``neutron_lib.api.definitions.default_subnetpools``.
|
Reference in New Issue
Block a user