diff options
author | Kuleshov, Elena <evn@att.com> | 2019-12-18 09:24:33 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2019-12-18 09:24:34 -0500 |
commit | c0fbd45596e038ecceb77422c4cae840ad114efa (patch) | |
tree | c9b76ff27774b5a87e6539c3995fd5778907f965 /bpmn/MSOCommonBPMN/src/main/java | |
parent | 145eb372a14a2dd25f75033acd37e269c33caf95 (diff) |
Support for volume groups on replace VF Module.
Support for volume groups on replace VF Module.
[MSO-8375 R2002} Add full JUnit coverage for replaceVFModule scenarios,
add replace changes to general macro data.
Fix a JUnit to pass correct parameters to a method.
Add back setting volume group id for new volume group on replace action.
Issue-ID: SO-2577
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I73289da21e0c7de7451b63e99e184692e800aaf0
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java')
2 files changed, 22 insertions, 1 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 7e982369bb..88c36bec3a 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -117,6 +117,7 @@ public class BBInputSetup implements JavaDelegate { private static final String VNF = "Vnf"; private static final String NETWORK_COLLECTION = "NetworkCollection"; private static final String PREPROV = "PREPROV"; + private static final String CREATEVOLUME = "CreateVolume"; @Autowired private BBInputSetupUtils bbInputSetupUtils; @@ -381,7 +382,8 @@ public class BBInputSetup implements JavaDelegate { this.populateGenericVnf(requestId, modelInfo, instanceName, platform, lineOfBusiness, service, bbName, serviceInstance, lookupKeyMap, relatedInstanceList, resourceId, vnfType, null, productFamilyId, applicationId); - } else if (modelType.equals(ModelType.volumeGroup)) { + } else if (modelType.equals(ModelType.volumeGroup) || (modelType.equals(ModelType.vfModule) + && (bbName.equalsIgnoreCase(AssignFlows.VOLUME_GROUP.toString()) || bbName.startsWith(CREATEVOLUME)))) { lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, resourceId); this.populateVolumeGroup(requestId, modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null); @@ -605,6 +607,7 @@ public class BBInputSetup implements JavaDelegate { bbInputSetupUtils.getAAIVolumeGroup(cloudOwner, cloudRegionId, volumeGroup.getVolumeGroupId()) .getModelCustomizationId(); if (modelInfo.getModelCustomizationId().equalsIgnoreCase(volumeGroupCustId)) { + logger.debug("Found volume group for vfModule: " + volumeGroup.getVolumeGroupId()); return Optional.of(volumeGroup.getVolumeGroupId()); } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java index 3d5533de32..994abda083 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java @@ -571,6 +571,24 @@ public class BBInputSetupUtils { } } + public Optional<VolumeGroup> getRelatedVolumeGroupFromVfModule(String vnfId, String vfModuleId) throws Exception { + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId); + uri.relatedTo(AAIObjectPlurals.VOLUME_GROUP); + Optional<VolumeGroups> volumeGroups = injectionHelper.getAaiClient().get(VolumeGroups.class, uri); + VolumeGroup volumeGroup = null; + if (!volumeGroups.isPresent()) { + logger.debug("VfModule does not have a volume group attached"); + return Optional.empty(); + } else { + if (volumeGroups.get().getVolumeGroup().size() > 1) { + throw new Exception("Multiple VolumeGroups Returned"); + } else { + volumeGroup = volumeGroups.get().getVolumeGroup().get(0); + } + return Optional.of(volumeGroup); + } + } + public Optional<org.onap.aai.domain.yang.VpnBinding> getAICVpnBindingFromNetwork( org.onap.aai.domain.yang.L3Network aaiLocalNetwork) { AAIResultWrapper networkWrapper = new AAIResultWrapper(aaiLocalNetwork); |