diff options
author | sanket12345 <SX00562924@techmahindra.com> | 2021-09-15 20:20:00 +0530 |
---|---|---|
committer | sanket12345 <SX00562924@techmahindra.com> | 2021-09-15 20:27:29 +0530 |
commit | dade3b0456315cebda3ac655060f80d2e43a2a1d (patch) | |
tree | 1ac15cfa7159b5c770984b207c9e3a1621d01cbc /bpmn/so-bpmn-tasks/src | |
parent | 0dcaa14b8f6518ba2d0a28142d76df84b616e8fb (diff) |
Cnf-adapter is not able to update relationship in AAI
Passing 2 more parameters vnfId and vfmoduleId from bpmn-infra to cnf-adapter
Issue-ID: SO-3761
Signed-off-by: sanket12345 <SX00562924@techmahindra.com>
Change-Id: I79f12f115d112d713f32f0a400aeb6532d7c6ade
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
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 + " ]"; } } |