Network Cascade Deletion Extension

This change introduces the optional boolean argument, ``cascade``,
to the ``DELETE`` API request, that when defined as ``True``,
deletes a network and all its associated resources.

Related-Spec: https://review.opendev.org/c/openstack/neutron-specs/+/810822
Related-Bug: #1870319
Change-Id: Ib26526650b61062f753a470f5b33b8f53c0a7947
This commit is contained in:
Sharon Koech 2022-06-17 11:21:40 +00:00 committed by skoech
parent 5b1dab0e8f
commit 19cb07025b
5 changed files with 59 additions and 0 deletions

View File

@ -92,6 +92,13 @@ The ``network_availability_zone`` extension provides support of availability
zone for networks, exposing ``availability_zone_hints``
and ``availability_zones`` attributes.
Network cascade delete extension
================================
The ``network-cascade-delete`` shim extension adds to networks the optional
boolean attribute, ``cascade``, that when defined as ``true``, removes all
child objects of a network upon its deletion.
Port security
=============

View File

@ -74,6 +74,7 @@ from neutron_lib.api.definitions import metering_source_and_destination_filters
from neutron_lib.api.definitions import multiprovidernet
from neutron_lib.api.definitions import network
from neutron_lib.api.definitions import network_availability_zone
from neutron_lib.api.definitions import network_cascade_delete
from neutron_lib.api.definitions import network_ip_availability
from neutron_lib.api.definitions import network_mtu
from neutron_lib.api.definitions import network_mtu_writable
@ -214,6 +215,7 @@ _ALL_API_DEFINITIONS = {
multiprovidernet,
network,
network_availability_zone,
network_cascade_delete,
network_ip_availability,
network_mtu,
network_mtu_writable,

View File

@ -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 = 'network-cascade-delete'
IS_SHIM_EXTENSION = True
IS_STANDARD_ATTR_EXTENSION = False
NAME = 'Network Cascade Deletion Extension'
DESCRIPTION = ('Allows for cascade deletion of networks and all '
'associated ports.')
UPDATED_TIMESTAMP = ''
RESOURCE_ATTRIBUTE_MAP = {}
SUB_RESOURCE_ATTRIBUTE_MAP = {}
ACTION_MAP = {}
REQUIRED_EXTENSIONS = []
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 network_cascade_delete
from neutron_lib.tests.unit.api.definitions import base
class NetworkCascadeDeleteDefinitionTestCase(base.DefinitionBaseTestCase):
extension_module = network_cascade_delete

View File

@ -0,0 +1,6 @@
---
features:
- |
Add API extension ``network-cascade-delete`` that allows users
to automatically delete all associated ports when
deleting networks.