From 563f30382c8031b8d348b26be010dbe5fe91c55c Mon Sep 17 00:00:00 2001 From: Munir Ahmad Date: Tue, 4 Aug 2020 12:26:19 -0400 Subject: [SO] heatbridge implemention to delete L3Network and its subnet from AAI Issue-ID: SO-3109 Signed-off-by: Munir Ahmad Change-Id: Ib59975fea3efe54b301e0484e38d08b07d5fc947 --- .../main/java/org/onap/so/heatbridge/HeatBridgeImpl.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index 92958004ca..ef2577d6fe 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -552,6 +552,20 @@ public class HeatBridgeImpl implements HeatBridgeApi { Optional relationships = resultWrapper.getRelationships(); logger.debug("VfModule contains relationships in AAI: {}", relationships.isPresent()); if (relationships.isPresent()) { + + List l3NetworkUris = relationships.get().getRelatedUris(AAIObjectType.L3_NETWORK); + logger.debug("L3Network contains {} relationships in AAI", l3NetworkUris.size()); + + if (!l3NetworkUris.isEmpty()) { + for (AAIResourceUri l3NetworkUri : l3NetworkUris) { + if (env.getProperty("heatBridgeDryrun", Boolean.class, true)) { + logger.debug("Would delete L3Network: {}", l3NetworkUri.build().toString()); + } else { + resourcesClient.delete(l3NetworkUri); + } + } + } + List vserverUris = relationships.get().getRelatedUris(AAIObjectType.VSERVER); logger.debug("VServer contains {} relationships in AAI", vserverUris.size()); createTransactionToDeleteSriovPfFromPserver(vserverUris); -- cgit 1.2.3-korg