Add shim extension admin_state_down_before_update

Shim extension for neutron patch:
https://review.openstack.org/#/c/625134/
Adds releasenote.
Adds api-ref update.

Related-Bug: #1811166

Change-Id: Ie1167a9c7fc5dcb88a6955085937572805e41fd7
Signed-off-by: Matt Welch <matt.welch@intel.com>
This commit is contained in:
Matt Welch 2019-02-01 14:44:05 -08:00
parent 194f775c9c
commit adc6a7087f
5 changed files with 64 additions and 0 deletions

View File

@ -52,6 +52,17 @@ Resource timestamps
The ``standard-attr-timestamp`` extension adds the ``created_at`` and
``updated_at`` attributes to all resources that have standard attributes.
Router admin state down before update extension
===============================================
The ``router-admin-state-down-before-update`` extension adds the requirement
that the administrative state of a distributed virtual router (DVR) be set to
DOWN (``admin_state_up=False``) prior to modifying the ``distributed``
parameter of the router. The API will return an error response code of 400 if
the router's ``distributed`` attribute is modified without first setting the
router's ``admin_state_up=False``.
This extension requires the ``dvr`` extension.
Router availability zone extension
==================================

View File

@ -81,6 +81,7 @@ from neutron_lib.api.definitions import qos_gateway_ip
from neutron_lib.api.definitions import qos_rule_type_details
from neutron_lib.api.definitions import qos_rules_alias
from neutron_lib.api.definitions import revisionifmatch
from neutron_lib.api.definitions import router_admin_state_down_before_update
from neutron_lib.api.definitions import router_availability_zone
from neutron_lib.api.definitions import router_interface_fip
from neutron_lib.api.definitions import routerservicetype
@ -178,6 +179,7 @@ _ALL_API_DEFINITIONS = {
qos_rule_type_details,
qos_rules_alias,
revisionifmatch,
router_admin_state_down_before_update,
router_availability_zone,
router_interface_fip,
routerservicetype,

View File

@ -0,0 +1,28 @@
# 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 dvr as dvr_apidef
ALIAS = 'router-admin-state-down-before-update'
IS_SHIM_EXTENSION = True
IS_STANDARD_ATTR_EXTENSION = False
NAME = "Enforce Router's Admin State Down Before Update Extension"
DESCRIPTION = ('Ensure that the admin state of a router is DOWN '
'(admin_state_up=False) before updating the distributed '
'attribute')
UPDATED_TIMESTAMP = '2019-07-02T15:56:00'
RESOURCE_ATTRIBUTE_MAP = {}
SUB_RESOURCE_ATTRIBUTE_MAP = {}
ACTION_MAP = {}
REQUIRED_EXTENSIONS = [dvr_apidef.ALIAS]
OPTIONAL_EXTENSIONS = []
ACTION_STATUS = {}

View File

@ -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 router_admin_state_down_before_update
from neutron_lib.tests.unit.api.definitions import base
class AdminStateDownToUpdateDefinitionTestCase(base.DefinitionBaseTestCase):
extension_module = router_admin_state_down_before_update

View File

@ -0,0 +1,5 @@
---
features:
- Router API is modified through a regime API extension to neutron-lib that
enforces the admin state of a router be DOWN (admin_state_up=False) prior
to modifying the distributed attribute of the router.