diff options
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main/java')
7 files changed, 46 insertions, 11 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index 97c715b44e..ef04ee9c13 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -1017,7 +1017,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Retrieve the Network Resource definition NetworkResource networkResource = null; - if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) { if (!commonUtils.isNullOrEmpty(networkType)) { networkResource = networkResourceRepo.findFirstByModelNameOrderByModelVersionDesc(networkType); @@ -1030,10 +1029,18 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } + int timeoutMinutes = 118; String mode = ""; if (networkResource != null) { logger.debug(LOG_DEBUG_MSG, networkResource.toString()); mode = networkResource.getOrchestrationMode(); + networkResource.getHeatTemplate().getTimeoutMinutes(); + HeatTemplate heat = networkResource.getHeatTemplate(); + if (heat != null && heat.getTimeoutMinutes() != null) { + if (heat.getTimeoutMinutes() < 118) { + timeoutMinutes = heat.getTimeoutMinutes(); + } + } } if (NEUTRON_MODE.equals(mode)) { @@ -1048,7 +1055,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } else { try { - heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true, 120); + heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true, timeoutMinutes); networkDeleted.value = true; } catch (MsoException me) { me.addContext("DeleteNetwork"); @@ -1381,7 +1388,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * make these optional + " ip_version: %ipversion%\n" + " enable_dhcp: %enabledhcp%\n" + * " gateway_ip: %gatewayip%\n" + " allocation_pools:\n" + " - start: %poolstart%\n" + * " end: %poolend%\n"; - * + * */ String outputTempl = " subnet_id_%subnetId%:\n" + " description: Openstack subnet identifier\n" diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java index 39a380d2cf..0074dca03c 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java @@ -123,6 +123,7 @@ public interface MsoVnfAdapter { @WebParam(name = "vfName") @XmlElement(required = true) String vfName, @WebParam(name = "vnfId") @XmlElement(required = true) String vnfId, @WebParam(name = "vfModuleId") @XmlElement(required = true) String vfModuleId, + @WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid, @WebParam(name = "request") MsoRequest msoRequest, @WebParam(name = "vfModuleOutputs", mode = Mode.OUT) Holder<Map<String, String>> vfModuleOutputs) throws VnfException; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index fcb2d7c2bb..4b908004df 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -1137,7 +1137,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { @Override public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String vnfId, - String vfModuleId, MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException { + String vfModuleId, String modelCustomizationUuid, MsoRequest msoRequest, + Holder<Map<String, String>> outputs) throws VnfException { Map<String, Object> stackOutputs; try { stackOutputs = msoHeatUtils.queryStackForOutputs(cloudSiteId, cloudOwner, tenantId, vnfName); @@ -1166,8 +1167,32 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { msoRequest, failRequestOnValetFailure); } + int timeoutMinutes = 118; + VfModule vf = null; + VfModuleCustomization vfmc = null; + if (modelCustomizationUuid != null) { + vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid); + if (vfmc != null) { + vf = vfmc.getVfModule(); + } + if (vf != null) { + logger.trace("Found vfModuleCust entry {}", vfmc.toString()); + HeatTemplate heat = vf.getModuleHeatTemplate(); + if (heat != null && heat.getTimeoutMinutes() != null) { + if (heat.getTimeoutMinutes() < 118) { + timeoutMinutes = heat.getTimeoutMinutes(); + } + } + + } else { + logger.debug( + "Unable to find vfModuleCust with modelCustomizationUuid={} . Using default timeout for polling", + modelCustomizationUuid); + } + } + try { - msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true, 118); + msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true, timeoutMinutes); } catch (MsoException me) { me.addContext(DELETE_VNF); // Failed to query the Stack due to an openstack exception. diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index d35c34a937..abaf881ba5 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -1082,7 +1082,8 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { } public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String vnfId, - String vfModuleId, MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException { + String vfModuleId, String modelCustomizationUuid, MsoRequest msoRequest, + Holder<Map<String, String>> outputs) throws VnfException { logger.debug("Deleting VF " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId); // 1702 capture the output parameters on a delete diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index 561b21250f..b1f4055b3b 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -1073,7 +1073,8 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vfModuleId, String vnfId, - String aaiVfModuleId, MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException { + String aaiVfModuleId, String modelCustomizationUuid, MsoRequest msoRequest, + Holder<Map<String, String>> outputs) throws VnfException { logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java index 58899b7f48..0fb11ebbf3 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java @@ -179,8 +179,8 @@ public class VnfAdapterRest { Holder<Map<String, String>> outputs = new Holder<>(); if (cloudsite != null && !cloudsite.equals(TESTING_KEYWORD)) { vnfAdapter.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(), req.getMsoRequest(), - outputs); + req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(), + req.getModelCustomizationUuid(), req.getMsoRequest(), outputs); } response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, req.getMessageId(), outputs.value); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java index 0e70c6be53..fcb570f3f5 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java @@ -195,8 +195,8 @@ public class VnfAdapterRestV2 { // Support different Adapter Implementations MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsite); adapter.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(), req.getMsoRequest(), - outputs); + req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(), + req.getModelCustomizationUuid(), req.getMsoRequest(), outputs); } response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, req.getMessageId(), outputs.value); |