From 377069ff37c83a21acb406f77703b1256aa41a9c Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 21 Aug 2018 14:30:07 -0400 Subject: prod bug fixes august 12th Set generalBuildingBlock variable on execution to pass heatStackId updates to the calling process. Pass CloudParams to SDNC on Create request Pass cloudParams to VNF Adapter on VF Module creation too. Change-Id: I523cde0edb1412fc12e1d7a13c91c77869b505fd Issue-ID: SO-875 Signed-off-by: Benjamin, Max (mb388a) --- .../so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java | 1 + .../adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java | 3 +++ .../sdnc/mapper/VfModuleTopologyOperationRequestMapper.java | 9 +++++++++ .../vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java | 3 +++ .../sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java | 3 +++ .../VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json | 1 + .../genericResourceApiVfModuleOperationInformationAssign.json | 4 ++++ 7 files changed, 24 insertions(+) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java index aa865f0340..0b712452fd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java @@ -96,6 +96,7 @@ public class VnfAdapterImpl { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "HeatStackId is missing from create VolumeGroup Vnf Adapter response."); } } + execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock()); } } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java index 1d87b70754..515f04b218 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java @@ -178,6 +178,9 @@ public class VnfAdapterVfModuleObjectMapper { if (requestContext.getUserParams() != null) { paramsMap.putAll(requestContext.getUserParams()); } + if (vfModule.getCloudParams() != null) { + paramsMap.putAll(vfModule.getCloudParams()); + } return paramsMap; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java index 99256fd507..af670d13d5 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java @@ -128,6 +128,15 @@ public class VfModuleTopologyOperationRequestMapper { } } + if (vfModule.getCloudParams() != null) { + for (Map.Entry entry : vfModule.getCloudParams().entrySet()) { + GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam(); + paramItem.setName(entry.getKey()); + paramItem.setValue(entry.getValue()); + vfModuleInputParameters.addParamItem(paramItem); + } + } + if (volumeGroup != null) { GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam(); paramItem.setName("volume-group-id"); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java index 1bb59e7b8d..0c9e281fc7 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java @@ -103,6 +103,9 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest { modelInfoVfModule.setModelUUID("vfModuleModelUuid"); modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid"); vfModule.setModelInfoVfModule(modelInfoVfModule); + HashMap cloudParams = new HashMap(); + cloudParams.put("key3", "value3"); + vfModule.setCloudParams(cloudParams); CloudRegion cloudRegion = new CloudRegion(); cloudRegion.setLcpCloudRegionId("cloudRegionId"); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java index 369a7321e2..b3999a788c 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java @@ -100,6 +100,9 @@ public class VfModuleTopologyOperationRequestMapperTest { modelInfoVfModule.setModelUUID("vfModuleModelUuid"); modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid"); vfModule.setModelInfoVfModule(modelInfoVfModule); + HashMap cloudParams = new HashMap(); + userParams.put("key2", "value2"); + vfModule.setCloudParams(cloudParams); VolumeGroup volumeGroup = new VolumeGroup(); volumeGroup.setVolumeGroupId("volumeGroupId"); diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json index 0db327eae4..0132068fe4 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/vnfAdapterCreateVfModuleRequest.json @@ -39,6 +39,7 @@ "fw_subint_ctrl_port_0_floating_v6_ip": "floatingIpV60", "workload_context": "workloadContext", "key1": "value2", + "key3": "value3", "availability_zone_0": "zone0", "availability_zone_1": "zone1", "availability_zone_2": "zone2", diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json index 4231152d86..50d5642fee 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json @@ -22,6 +22,10 @@ "name" : "key1", "value" : "value1" }, + { + "name" : "key2", + "value" : "value2" + }, { "name" : "volume-group-id", "value" : "volumeGroupId" -- cgit 1.2.3-korg