diff options
2 files changed, 39 insertions, 4 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java index 2dda26718f..ed01f2271f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java @@ -130,6 +130,14 @@ public class CnfAdapterCreateTasks { public void prepareForCnfUpdateOrDelete(BuildingBlockExecution execution) { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); + GenericVnf genericVnfId = null; + VfModule vfModuleId = null; + try { + genericVnfId = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); + vfModuleId = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); + } catch (Exception ex) { + logger.error("Exception occurred", ex); + } String heatStackId = execution.getVariable("heatStackId"); @@ -140,7 +148,9 @@ public class CnfAdapterCreateTasks { String callbackUrl = "http://so-bpmn-infra.onap:8081/mso/WorkflowMessage/" + CNF_ADAPTER_MESSAGE_TYPE + "/" + requestId; - CnfAaiUpdateRequest aaiRequest = createCnfAaiUpdateRequest(heatStackId, cloudRegion, callbackUrl); + CnfAaiUpdateRequest aaiRequest = + createCnfAaiUpdateRequest(heatStackId, cloudRegion, callbackUrl, genericVnfId, vfModuleId); + logger.debug("aaiRequest: {}", aaiRequest); String cnfRequestPayload = ""; @@ -192,14 +202,15 @@ public class CnfAdapterCreateTasks { } protected CnfAaiUpdateRequest createCnfAaiUpdateRequest(String heatStackId, CloudRegion cloudRegion, - String callbackUrl) { + String callbackUrl, GenericVnf genericVnfId, VfModule vfModuleId) { CnfAaiUpdateRequest request = new CnfAaiUpdateRequest(); request.setCallbackUrl(callbackUrl); request.setCloudOwner(cloudRegion.getCloudOwner()); request.setCloudRegion(cloudRegion.getLcpCloudRegionId()); request.setTenantId(cloudRegion.getTenantId()); request.setInstanceId(heatStackId); - + request.setGenericVnfId(genericVnfId.getVnfId()); + request.setVfModuleId(vfModuleId.getVfModuleId()); return request; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/CnfAaiUpdateRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/CnfAaiUpdateRequest.java index 4cc675f4e9..2847074e66 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/CnfAaiUpdateRequest.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/CnfAaiUpdateRequest.java @@ -23,6 +23,13 @@ public class CnfAaiUpdateRequest { @JsonProperty("callbackUrl") private String callbackUrl; + @JsonProperty("genericVnfId") + private String genericVnfId; + + @JsonProperty("vfModuleId") + private String vfModuleId; + + public String getInstanceId() { return instanceId; } @@ -63,10 +70,27 @@ public class CnfAaiUpdateRequest { this.callbackUrl = callbackUrl; } + public String getGenericVnfId() { + return genericVnfId; + } + + public void setGenericVnfId(String genericVnfId) { + this.genericVnfId = genericVnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + @Override public String toString() { return "CnfAaiUpdateRequest [instanceId=" + instanceId + ", cloudRegion=" + cloudRegion + ", cloudOwner=" - + cloudOwner + ", tenantId=" + tenantId + ", callbackUrl=" + callbackUrl + "]"; + + cloudOwner + ", tenantId=" + tenantId + ", callbackUrl=" + callbackUrl + ", genericVnfId=" + + genericVnfId + ", vfModuleId=" + vfModuleId + " ]"; } } |