rehome router availability zone extension api def
This patch rehomes the router az extension API definition into neutron-lib. UTs and a release note are also included. Change-Id: I8bc54b581c26d8472e38efaaa63741785e07d2b8
This commit is contained in:
parent
c9f42f3fa4
commit
d3df1b7e9d
@ -33,6 +33,7 @@ from neutron_lib.api.definitions import port
|
|||||||
from neutron_lib.api.definitions import port_security
|
from neutron_lib.api.definitions import port_security
|
||||||
from neutron_lib.api.definitions import portbindings
|
from neutron_lib.api.definitions import portbindings
|
||||||
from neutron_lib.api.definitions import provider_net
|
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
|
from neutron_lib.api.definitions import router_interface_fip
|
||||||
from neutron_lib.api.definitions import subnet
|
from neutron_lib.api.definitions import subnet
|
||||||
from neutron_lib.api.definitions import subnetpool
|
from neutron_lib.api.definitions import subnetpool
|
||||||
@ -64,6 +65,7 @@ _ALL_API_DEFINITIONS = {
|
|||||||
port_security,
|
port_security,
|
||||||
portbindings,
|
portbindings,
|
||||||
provider_net,
|
provider_net,
|
||||||
|
router_availability_zone,
|
||||||
router_interface_fip,
|
router_interface_fip,
|
||||||
subnet,
|
subnet,
|
||||||
subnetpool,
|
subnetpool,
|
||||||
|
44
neutron_lib/api/definitions/router_availability_zone.py
Normal file
44
neutron_lib/api/definitions/router_availability_zone.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# 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
|
||||||
|
from neutron_lib.api.definitions import l3
|
||||||
|
|
||||||
|
|
||||||
|
ALIAS = 'router_availability_zone'
|
||||||
|
IS_SHIM_EXTENSION = False
|
||||||
|
IS_STANDARD_ATTR_EXTENSION = False
|
||||||
|
NAME = 'Router Availability Zone'
|
||||||
|
API_PREFIX = ''
|
||||||
|
DESCRIPTION = 'Availability zone support for router.'
|
||||||
|
UPDATED_TIMESTAMP = '2015-01-01T10:00:00-00:00'
|
||||||
|
RESOURCE_NAME = l3.ROUTER
|
||||||
|
COLLECTION_NAME = l3.ROUTERS
|
||||||
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
|
COLLECTION_NAME: {
|
||||||
|
az.COLLECTION_NAME: {
|
||||||
|
'allow_post': False, 'allow_put': False,
|
||||||
|
'is_visible': True
|
||||||
|
},
|
||||||
|
az.AZ_HINTS: {
|
||||||
|
'allow_post': True, 'allow_put': False, 'is_visible': True,
|
||||||
|
'validate': {'type:availability_zone_hint_list': None},
|
||||||
|
'default': []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||||
|
ACTION_MAP = {}
|
||||||
|
REQUIRED_EXTENSIONS = [l3.ALIAS, az.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 availability_zone as az
|
||||||
|
from neutron_lib.api.definitions import router_availability_zone
|
||||||
|
from neutron_lib.tests.unit.api.definitions import base
|
||||||
|
|
||||||
|
|
||||||
|
class RouterAZDefinitionTestCase(base.DefinitionBaseTestCase):
|
||||||
|
extension_module = router_availability_zone
|
||||||
|
extension_attributes = (az.AZ_HINTS, az.COLLECTION_NAME,)
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Neutron's ``router_availability_zone`` extension API definition is now
|
||||||
|
available in ``neutron_lib.api.definitions.router_availability_zone``.
|
Loading…
Reference in New Issue
Block a user