From 638880aec2c0a21505720a204bd9ae0fcc83608c Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Wed, 22 May 2019 17:50:35 +0530 Subject: SDNC request body fix Request body fix for sdnc requests. Change-Id: Id3e454be18c62ab8c2e5ee572de55bf3ef7c18a3 Issue-ID: SO-1393 Signed-off-by: subhash kumar singh --- .../scripts/ActivateSDNCNetworkResource.groovy | 67 +++++++++++++++------- .../scripts/CreateSDNCNetworkResource.groovy | 34 ++++++----- .../process/CreateSDNCNetworkResource.bpmn | 7 +-- 3 files changed, 70 insertions(+), 38 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy index 2d0b9e5a99..5ed815b0ab 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy @@ -33,6 +33,7 @@ import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.onap.so.bpmn.common.scripts.ExceptionUtil import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils +import org.onap.so.bpmn.core.domain.ModelInfo import org.onap.so.bpmn.core.domain.ResourceType import org.onap.so.bpmn.core.json.JsonUtils import org.onap.so.bpmn.core.UrnPropertiesReader @@ -84,9 +85,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { } String sdnc_svcAction = "activate" - String sdnc_requestAction = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") - String isActivateRequired = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".activation-required") - execution.setVariable("isActivateRequired", isActivateRequired) + String sdnc_requestAction = sdnc_svcAction.capitalize() + UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + "Instance" execution.setVariable(Prefix + "svcAction", sdnc_svcAction) execution.setVariable(Prefix + "requestAction", sdnc_requestAction) @@ -175,7 +174,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { String source = execution.getVariable("source") String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId") ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class) - String networkInstanceId = execution.getVariable("networkInstanceId") + String resourceInstanceId = execution.getVariable("resourceInstanceId") String serviceType = resourceInputObj.getServiceType() String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid() String serviceModelUuid = resourceInputObj.getServiceModelInfo().getModelUuid() @@ -194,6 +193,25 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { // 1. prepare assign topology via SDNC Adapter SUBFLOW call String sdncTopologyActivateRequest = "" String modelType = resourceInputObj.getResourceModelInfo().getModelType() + + //When a new resource creation request reaches SO, the parent resources information needs to be provided + //while creating the child resource. + String vnfid = "" + String vnfmodelInvariantUuid = "" + String vnfmodelCustomizationUuid = "" + String vnfmodelUuid = "" + String vnfmodelVersion = "" + String vnfmodelName = "" + if(modelType.equalsIgnoreCase(ResourceType.GROUP.toString())) { + vnfid = resourceInputObj.getVnfId() + ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo() + vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid() + vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid() + vnfmodelUuid = vfModelInfo.getModelUuid() + vnfmodelVersion = vfModelInfo.getModelVersion() + vnfmodelName = vfModelInfo.getModelName() + } + switch (modelType) { case "VNF" : sdncTopologyActivateRequest = """${msoUtils.xmlEscape(globalCustomerId)} - ${msoUtils.xmlEscape(networkInstanceId)} + ${msoUtils.xmlEscape(resourceInstanceId)} ${msoUtils.xmlEscape(modelInvariantUuid)} @@ -254,15 +272,14 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { break case "GROUP" : - sdncTopologyActivateRequest = - """ ${msoUtils.xmlEscape(hdrRequestId)} ${msoUtils.xmlEscape(serviceInstanceId)} ${msoUtils.xmlEscape(sdnc_svcAction)} - connection-attachment-topology-operation + vf-module-topology-operation sdncCallback generic-resource @@ -286,23 +303,33 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { ${msoUtils.xmlEscape(serviceInstanceId)} ${msoUtils.xmlEscape(globalCustomerId)} + ${msoUtils.xmlEscape(globalCustomerId)} - - - ${msoUtils.xmlEscape(networkInstanceId)} - - $parentServiceInstanceId + - ${msoUtils.xmlEscape(modelInvariantUuid)} + ${msoUtils.xmlEscape(vnfmodelInvariantUuid)} + ${msoUtils.xmlEscape(vnfmodelCustomizationUuid)} + ${msoUtils.xmlEscape(vnfmodelUuid)} + ${msoUtils.xmlEscape(vnfmodelVersion)} + ${msoUtils.xmlEscape(vnfmodelName)} + + ${msoUtils.xmlEscape(vnfid)} + + + false + + ${msoUtils.xmlEscape(modelInvariantUuid)} ${msoUtils.xmlEscape(modelCustomizationUuid)} ${msoUtils.xmlEscape(modelUuid)} ${msoUtils.xmlEscape(modelVersion)} ${msoUtils.xmlEscape(modelName)} - - - $netowrkInputParameters - + + + + $netowrkInputParameters + + """.trim() break @@ -344,7 +371,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { - ${msoUtils.xmlEscape(networkInstanceId)} + ${msoUtils.xmlEscape(resourceInstanceId)} ${msoUtils.xmlEscape(modelInvariantUuid)} ${msoUtils.xmlEscape(modelCustomizationUuid)} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index 4c4b63101f..421fd062fe 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -102,7 +102,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { } String sdnc_svcAction = "create" - String sdnc_requestAction = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + String sdnc_requestAction = sdnc_svcAction.capitalize() + UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + "Instance" String isActivateRequired = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".activation-required") execution.setVariable("isActivateRequired", isActivateRequired) @@ -352,7 +352,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String vnfmodelName = "" String modelType = resourceInputObj.getResourceModelInfo().getModelType() if(modelType.equalsIgnoreCase(ResourceType.GROUP.toString())) { - vnfid = resourceInputObj.getVnfId(); + vnfid = resourceInputObj.getVnfId() ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo() vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid() vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid() @@ -427,7 +427,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { ${msoUtils.xmlEscape(hdrRequestId)} ${msoUtils.xmlEscape(serviceInstanceId)} ${msoUtils.xmlEscape(sdnc_svcAction)} - network-topology-operation + vf-module-topology-operation sdncCallback generic-resource @@ -454,24 +454,30 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { ${msoUtils.xmlEscape(globalCustomerId)} + ${msoUtils.xmlEscape(vnfmodelInvariantUuid)} ${msoUtils.xmlEscape(vnfmodelCustomizationUuid)} ${msoUtils.xmlEscape(vnfmodelUuid)} ${msoUtils.xmlEscape(vnfmodelVersion)} ${msoUtils.xmlEscape(vnfmodelName)} + + ${msoUtils.xmlEscape(vnfid)} - - + + false + + ${msoUtils.xmlEscape(modelInvariantUuid)} + ${msoUtils.xmlEscape(modelCustomizationUuid)} + ${msoUtils.xmlEscape(modelUuid)} + ${msoUtils.xmlEscape(modelVersion)} + ${msoUtils.xmlEscape(modelName)} + + + + $netowrkInputParameters - - - - - - - - $netowrkInputParameters - + + """.trim() break diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSDNCNetworkResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSDNCNetworkResource.bpmn index 0bdc6dc0bd..5a4b3ac348 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSDNCNetworkResource.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSDNCNetworkResource.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1qo2pln @@ -137,8 +137,7 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution) - - + SequenceFlow_1dww8ye SequenceFlow_05niqbf @@ -309,4 +308,4 @@ dcsi.afterCreateSDNCCall(execution) - \ No newline at end of file + -- cgit 1.2.3-korg