From 315ac8db2585e2df5b608fb699b23754a80f764c Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Fri, 17 Sep 2021 14:01:07 +0530 Subject: Add feature to Support NSMF based TN slices Issue-ID: SO-3764 Signed-off-by: krishnaa96 Change-Id: I57f6db8fab6cbd0032f58ca8254d3f93d7a78147 --- .../infrastructure/scripts/AnNssmfutils.groovy | 101 +++- .../scripts/CreateSliceService.groovy | 4 +- .../scripts/DoAllocateAccessNSSI.groovy | 231 ++++---- .../scripts/DoAllocateNSIandNSSI.groovy | 506 +++++++++++++++++- .../scripts/DoCreateSliceServiceInstance.groovy | 2 +- .../scripts/DoCreateSliceServiceOption.groovy | 38 +- .../infrastructure/scripts/TnNssmfUtils.groovy | 2 +- .../main/resources/process/CreateSliceService.bpmn | 170 +++--- .../resources/subprocess/DoAllocateAccessNSSI.bpmn | 478 +++++++++++------ .../resources/subprocess/DoAllocateNSIandNSSI.bpmn | 586 +++++++++++++++------ 10 files changed, 1556 insertions(+), 562 deletions(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy index 07a23481d7..f17bfc2938 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy @@ -153,6 +153,52 @@ public void createDomainWiseSliceProfiles(List ranConstituentSliceProfil public void createSliceProfilesInAai(DelegateExecution execution) { + String serviceCategory = execution.getVariable("serviceCategory") + if (execution.getVariable("IsRANNfAlonePresent")) { + ServiceInstance ANNF_sliceProfileInstance = new ServiceInstance(); + String ANNF_sliceProfileInstanceId = UUID.randomUUID().toString() + String ANNF_sliceProfileId = UUID.randomUUID().toString() + execution.setVariable("ANNF_sliceProfileInstanceId", ANNF_sliceProfileInstanceId) + execution.setVariable("ANNF_sliceProfileId", ANNF_sliceProfileId) + SliceProfiles ANNF_SliceProfiles = new SliceProfiles() + SliceProfile ANNF_SliceProfile = createSliceProfile("AN_NF", execution) + ANNF_SliceProfiles.getSliceProfile().add(ANNF_SliceProfile) + logger.debug("sliceProfiles : 1. " + ANNF_SliceProfiles.toString()) + //ANNF slice profile instance creation + ANNF_sliceProfileInstance.setServiceInstanceId(ANNF_sliceProfileInstanceId) + String sliceInstanceName = "sliceprofile_" + ANNF_sliceProfileId + ANNF_sliceProfileInstance.setServiceInstanceName(sliceInstanceName) + String serviceType = execution.getVariable("sst") as String + ANNF_sliceProfileInstance.setServiceType(serviceType) + String serviceStatus = "deactivated" + ANNF_sliceProfileInstance.setOrchestrationStatus(serviceStatus) + String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile") as String, "pLMNIdList") + ANNF_sliceProfileInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0)) + String serviceRole = "slice-profile-instance" + ANNF_sliceProfileInstance.setServiceRole(serviceRole) + ArrayList snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String) + String snssai = snssaiList.get(0) + ANNF_sliceProfileInstance.setEnvironmentContext(snssai) + ANNF_sliceProfileInstance.setWorkloadContext("AN_NF") + ANNF_sliceProfileInstance.setSliceProfiles(ANNF_SliceProfiles) + String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile") as String, "resourceSharingLevel") + ANNF_sliceProfileInstance.setServiceFunction(serviceFunctionAnnf) + logger.debug("completed ANNF sliceprofileinstance build : " + ANNF_sliceProfileInstance.toString()) + String msg = "" + try { + + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri sliceProfileUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId") as String).serviceSubscription(execution.getVariable("subscriptionServiceType") as String).serviceInstance(ANNF_sliceProfileInstanceId)) + client.create(sliceProfileUri, ANNF_sliceProfileInstance) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + msg = "Exception in AnNssmfUtils.createSliceProfilesInAai " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } +else{ org.onap.aai.domain.yang.ServiceInstance ANNF_sliceProfileInstance = new ServiceInstance(); org.onap.aai.domain.yang.ServiceInstance TNFH_sliceProfileInstance = new ServiceInstance(); org.onap.aai.domain.yang.ServiceInstance TNMH_sliceProfileInstance = new ServiceInstance(); @@ -163,12 +209,12 @@ public void createSliceProfilesInAai(DelegateExecution execution) { String TNFH_sliceProfileId = UUID.randomUUID().toString() String TNMH_sliceProfileInstanceId = UUID.randomUUID().toString() String TNMH_sliceProfileId = UUID.randomUUID().toString() - execution.setVariable("ANNF_sliceProfileInstanceId",ANNF_sliceProfileInstanceId) - execution.setVariable("ANNF_sliceProfileId",ANNF_sliceProfileId) - execution.setVariable("TNFH_sliceProfileInstanceId",TNFH_sliceProfileInstanceId) - execution.setVariable("TNFH_sliceProfileId",TNFH_sliceProfileId) - execution.setVariable("TNMH_sliceProfileInstanceId",TNMH_sliceProfileInstanceId) - execution.setVariable("TNMH_sliceProfileId",TNMH_sliceProfileId) + execution.setVariable("ANNF_sliceProfileInstanceId", ANNF_sliceProfileInstanceId) + execution.setVariable("ANNF_sliceProfileId", ANNF_sliceProfileId) + execution.setVariable("TNFH_sliceProfileInstanceId", TNFH_sliceProfileInstanceId) + execution.setVariable("TNFH_sliceProfileId", TNFH_sliceProfileId) + execution.setVariable("TNMH_sliceProfileInstanceId", TNMH_sliceProfileInstanceId) + execution.setVariable("TNMH_sliceProfileId", TNMH_sliceProfileId) //slice profiles assignment org.onap.aai.domain.yang.SliceProfiles ANNF_SliceProfiles = new SliceProfiles() org.onap.aai.domain.yang.SliceProfiles TNFH_SliceProfiles = new SliceProfiles() @@ -177,17 +223,17 @@ public void createSliceProfilesInAai(DelegateExecution execution) { org.onap.aai.domain.yang.SliceProfile TNFH_SliceProfile = new SliceProfile() org.onap.aai.domain.yang.SliceProfile TNMH_SliceProfile = new SliceProfile() ANNF_SliceProfile = createSliceProfile("AN_NF", execution) - TNFH_SliceProfile = createSliceProfile("TN_FH",execution) - TNMH_SliceProfile = createSliceProfile("TN_MH",execution) - + TNFH_SliceProfile = createSliceProfile("TN_FH", execution) + TNMH_SliceProfile = createSliceProfile("TN_MH", execution) + ANNF_SliceProfiles.getSliceProfile().add(ANNF_SliceProfile) TNFH_SliceProfiles.getSliceProfile().add(TNFH_SliceProfile) TNMH_SliceProfiles.getSliceProfile().add(TNMH_SliceProfile) - - logger.debug("sliceProfiles : 1. "+ANNF_SliceProfiles.toString()+"\n 2. "+TNFH_SliceProfiles.toString()+"\n 3. "+TNMH_SliceProfiles.toString()) + + logger.debug("sliceProfiles : 1. " + ANNF_SliceProfiles.toString() + "\n 2. " + TNFH_SliceProfiles.toString() + "\n 3. " + TNMH_SliceProfiles.toString()) //ANNF slice profile instance creation ANNF_sliceProfileInstance.setServiceInstanceId(ANNF_sliceProfileInstanceId) - String sliceInstanceName = "sliceprofile_"+ANNF_sliceProfileId + String sliceInstanceName = "sliceprofile_" + ANNF_sliceProfileId ANNF_sliceProfileInstance.setServiceInstanceName(sliceInstanceName) String serviceType = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "sST") ANNF_sliceProfileInstance.setServiceType(serviceType) @@ -197,18 +243,18 @@ public void createSliceProfilesInAai(DelegateExecution execution) { ANNF_sliceProfileInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0)) String serviceRole = "slice-profile-instance" ANNF_sliceProfileInstance.setServiceRole(serviceRole) - ArrayList snssaiList = execution.getVariable("snssaiList") + ArrayList snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String) String snssai = snssaiList.get(0) ANNF_sliceProfileInstance.setEnvironmentContext(snssai) - ANNF_sliceProfileInstance.setWorkloadContext("AN_NF") + ANNF_sliceProfileInstance.setWorkloadContext("AN_NF") ANNF_sliceProfileInstance.setSliceProfiles(ANNF_SliceProfiles) String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "resourceSharingLevel") ANNF_sliceProfileInstance.setServiceFunction(serviceFunctionAnnf) - logger.debug("completed ANNF sliceprofileinstance build : "+ ANNF_sliceProfileInstance.toString()) + logger.debug("completed ANNF sliceprofileinstance build : "+ ANNF_sliceProfileInstance.toString()) //TNFH slice profile instance creation TNFH_sliceProfileInstance.setServiceInstanceId(TNFH_sliceProfileInstanceId) - sliceInstanceName = "sliceprofile_"+TNFH_sliceProfileId + sliceInstanceName = "sliceprofile _ "+TNFH_sliceProfileId TNFH_sliceProfileInstance.setServiceInstanceName(sliceInstanceName) serviceType = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "sST") TNFH_sliceProfileInstance.setServiceType(serviceType) @@ -221,11 +267,11 @@ public void createSliceProfilesInAai(DelegateExecution execution) { TNFH_sliceProfileInstance.setSliceProfiles(TNFH_SliceProfiles) String serviceFunctionTnFH = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "resourceSharingLevel") TNFH_sliceProfileInstance.setServiceFunction(serviceFunctionTnFH) - logger.debug("completed TNFH sliceprofileinstance build : "+TNFH_sliceProfileInstance) + logger.debug("completed TNFH sliceprofileinstance build : "+TNFH_sliceProfileInstance) //TNMH slice profile instance creation TNMH_sliceProfileInstance.setServiceInstanceId(TNMH_sliceProfileInstanceId) - sliceInstanceName = "sliceprofile_"+TNMH_sliceProfileId + sliceInstanceName = "sliceprofile _ "+TNMH_sliceProfileId TNMH_sliceProfileInstance.setServiceInstanceName(sliceInstanceName) serviceType = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "sST") TNMH_sliceProfileInstance.setServiceType(serviceType) @@ -238,7 +284,7 @@ public void createSliceProfilesInAai(DelegateExecution execution) { TNMH_sliceProfileInstance.setSliceProfiles(TNMH_SliceProfiles) String serviceFunctionTnMH = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "resourceSharingLevel") TNMH_sliceProfileInstance.setServiceFunction(serviceFunctionTnMH) - logger.debug("completed TNMH sliceprofileinstance build : "+TNMH_sliceProfileInstance) + logger.debug("completed TNMH sliceprofileinstance build : "+TNMH_sliceProfileInstance) String msg = "" try { @@ -260,6 +306,7 @@ public void createSliceProfilesInAai(DelegateExecution execution) { logger.info(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } + } } private SliceProfile createSliceProfile(String domainType, DelegateExecution execution) { @@ -439,10 +486,10 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe String globalSubscriberId = execution.getVariable("globalSubscriberId") String subscriptionServiceType = execution.getVariable("subscriptionServiceType") - List sNssaiList = execution.getVariable("snssaiList") + List sNssaiList = execution.getVariable("snssaiList") as List DeAllocateNssi deallocateNssi = new DeAllocateNssi() - deallocateNssi.setNsiId(execution.getVariable("nsiId")) + deallocateNssi.setNsiId(execution.getVariable("nsiId") as String) deallocateNssi.setScriptName("TN1") deallocateNssi.setSnssaiList(sNssaiList) deallocateNssi.setTerminateNssiOption(0) @@ -457,13 +504,13 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe serviceInfo.addProperty("modifyAction", true) if(domainType.equals("TN_FH")) { - deallocateNssi.setNssiId(execution.getVariable("TNFH_NSSI")) - deallocateNssi.setSliceProfileId(execution.getVariable("TNFH_sliceProfileInstanceId")) - serviceInfo.addProperty("nssiId", execution.getVariable("TNFH_NSSI")) + deallocateNssi.setNssiId(execution.getVariable("TNFH_NSSI") as String) + deallocateNssi.setSliceProfileId(execution.getVariable("TNFH_sliceProfileInstanceId") as String) + serviceInfo.addProperty("nssiId", execution.getVariable("TNFH_NSSI") as String) }else if(domainType.equals("TN_MH")) { - deallocateNssi.setNssiId(execution.getVariable("TNMH_NSSI")) - deallocateNssi.setSliceProfileId(execution.getVariable("TNMH_sliceProfileInstanceId")) - serviceInfo.addProperty("nssiId", execution.getVariable("TNMH_NSSI")) + deallocateNssi.setNssiId(execution.getVariable("TNMH_NSSI") as String) + deallocateNssi.setSliceProfileId(execution.getVariable("TNMH_sliceProfileInstanceId") as String) + serviceInfo.addProperty("nssiId", execution.getVariable("TNMH_NSSI") as String) } JsonObject json = new JsonObject() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy index ba87614937..e55ea13938 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy @@ -371,7 +371,9 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { String taskStatus = execution.getVariable("taskStatus") SliceTaskParamsAdapter sliceTaskParams = execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter - + int nsstCount=execution.getVariable("nsstCount") as int + nsstCount=nsstCount+1 + execution.setVariable("nsstCount", nsstCount) execution.setVariable("CSSOT_status", taskStatus) execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceTaskParams)) execution.setVariable("CSSOT_requestMethod", requestMethod) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy index d5c132087c..ed1c2b24d5 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy @@ -190,6 +190,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { //RAN NSST decomposition String ranModelVersion = ranNsstServiceDecomposition.getModelInfo().getModelVersion() String ranModelName = ranNsstServiceDecomposition.getModelInfo().getModelName() + String serviceCategory=ranNsstServiceDecomposition.getServiceCategory() + logger.debug("serviceCategory : "+serviceCategory) List serviceProxyList = ranNsstServiceDecomposition.getServiceProxy() List nsstInfoList = new ArrayList<>() for(ServiceProxy serviceProxy : serviceProxyList) @@ -198,10 +200,10 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { String nsstModelInvariantUuid = serviceProxy.getModelInfo().getModelInvariantUuid() String name = serviceProxy.getModelInfo().getModelName() String nsstServiceModelInfo = """{ - "UUID":"${nsstModelUuid}", - "invariantUUID":"${nsstModelInvariantUuid}", - "name":"${name}" - }""" + "UUID":"${nsstModelUuid}", + "invariantUUID":"${nsstModelInvariantUuid}", + "name":"${name}" + }""" nsstInfoList.add(nsstServiceModelInfo) } int currentIndex=0 @@ -212,12 +214,19 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { logger.info(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } + if(maxIndex == 1) { + logger.info("RAN NSST have only RAN NF NSST") + execution.setVariable("ranNfSliceProfile", execution.getVariable("sliceProfile")) + execution.setVariable("IsRANNfAlonePresent", true) + } execution.setVariable("ranNsstInfoList", objectMapper.writeValueAsString(nsstInfoList)) - execution.setVariable("ranModelVersion", ranModelVersion) - execution.setVariable("ranModelName", ranModelName) execution.setVariable("currentIndex",currentIndex) execution.setVariable("maxIndex",maxIndex) + execution.setVariable("ranModelVersion", ranModelVersion) + execution.setVariable("ranModelName", ranModelName) logger.debug(Prefix+"processDecomposition maxIndex value - "+maxIndex) + + execution.setVariable("serviceCategory",serviceCategory) } /* @@ -428,28 +437,28 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { ServiceDecomposition decomposedNsst = execution.getVariable("nsstServiceDecomposition") logger.debug("decomposedNsst : "+decomposedNsst.toString()) - String nsstType = decomposedNsst.getServiceRole() //domainType + String nsstType = decomposedNsst.getServiceCategory() //domainType String modelVersion = decomposedNsst.getModelInfo().getModelVersion() String modelName = decomposedNsst.getModelInfo().getModelName() String modelUuid = decomposedNsst.getModelInfo().getModelUuid() String modelInvariantUuid = decomposedNsst.getModelInfo().getModelInvariantUuid() switch(nsstType) { - case "AN_NF": + case "AN NF NSST": execution.setVariable("ANNF_modelInvariantUuid", modelInvariantUuid) execution.setVariable("ANNF_modelUuid", modelUuid) execution.setVariable("ANNF_modelVersion", modelVersion) execution.setVariable("ANNF_modelName", modelName) execution.setVariable("ANNF_ServiceDecomposition", decomposedNsst) break - case "TN_FH": + case "TN FH NSST": execution.setVariable("TNFH_modelInvariantUuid", modelInvariantUuid) execution.setVariable("TNFH_modelUuid", modelUuid) execution.setVariable("TNFH_modelVersion", modelVersion) execution.setVariable("TNFH_modelName", modelName) execution.setVariable("TNFH_ServiceDecomposition", decomposedNsst) break - case "TN_MH": + case "TN MH NSST": execution.setVariable("TNMH_modelInvariantUuid", modelInvariantUuid) execution.setVariable("TNMH_modelUuid", modelUuid) execution.setVariable("TNMH_modelVersion", modelVersion) @@ -480,9 +489,12 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { //build oof request body boolean ranNfNssiPreferReuse = execution.getVariable("ranNfNssiPreferReuse"); String requestId = execution.getVariable("msoRequestId") + String serviceCategory = execution.getVariable("serviceCategory") String messageType = "NSSISelectionResponse" - List ranConstituentSliceProfiles = jsonUtil.StringArrayToList(execution.getVariable("RanConstituentSliceProfiles")) - anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution) + if(execution.getVariable("maxIndex") > 1) { + List ranConstituentSliceProfiles = jsonUtil.StringArrayToList(execution.getVariable("RanConstituentSliceProfiles") as String) + anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution) + } Map profileInfo = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class) profileInfo.put("sST",execution.getVariable("sst")) String modelUuid = execution.getVariable("ANNF_modelUuid") @@ -617,48 +629,45 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { //create RAN NSSI org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new org.onap.aai.domain.yang.ServiceInstance(); org.onap.aai.domain.yang.ServiceInstance ANNFServiceInstance = new org.onap.aai.domain.yang.ServiceInstance(); + String serviceCategory = execution.getVariable("serviceCategory") + String serviceStatus = "deactivated" + String serviceRole = "nssi" //AN instance creation - ANServiceInstance.setServiceInstanceId(execution.getVariable("RANServiceInstanceId")) + ANServiceInstance.setServiceInstanceId(execution.getVariable("RANServiceInstanceId") as String) String sliceInstanceName = execution.getVariable("servicename") ANServiceInstance.setServiceInstanceName(sliceInstanceName) - String serviceType = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST") - ANServiceInstance.setServiceType(execution.getVariable("sst")) - String serviceStatus = "deactivated" + ANServiceInstance.setServiceType(execution.getVariable("sst") as String) ANServiceInstance.setOrchestrationStatus(serviceStatus) - String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList") + String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList") as String ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid) - String serviceRole = "nssi" ANServiceInstance.setServiceRole(serviceRole) - List snssaiList = execution.getVariable("snssaiList") + List snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String) String snssai = snssaiList.get(0) - //ANServiceInstance.setEnvironmentContext(snssai) - ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) - String modelInvariantUuid = execution.getVariable("modelInvariantUuid") - String modelUuid = execution.getVariable("modelUuid") - ANServiceInstance.setModelInvariantId(modelInvariantUuid) - ANServiceInstance.setModelVersionId(modelUuid) + ANServiceInstance.setEnvironmentContext(snssai) + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") as String + ANServiceInstance.setModelInvariantId(modelInvariantUuid) + ANServiceInstance.setModelVersionId(modelUuid) ANServiceInstance.setWorkloadContext("AN") - String serviceFunctionAn = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "resourceSharingLevel") + String serviceFunctionAn = jsonUtil.getJsonValue(execution.getVariable("sliceProfile") as String, "resourceSharingLevel") ANServiceInstance.setServiceFunction(serviceFunctionAn) - logger.debug("completed AN service instance build "+ ANServiceInstance.toString()) + logger.debug("completed AN service instance build " + ANServiceInstance.toString()) //create RAN NF NSSI - ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId")) - String ANNF_nssiInstanceId = UUID.randomUUID().toString() - sliceInstanceName = "nssi_an_nf_"+ANNF_nssiInstanceId + ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId") as String) + sliceInstanceName = "nssi_"+execution.getVariable("ANNF_modelName") ANNFServiceInstance.setServiceInstanceName(sliceInstanceName) - ANNFServiceInstance.setServiceType(execution.getVariable("sst")) + ANNFServiceInstance.setServiceType(execution.getVariable("sst") as String) ANNFServiceInstance.setOrchestrationStatus(serviceStatus) - serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList") + serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile") as String, "pLMNIdList") ANNFServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0)) ANNFServiceInstance.setServiceRole(serviceRole) - snssaiList = execution.getVariable("snssaiList") + snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String) snssai = snssaiList.get(0) - //ANNFServiceInstance.setEnvironmentContext(snssai) - ANNFServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) + ANNFServiceInstance.setEnvironmentContext(snssai) ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid")) ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid")) ANNFServiceInstance.setWorkloadContext("AN_NF") - String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "resourceSharingLevel") + String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile") as String, "resourceSharingLevel") ANNFServiceInstance.setServiceFunction(serviceFunctionAnnf) logger.debug("completed AN service instance build "+ ANNFServiceInstance.toString()) @@ -666,10 +675,10 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { try { AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri nssiServiceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(execution.getVariable("RANServiceInstanceId"))) + AAIResourceUri nssiServiceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId") as String).serviceSubscription(execution.getVariable("subscriptionServiceType") as String).serviceInstance(execution.getVariable("RANServiceInstanceId") as String)) client.create(nssiServiceUri, ANServiceInstance) - AAIResourceUri nssiServiceUri1 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(execution.getVariable("RANNFServiceInstanceId"))) + AAIResourceUri nssiServiceUri1 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId") as String).serviceSubscription(execution.getVariable("subscriptionServiceType") as String).serviceInstance(execution.getVariable("RANNFServiceInstanceId") as String)) client.create(nssiServiceUri1, ANNFServiceInstance) } catch (BpmnError e) { @@ -680,7 +689,9 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } //end point update - createEndPointsInAai(execution) + if (!execution.getVariable("IsRANNfAlonePresent")) { + createEndPointsInAai(execution) + } } def prepareTnFhRequest = { DelegateExecution execution -> logger.debug(Prefix+"prepareTnFhRequest method start") @@ -804,64 +815,96 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { def updateAairelationships = { DelegateExecution execution -> logger.debug(Prefix + "updateAairelationships Start") + String serviceCategory = execution.getVariable("serviceCategory") String msg = "" - try { - def ANNF_serviceInstanceId = execution.getVariable("RANNFServiceInstanceId") - def TNFH_serviceInstanceId = execution.getVariable("TNFH_NSSI") - def TNMH_serviceInstanceId = execution.getVariable("TNMH_NSSI") - def AN_profileInstanceId = execution.getVariable("sliceProfileId") - def AN_NSSI = execution.getVariable("RANServiceInstanceId") - def ANNF_profileInstanceId = execution.getVariable("ANNF_sliceProfileInstanceId") - def TNFH_profileInstanceId = execution.getVariable("TNFH_sliceProfileInstanceId") - def TNMH_profileInstanceId = execution.getVariable("TNMH_sliceProfileInstanceId") - String globalSubscriberId = execution.getVariable("globalSubscriberId") - String subscriptionServiceType = execution.getVariable("subscriptionServiceType") - - Relationship ANNF_relationship = new Relationship() - Relationship TNFH_relationship = new Relationship() - Relationship TNMH_relationship = new Relationship() - - String ANNF_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_profileInstanceId}" - String TNFH_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_profileInstanceId}" - String TNMH_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_profileInstanceId}" - - String ANNF_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_serviceInstanceId}" - String TNFH_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_serviceInstanceId}" - String TNMH_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_serviceInstanceId}" - - ANNF_relationship.setRelatedLink(ANNF_relatedLink) - ANNF_relationship.setRelatedTo("service-instance") - ANNF_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") - TNFH_relationship.setRelatedLink(TNFH_relatedLink) - TNFH_relationship.setRelatedTo("service-instance") - TNFH_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") - TNMH_relationship.setRelatedLink(TNMH_relatedLink) - TNMH_relationship.setRelatedTo("service-instance") - TNMH_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") - - // create SliceProfile and NSSI relationship in AAI - anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship,ANNF_serviceInstanceId) - anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship,TNFH_serviceInstanceId) - anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship,TNMH_serviceInstanceId) - anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship,AN_profileInstanceId) - anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship,AN_profileInstanceId) - anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship,AN_profileInstanceId) - - //create AN NSSI and ANNF,TNFH,TNMH relationship in AAI - ANNF_relationship.setRelatedLink(ANNF_NSSI_relatedLink) - TNFH_relationship.setRelatedLink(TNFH_NSSI_relatedLink) - TNMH_relationship.setRelatedLink(TNMH_NSSI_relatedLink) - anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship,AN_NSSI) - anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship,AN_NSSI) - anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship,AN_NSSI) + if (execution.getVariable("IsRANNfAlonePresent")) { + try { + def ANNF_serviceInstanceId = execution.getVariable("RANNFServiceInstanceId") + def AN_profileInstanceId = execution.getVariable("sliceProfileId") + def AN_NSSI = execution.getVariable("RANServiceInstanceId") + def ANNF_profileInstanceId = execution.getVariable("ANNF_sliceProfileInstanceId") + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") - } catch (BpmnError e) { - throw e - } catch (Exception ex) { + Relationship ANNF_relationship = new Relationship() + String ANNF_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_profileInstanceId}" + String ANNF_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_serviceInstanceId}" + ANNF_relationship.setRelatedLink(ANNF_relatedLink) + ANNF_relationship.setRelatedTo("service-instance") + ANNF_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship, ANNF_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship, AN_profileInstanceId) + ANNF_relationship.setRelatedLink(ANNF_NSSI_relatedLink) + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship, AN_NSSI) - msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage() - logger.info(msg) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + + msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + else { + try { + def ANNF_serviceInstanceId = execution.getVariable("RANNFServiceInstanceId") + def TNFH_serviceInstanceId = execution.getVariable("TNFH_NSSI") + def TNMH_serviceInstanceId = execution.getVariable("TNMH_NSSI") + def AN_profileInstanceId = execution.getVariable("sliceProfileId") + def AN_NSSI = execution.getVariable("RANServiceInstanceId") + def ANNF_profileInstanceId = execution.getVariable("ANNF_sliceProfileInstanceId") + def TNFH_profileInstanceId = execution.getVariable("TNFH_sliceProfileInstanceId") + def TNMH_profileInstanceId = execution.getVariable("TNMH_sliceProfileInstanceId") + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + Relationship ANNF_relationship = new Relationship() + Relationship TNFH_relationship = new Relationship() + Relationship TNMH_relationship = new Relationship() + + String ANNF_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_profileInstanceId}" + String TNFH_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_profileInstanceId}" + String TNMH_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_profileInstanceId}" + + String ANNF_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_serviceInstanceId}" + String TNFH_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_serviceInstanceId}" + String TNMH_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_serviceInstanceId}" + + ANNF_relationship.setRelatedLink(ANNF_relatedLink) + ANNF_relationship.setRelatedTo("service-instance") + ANNF_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + TNFH_relationship.setRelatedLink(TNFH_relatedLink) + TNFH_relationship.setRelatedTo("service-instance") + TNFH_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + TNMH_relationship.setRelatedLink(TNMH_relatedLink) + TNMH_relationship.setRelatedTo("service-instance") + TNMH_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + + // create SliceProfile and NSSI relationship in AAI + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship, ANNF_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship, TNFH_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship, TNMH_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship, AN_profileInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship, AN_profileInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship, AN_profileInstanceId) + + //create AN NSSI and ANNF,TNFH,TNMH relationship in AAI + ANNF_relationship.setRelatedLink(ANNF_NSSI_relatedLink) + TNFH_relationship.setRelatedLink(TNFH_NSSI_relatedLink) + TNMH_relationship.setRelatedLink(TNMH_NSSI_relatedLink) + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship, AN_NSSI) + anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship, AN_NSSI) + anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship, AN_NSSI) + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + + msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index 0088ed4e54..bc155c5943 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -34,6 +34,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.aai.domain.yang.Relationship import org.onap.aai.domain.yang.ServiceInstance import org.onap.aai.domain.yang.SliceProfile +import org.onap.aaiclient.client.aai.AAINamespaceConstants import org.onap.aaiclient.client.aai.AAIResourcesClient import org.onap.aaiclient.client.aai.entities.AAIResultWrapper import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri @@ -53,6 +54,7 @@ import org.onap.so.bpmn.core.json.JsonUtils import org.slf4j.Logger import org.slf4j.LoggerFactory import static org.apache.commons.lang3.StringUtils.isBlank +import org.onap.aaiclient.client.aai.AAIObjectType class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ @@ -62,6 +64,8 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ JsonUtils jsonUtil = new JsonUtils() + AnNssmfUtils anNssmfUtils = new AnNssmfUtils() + AAIResourcesClient client = getAAIClient() /** @@ -75,6 +79,13 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String msg = "" logger.trace("Enter preProcessRequest()") Map nssiMap = new HashMap<>() + int nsstCount=execution.getVariable("nsstCount") as int + if(nsstCount==5){ + execution.setVariable("processFHandMH", true) + } + else{ + execution.setVariable("processFHandMH", false) + } execution.setVariable("nssiMap", nssiMap) boolean isMoreNSSTtoProcess = true execution.setVariable("isMoreNSSTtoProcess", isMoreNSSTtoProcess) @@ -393,26 +404,26 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ //todo: SliceTaskParamsAdapter sliceParams = execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter - SliceTaskInfo sliceTaskInfo = sliceParams.anSliceTaskInfo + SliceTaskInfo sliceTaskInfo = sliceParams.getAnSliceTaskInfo() NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest() AllocateAnNssi allocateAnNssi = new AllocateAnNssi() - allocateAnNssi.sliceProfile = sliceTaskInfo.sliceProfile.trans2AnProfile() - allocateAnNssi.sliceProfile.sliceProfileId = sliceTaskInfo.sliceInstanceId - allocateAnNssi.nsstId = sliceTaskInfo.NSSTInfo.UUID - allocateAnNssi.nssiId = sliceTaskInfo.suggestNssiId - allocateAnNssi.nssiName = "nssi_an" + execution.getVariable("sliceServiceInstanceName") - allocateAnNssi.scriptName = sliceTaskInfo.getScriptName() + allocateAnNssi.setSliceProfile(sliceTaskInfo.getSliceProfile().trans2AnProfile()) + allocateAnNssi.getSliceProfile().setSliceProfileId(sliceTaskInfo.getSliceInstanceId()) + allocateAnNssi.setNsstId(sliceTaskInfo.getNSSTInfo().getUUID()) + allocateAnNssi.setNssiId(sliceTaskInfo.getSuggestNssiId()) + allocateAnNssi.setNssiName("nssi_an" + execution.getVariable("sliceServiceInstanceName") as String) + allocateAnNssi.setScriptName(sliceTaskInfo.getScriptName()) NsiInfo nsiInfo = new NsiInfo() - nsiInfo.nsiId = sliceParams.suggestNsiId - nsiInfo.nsiName = sliceParams.suggestNsiName - allocateAnNssi.nsiInfo = nsiInfo + nsiInfo.setNsiId(sliceParams.getSuggestNsiId()) + nsiInfo.setNsiName(sliceParams.getSuggestNsiName()) + allocateAnNssi.setNsiInfo(nsiInfo) //endPoint EndPoint endPoint = new EndPoint() - endPoint.setIpAddress(sliceTaskInfo.sliceProfile.ipAddress) - endPoint.setLogicInterfaceId(sliceTaskInfo.sliceProfile.logicInterfaceId) - endPoint.setNextHopInfo(sliceTaskInfo.sliceProfile.nextHopInfo) + endPoint.setIpAddress(sliceTaskInfo.getSliceProfile().getIpAddress()) + endPoint.setLogicInterfaceId(sliceTaskInfo.getSliceProfile().getLogicInterfaceId()) + endPoint.setNextHopInfo(sliceTaskInfo.getSliceProfile().getNextHopInfo()) allocateAnNssi.setEndPoint(endPoint) EsrInfo esrInfo = new EsrInfo() @@ -420,19 +431,20 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ esrInfo.setVendor(sliceTaskInfo.getVendor()) esrInfo.setNetworkType(sliceTaskInfo.getNetworkType()) - String globalSubscriberId = execution.getVariable("globalSubscriberId") - String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + String globalSubscriberId = execution.getVariable("globalSubscriberId") as String + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") as String //todo: service info - ServiceInfo serviceInfo = new ServiceInfo() - serviceInfo.globalSubscriberId = globalSubscriberId - serviceInfo.subscriptionServiceType = subscriptionServiceType - serviceInfo.nsiId = sliceParams.suggestNsiId - serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID - serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID - serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") - serviceInfo.nssiName = sliceTaskInfo.suggestNssiId ? sliceTaskInfo.NSSTInfo.name : allocateAnNssi.nssiName - serviceInfo.nssiId = sliceTaskInfo.suggestNssiId + ServiceInfo serviceInfo = ServiceInfo.builder() + .globalSubscriberId(globalSubscriberId) + .subscriptionServiceType(subscriptionServiceType) + .nsiId(sliceParams.getSuggestNsiId()) + .serviceInvariantUuid(sliceTaskInfo.getNSSTInfo().getInvariantUUID()) + .serviceUuid(sliceTaskInfo.getNSSTInfo().getUUID()) + .sST(sliceTaskInfo.getSliceProfile().getSST() ?: sliceParams.getServiceProfile().get("sST") as String) + .nssiName(sliceTaskInfo.getSuggestNssiId() ? sliceTaskInfo.getNSSTInfo().getName() : allocateAnNssi.getNssiName()) + .nssiId(sliceTaskInfo.getSuggestNssiId()) + .build() nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) @@ -956,4 +968,450 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ return rspi } + public void createTNEndPoints(DelegateExecution execution) { + String type = "endpoint" + String function = "transport_EP" + int prefixLength = 24 + String addressFamily = "ipv4" + //BH RAN end point update + //set BH end point + String sliceParams = execution.getVariable("sliceParams") + List BH_endPoints = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceParams, "endPoints")) + logger.debug("BH end points list : "+BH_endPoints) + if(BH_endPoints.empty) { + String msg = "End point info is empty" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + String bh_routeId = UUID.randomUUID().toString() + execution.setVariable("tranportEp_ID_bh", bh_routeId) + String role = "CU" + String CU_IpAddress = jsonUtil.getJsonValue(bh_endpoint, "IpAddress") + String LogicalLinkId = jsonUtil.getJsonValue(bh_endpoint, "LogicalLinkId") + String nextHopInfo = jsonUtil.getJsonValue(bh_endpoint, "nextHopInfo") + NetworkRoute bh_ep = new NetworkRoute() + bh_ep.setRouteId(bh_routeId) + bh_ep.setFunction(function) + bh_ep.setRole(role) + bh_ep.setType(type) + bh_ep.setIpAddress(CU_IpAddress) + bh_ep.setLogicalInterfaceId(LogicalLinkId) + bh_ep.setNextHop(nextHopInfo) + bh_ep.setPrefixLength(prefixLength) + bh_ep.setAddressFamily(addressFamily) + //FH RAN end points update + //RU + String RU_routeId = UUID.randomUUID().toString() + execution.setVariable("tranportEp_ID_RU", RU_routeId) + role = "RU" + NetworkRoute RU_ep = new NetworkRoute() + RU_ep.setRouteId(RU_routeId) + RU_ep.setFunction(function) + RU_ep.setRole(role) + RU_ep.setType(type) + RU_ep.setIpAddress("192.168.100.4") + RU_ep.setLogicalInterfaceId("1234") + RU_ep.setNextHop("Host1") + RU_ep.setPrefixLength(prefixLength) + RU_ep.setAddressFamily(addressFamily) + //DU Ingress + String DUIN_routeId = UUID.randomUUID().toString() + execution.setVariable("tranportEp_ID_DUIN", DUIN_routeId) + role = "DU" + NetworkRoute DU_ep = new NetworkRoute() + DU_ep.setRouteId(DUIN_routeId) + DU_ep.setFunction(function) + DU_ep.setRole(role) + DU_ep.setType(type) + DU_ep.setIpAddress("192.168.100.5") + DU_ep.setLogicalInterfaceId("1234") + DU_ep.setNextHop("Host2") + DU_ep.setPrefixLength(prefixLength) + DU_ep.setAddressFamily(addressFamily) + //MH RAN end point update + //DUEG + String DUEG_routeId = UUID.randomUUID().toString() + execution.setVariable("tranportEp_ID_DUEG", DUEG_routeId) + NetworkRoute DUEG_ep = new NetworkRoute() + DUEG_ep.setRouteId(DUEG_routeId) + DUEG_ep.setFunction(function) + DUEG_ep.setRole(role) + DUEG_ep.setType(type) + DUEG_ep.setIpAddress("192.168.100.5") + DUEG_ep.setLogicalInterfaceId("1234") + DUEG_ep.setPrefixLength(prefixLength) + DUEG_ep.setAddressFamily(addressFamily) + DUEG_ep.setNextHop("Host3") + //CUIN + String CUIN_routeId = UUID.randomUUID().toString() + execution.setVariable("tranportEp_ID_CUIN", CUIN_routeId) + NetworkRoute CUIN_ep = new NetworkRoute() + CUIN_ep.setRouteId(CUIN_routeId) + CUIN_ep.setFunction(function) + CUIN_ep.setRole(role) + CUIN_ep.setType(type) + CUIN_ep.setIpAddress("192.168.100.6") + CUIN_ep.setLogicalInterfaceId("1234") + CUIN_ep.setNextHop("Host4") + CUIN_ep.setPrefixLength(prefixLength) + CUIN_ep.setAddressFamily(addressFamily) + try { + AAIResourcesClient client = new AAIResourcesClient() + logger.debug("creating bh endpoint . ID : "+bh_routeId+" node details : "+bh_ep.toString()) + AAIResourceUri networkRouteUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().networkRoute(bh_routeId)) + client.create(networkRouteUri, bh_ep) + logger.debug("creating RU endpoint . ID : "+RU_routeId+" node details : "+RU_ep.toString()) + networkRouteUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().networkRoute(RU_routeId)) + client.create(networkRouteUri, RU_ep) + logger.debug("creating DUIN endpoint . ID : "+DUIN_routeId+" node details : "+DU_ep.toString()) + networkRouteUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().networkRoute(DUIN_routeId)) + client.create(networkRouteUri, DU_ep) + logger.debug("creating DUEG endpoint . ID : "+DUEG_routeId+" node details : "+DUEG_ep.toString()) + networkRouteUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().networkRoute(DUEG_routeId)) + client.create(networkRouteUri, DUEG_ep) + logger.debug("creating CUIN endpoint . ID : "+CUIN_routeId+" node details : "+CUIN_ep.toString()) + networkRouteUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().networkRoute(CUIN_routeId)) + client.create(networkRouteUri, CUIN_ep) + //relationship b/w bh_ep and RAN NSSI + def AN_NSSI = execution.getVariable("RANServiceInstanceId") + Relationship relationship = new Relationship() + String relatedLink = "aai/v21/network/network-routes/network-route/${bh_routeId}" + relationship.setRelatedLink(relatedLink) + relationship.setRelatedTo("network-route") + relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + anNssmfUtils.createRelationShipInAAI(execution, relationship, AN_NSSI) + def ANNF_serviceInstanceId = execution.getVariable("RANNFServiceInstanceId") + relatedLink = "aai/v21/network/network-routes/network-route/${RU_routeId}" + relationship.setRelatedLink(relatedLink) + anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId) + relatedLink = "aai/v21/network/network-routes/network-route/${DUIN_routeId}" + relationship.setRelatedLink(relatedLink) + anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId) + relatedLink = "aai/v21/network/network-routes/network-route/${DUEG_routeId}" + relationship.setRelatedLink(relatedLink) + anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId) + relatedLink = "aai/v21/network/network-routes/network-route/${CUIN_routeId}" + relationship.setRelatedLink(relatedLink) + anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in createEndPointsInAai " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + /** + * create TN Slice Profile Instance + * @param execution + */ + void createTnFHSliceProfileInstance(DelegateExecution execution) { + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + String oStatus = "deactivated" + + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + + SliceTaskInfo sliceTaskInfo = sliceParams.tnFHSliceTaskInfo + String serviceInstanceId = UUID.randomUUID().toString() + + sliceTaskInfo.setSliceInstanceId(serviceInstanceId) + String sliceProfileName = "tn_fh" + sliceParams.serviceName + //execution.setVariable("cnSliceProfileInstanceId", serviceInstanceId) //todo: + + // create slice profile + ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, sliceProfileName, oStatus) + + //timestamp format YYYY-MM-DD hh:mm:ss + rspi.setCreatedAt(new Date(System.currentTimeMillis()).format("yyyy-MM-dd HH:mm:ss", TimeZone.getDefault())) + + execution.setVariable("communicationServiceInstance", rspi) + + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(serviceInstanceId)) + client.create(uri, rspi) + + execution.setVariable("sliceTaskParams", sliceParams) + } + + /** + * create Tn Slice Profile + * @param execution + */ + void createTnFHSliceProfile(DelegateExecution execution) { + + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + + SliceTaskInfo sliceTaskInfo = sliceParams.tnFHSliceTaskInfo + + SliceProfileAdapter tnSliceProfile = sliceTaskInfo.sliceProfile + String profileId = UUID.randomUUID().toString() + tnSliceProfile.setSliceProfileId(profileId) + + SliceProfile sliceProfile = new SliceProfile() + sliceProfile.setProfileId(profileId) + sliceProfile.setLatency(tnSliceProfile.latency) + sliceProfile.setMaxBandwidth(tnSliceProfile.maxBandwidth) + sliceProfile.setJitter(tnSliceProfile.jitter) + + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(sliceTaskInfo.sliceInstanceId) + .sliceProfile(profileId)) + client.create(uri, sliceProfile) + + execution.setVariable("sliceTaskParams", sliceParams) + } + + /** + * prepare AllocateCnNssi + * @param execution + */ + void prepareAllocateTnFHNssi(DelegateExecution execution) { + + //todo: + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + SliceTaskInfo sliceTaskInfo = sliceParams.getTnFHSliceTaskInfo() + + NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest() + + AllocateTnNssi allocateTnNssi = new AllocateTnNssi() + allocateTnNssi.setNssiId(sliceTaskInfo.getSuggestNssiId()) + //todo: AllocateTnNssi + //todo: endPointId -> set into tn + List transportSliceNetworks = new ArrayList<>() + TransportSliceNetwork transportSliceNetwork = new TransportSliceNetwork() + List connectionLinks = new ArrayList<>() + ConnectionLink connectionLink = new ConnectionLink() + connectionLink.setTransportEndpointA(execution.getVariable("tranportEp_ID_RU") as String) + connectionLink.setTransportEndpointB(execution.getVariable("tranportEp_ID_DUIN") as String) + connectionLinks.add(connectionLink) + transportSliceNetwork.setConnectionLinks(connectionLinks) + transportSliceNetworks.add(transportSliceNetwork) + allocateTnNssi.setTransportSliceNetworks(transportSliceNetworks) + + allocateTnNssi.setSliceProfile(sliceTaskInfo.getSliceProfile().trans2TnProfile()) + NsiInfo nsiInfo = new NsiInfo() + nsiInfo.setNsiId(sliceParams.getSuggestNsiId()) + nsiInfo.setNsiName(sliceParams.getSuggestNsiName()) + allocateTnNssi.setNsiInfo(nsiInfo) + + EsrInfo esrInfo = new EsrInfo() + esrInfo.setVendor(sliceTaskInfo.getVendor()) + esrInfo.setNetworkType(sliceTaskInfo.getNetworkType()) + + String globalSubscriberId = execution.getVariable("globalSubscriberId") as String + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") as String + + ServiceInfo serviceInfo = ServiceInfo.builder() + .globalSubscriberId(globalSubscriberId) + .subscriptionServiceType(subscriptionServiceType) + .nsiId(sliceParams.getSuggestNsiId()) + .serviceInvariantUuid(sliceTaskInfo.getNSSTInfo().getInvariantUUID()) + .setServiceUuid(sliceTaskInfo.getNSSTInfo().getUUID()) + .nssiId(sliceTaskInfo.getSuggestNssiId()) + .sST(sliceTaskInfo.getSliceProfile().getSST() ?: sliceParams.getServiceProfile().get("sST")) + .nssiName("nssi_tn_fh_" + execution.getVariable("sliceServiceInstanceName") as String) + .build() + + nbiRequest.setServiceInfo(serviceInfo) + nbiRequest.setEsrInfo(esrInfo) + nbiRequest.setAllocateTnNssi(allocateTnNssi) + + execution.setVariable("TnFHAllocateNssiNbiRequest", nbiRequest) + execution.setVariable("tnFHSliceTaskInfo", sliceTaskInfo) + execution.setVariable("tnFHSubnetType", SubnetType.TN_BH) + } + + /** + * Update relationship between + * 1. NSI and NSSI + * 2. Slice Profile and Service Profile + * 3. SliceProfile and NSSI + * + * @param execution + */ + public void updateTnFHRelationship(DelegateExecution execution) { + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + + NssiResponse result = execution.getVariable("tnFHNssiAllocateResult") as NssiResponse + String nssiId = result.getNssiId() + String nsiId = sliceParams.getSuggestNsiId() + String sliceProfileInstanceId = sliceParams.tnFHSliceTaskInfo.sliceInstanceId + String serviceProfileInstanceId = sliceParams.serviceId + + updateRelationship(execution, nsiId, nssiId) + + updateRelationship(execution, serviceProfileInstanceId, sliceProfileInstanceId) + + updateRelationship(execution,sliceProfileInstanceId, nssiId) + + sliceParams.tnFHSliceTaskInfo.suggestNssiId = nssiId + execution.setVariable("sliceTaskParams", sliceParams) + } + + /** + * create TN Slice Profile Instance + * @param execution + */ + void createTnMHSliceProfileInstance(DelegateExecution execution) { + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + String oStatus = "deactivated" + + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + + SliceTaskInfo sliceTaskInfo = sliceParams.tnMHSliceTaskInfo + String serviceInstanceId = UUID.randomUUID().toString() + + sliceTaskInfo.setSliceInstanceId(serviceInstanceId) + String sliceProfileName = "tn_mh_" + sliceParams.serviceName + ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, sliceProfileName, oStatus) + + rspi.setCreatedAt(new Date(System.currentTimeMillis()).format("yyyy-MM-dd HH:mm:ss", TimeZone.getDefault())) + + execution.setVariable("communicationServiceInstance", rspi) + + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(serviceInstanceId)) + client.create(uri, rspi) + + execution.setVariable("sliceTaskParams", sliceParams) + } + + /** + * create Tn Slice Profile + * @param execution + */ + void createTnMHSliceProfile(DelegateExecution execution) { + + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + + SliceTaskInfo sliceTaskInfo = sliceParams.tnMHSliceTaskInfo + + SliceProfileAdapter tnSliceProfile = sliceTaskInfo.sliceProfile + String profileId = UUID.randomUUID().toString() + tnSliceProfile.setSliceProfileId(profileId) + + SliceProfile sliceProfile = new SliceProfile() + sliceProfile.setProfileId(profileId) + sliceProfile.setLatency(tnSliceProfile.latency) + sliceProfile.setMaxBandwidth(tnSliceProfile.maxBandwidth) + sliceProfile.setJitter(tnSliceProfile.jitter) + + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(sliceTaskInfo.sliceInstanceId) + .sliceProfile(profileId)) + client.create(uri, sliceProfile) + + execution.setVariable("sliceTaskParams", sliceParams) + } + + /** + * prepare AllocateCnNssi + * @param execution + */ + void prepareAllocateTnMHNssi(DelegateExecution execution) { + + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + SliceTaskInfo sliceTaskInfo = sliceParams.getTnMHSliceTaskInfo() + + NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest() + + AllocateTnNssi allocateTnNssi = new AllocateTnNssi() + allocateTnNssi.setNssiId(sliceTaskInfo.getSuggestNssiId()) + List transportSliceNetworks = new ArrayList<>() + TransportSliceNetwork transportSliceNetwork = new TransportSliceNetwork() + List connectionLinks = new ArrayList<>() + ConnectionLink connectionLink = new ConnectionLink() + connectionLink.setTransportEndpointA(execution.getVariable("tranportEp_ID_DUEG") as String) + connectionLink.setTransportEndpointB(execution.getVariable("tranportEp_ID_CUIN") as String) + connectionLinks.add(connectionLink) + transportSliceNetwork.setConnectionLinks(connectionLinks) + transportSliceNetworks.add(transportSliceNetwork) + allocateTnNssi.setTransportSliceNetworks(transportSliceNetworks) + + allocateTnNssi.setSliceProfile(sliceTaskInfo.getSliceProfile().trans2TnProfile()) + NsiInfo nsiInfo = new NsiInfo() + nsiInfo.setNsiId(sliceParams.getSuggestNsiId()) + nsiInfo.setNsiName(sliceParams.getSuggestNsiName()) + allocateTnNssi.setNsiInfo(nsiInfo) + + EsrInfo esrInfo = new EsrInfo() + esrInfo.setVendor(sliceTaskInfo.getVendor()) + esrInfo.setNetworkType(sliceTaskInfo.getNetworkType()) + + String globalSubscriberId = execution.getVariable("globalSubscriberId") as String + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") as String + + ServiceInfo serviceInfo = ServiceInfo.builder() + .globalSubscriberId(globalSubscriberId) + .subscriptionServiceType(subscriptionServiceType) + .nsiId(sliceParams.getSuggestNsiId()) + .serviceInvariantUuid(sliceTaskInfo.getNSSTInfo().getInvariantUUID()) + .serviceUuid(sliceTaskInfo.getNSSTInfo().getUUID()) + .nssiId(sliceTaskInfo.getSuggestNssiId()) + .sST(sliceTaskInfo.getSliceProfile().getSST() ?: sliceParams.getServiceProfile().get("sST")) + .nssiName("nssi_tn_bh_" + execution.getVariable("sliceServiceInstanceName") as String) + .build() + + nbiRequest.setServiceInfo(serviceInfo) + nbiRequest.setEsrInfo(esrInfo) + nbiRequest.setAllocateTnNssi(allocateTnNssi) + + execution.setVariable("TnMHAllocateNssiNbiRequest", nbiRequest) + execution.setVariable("tnMHSliceTaskInfo", sliceTaskInfo) + execution.setVariable("tnMHSubnetType", SubnetType.TN_BH) + } + + /** + * Update relationship between + * 1. NSI and NSSI + * 2. Slice Profile and Service Profile + * 3. SliceProfile and NSSI + * + * @param execution + */ + public void updateTnMHRelationship(DelegateExecution execution) { + SliceTaskParamsAdapter sliceParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + + NssiResponse result = execution.getVariable("tnMHNssiAllocateResult") as NssiResponse + String nssiId = result.getNssiId() + String nsiId = sliceParams.getSuggestNsiId() + String sliceProfileInstanceId = sliceParams.tnMHSliceTaskInfo.sliceInstanceId + String serviceProfileInstanceId = sliceParams.serviceId + + updateRelationship(execution, nsiId, nssiId) + + updateRelationship(execution, serviceProfileInstanceId, sliceProfileInstanceId) + + updateRelationship(execution,sliceProfileInstanceId, nssiId) + + sliceParams.tnMHSliceTaskInfo.suggestNssiId = nssiId + execution.setVariable("sliceTaskParams", sliceParams) + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy index 5476cb5afa..35b4199909 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy @@ -117,7 +117,7 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ String modelUuid = modelInfo.getModelUuid() ss.setModelInvariantId(modelInvariantUuid) ss.setModelVersionId(modelUuid) - String serviceInstanceLocationid = serviceProfile.get("plmnIdList") + String serviceInstanceLocationid = serviceProfile.get("pLMNIdList") ss.setServiceInstanceLocationId(serviceInstanceLocationid) String snssai = serviceProfile.get("sNSSAI") ss.setEnvironmentContext(snssai) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy index ac959543a2..2588d07e50 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy @@ -213,6 +213,22 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ sliceParams.tnMHSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid() sliceParams.tnMHSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName() break + case SubnetType.TN_FH: + sliceParams.tnFHSliceTaskInfo.vendor = vendor + sliceParams.tnFHSliceTaskInfo.subnetType = subnetType + sliceParams.tnFHSliceTaskInfo.networkType = subnetType.networkType + sliceParams.tnFHSliceTaskInfo.NSSTInfo.UUID = modelInfo.getModelUuid() + sliceParams.tnFHSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid() + sliceParams.tnFHSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName() + break + case SubnetType.AN_NF: + sliceParams.anNFSliceTaskInfo.vendor = vendor + sliceParams.anNFSliceTaskInfo.subnetType = subnetType + sliceParams.anNFSliceTaskInfo.networkType = subnetType.networkType + sliceParams.anNFSliceTaskInfo.NSSTInfo.UUID = modelInfo.getModelUuid() + sliceParams.anNFSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid() + sliceParams.anNFSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName() + break case SubnetType.AN: sliceParams.anSliceTaskInfo.vendor = vendor sliceParams.anSliceTaskInfo.subnetType = subnetType @@ -255,18 +271,24 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ * @return */ private SubnetType convertServiceCategory(String serviceCategory){ - if(serviceCategory ==~ /CN.*/){ + if("CN NSST".equals(serviceCategory)){ return SubnetType.CN } - if (serviceCategory ==~ /AN.*/){ + if ("AN NF NSST".equals(serviceCategory)){ + return SubnetType.AN_NF + } + if ("AN NSST".equals(serviceCategory)){ return SubnetType.AN } - if (serviceCategory ==~ /TN.*BH.*/){ + if ("TN BH NSST".equals(serviceCategory)){ return SubnetType.TN_BH } - if(serviceCategory ==~ /TN.*MH.*/){ + if("TN MH NSST".equals(serviceCategory)){ return SubnetType.TN_MH } + if("TN FH NSST".equals(serviceCategory)){ + return SubnetType.TN_FH + } return null } @@ -426,7 +448,15 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ case "tn_bh": sliceParams.tnBHSliceTaskInfo.sliceProfile = adapter break + case "tn_fh": + sliceParams.tnFHSliceTaskInfo.sliceProfile = adapter + break + case "tn_mh": + sliceParams.tnMHSliceTaskInfo.sliceProfile = adapter + break case "an_nf": + sliceParams.anNFSliceTaskInfo.sliceProfile = adapter + break case "an": sliceParams.anSliceTaskInfo.sliceProfile = adapter break diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy index 08c03b0dbb..e0c2b776fe 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy @@ -377,7 +377,7 @@ class TnNssmfUtils { logger.debug("mso.workflow.TnNssmf.enableSDNCNetworkConfig is undefined, so use default value (true)") enableSdnc = "true" } - + enableSdnc = "false" logger.debug("setEnableSdncConfig: enableSdnc=" + enableSdnc) execution.setVariable("enableSdnc", enableSdnc) diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn index 290e13d05c..4d452aa57d 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_03s744c @@ -283,6 +283,7 @@ css.prepareUpdateOrchestrationTask(execution) + SequenceFlow_1bevt3a SequenceFlow_0mlrlbv @@ -319,6 +320,7 @@ css.prepareUpdateOrchestrationTask(execution) + SequenceFlow_1f6dyxo SequenceFlow_1aaozcg @@ -452,6 +454,66 @@ css.prepareSelectNSTRequest(execution) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -561,6 +623,9 @@ css.prepareSelectNSTRequest(execution) + + + @@ -591,15 +656,6 @@ css.prepareSelectNSTRequest(execution) - - - - - - - - - @@ -629,9 +685,15 @@ css.prepareSelectNSTRequest(execution) + + + + + + @@ -689,93 +751,47 @@ css.prepareSelectNSTRequest(execution) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -788,26 +804,12 @@ css.prepareSelectNSTRequest(execution) - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn index 9df7398f8c..85aa7c2bf5 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn @@ -1,5 +1,5 @@ - + Flow_163f3sq @@ -12,14 +12,14 @@ def nss = new DoAllocateAccessNSSI() nss.preProcessRequest(execution) - Flow_00f37fu + Flow_1xcjj1m Flow_1w8whur import org.onap.so.bpmn.infrastructure.scripts.* def nss = new DoAllocateAccessNSSI() nss.getSubnetCapabilities(execution) - Flow_0833cha + Flow_1gxbsoi Flow_1xw4abx import org.onap.so.bpmn.infrastructure.scripts.* def nss = new DoAllocateAccessNSSI() @@ -50,12 +50,12 @@ nss.prepareOperationStatusUpdate(execution) Flow_0ll5x3u - + - Flow_0rb4j9r + Flow_1eo3bed Flow_0d0f3ie import org.onap.so.bpmn.infrastructure.scripts.* def nss = new DoAllocateAccessNSSI() @@ -80,7 +80,7 @@ nss.prepareTnMhRequest(execution) - Flow_0kcvava + Flow_0bd6dhi @@ -120,7 +120,7 @@ nss.prepareOofRequestForRanNSS(execution) - Flow_1exjm0h + Flow_0d40k12 @@ -256,12 +256,11 @@ nss.processMhAllocateNssiJobStatusRsp(execution) Flow_1i10qog - Flow_00f37fu + Flow_1f0furp import org.onap.so.bpmn.infrastructure.scripts.* def nss = new DoAllocateAccessNSSI() nss.processDecomposition(execution) - @@ -278,7 +277,7 @@ nss.processDecomposition(execution) Flow_1k3vqxg - Flow_0n1mh5c + Flow_1tx240t import org.onap.so.bpmn.infrastructure.scripts.* def nss = new DoAllocateAccessNSSI() nss.processRanNfModifyRsp(execution) @@ -395,7 +394,7 @@ nss.processNsstDecomposition(execution) - + #{(execution.getVariable("isAllNsstsDecomposed" ) == true)} @@ -432,12 +431,11 @@ def nss = new DoAllocateAccessNSSI() nss.updateAaiWithRANInstances(execution) - - - + + - Flow_0bd6dhi - Flow_0kcvava + Flow_0833cha + Flow_1gxbsoi import org.onap.so.bpmn.infrastructure.scripts.* def nss = new DoAllocateAccessNSSI() nss.updateAairelationships(execution) @@ -492,10 +490,9 @@ nss.prepareFailedOperationStatusUpdate(execution) - Flow_0n1mh5c + Flow_15uux8j - @@ -513,52 +510,125 @@ nss.prepareFailedOperationStatusUpdate(execution) + + + Flow_0rb4j9r + + + + Flow_1eo3bed + + + + + Flow_1exjm0h + Flow_0d40k12 + Flow_024x74t + + + + Flow_024x74t + + + + #{(execution.getVariable("IsRANNfAlonePresent" ) == true)} + + + Flow_1f0furp + Flow_1xcjj1m + Flow_0twvyso + + + + Flow_0twvyso + + + + #{(execution.getVariable("IsRANNfAlonePresent" ) == true)} + + + + Flow_1tx240t + Flow_15uux8j + Flow_1ryf352 + + + + + Flow_1ryf352 + + + + #{(execution.getVariable("IsRANNfAlonePresent" ) == true)} + - - - + + + - - - + + + + + + - - - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - - + @@ -609,48 +679,36 @@ nss.prepareFailedOperationStatusUpdate(execution) - - - - - - + + - - + + - - - - - - - - - - + + - - + + - + - - + + - - + + - - + + @@ -669,22 +727,22 @@ nss.prepareFailedOperationStatusUpdate(execution) - - + + - - + + - - + + - - + + - + @@ -699,38 +757,72 @@ nss.prepareFailedOperationStatusUpdate(execution) - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -742,52 +834,52 @@ nss.prepareFailedOperationStatusUpdate(execution) - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -801,31 +893,19 @@ nss.prepareFailedOperationStatusUpdate(execution) - - - - - - - + - + - + - - - - - - - + - + @@ -838,22 +918,19 @@ nss.prepareFailedOperationStatusUpdate(execution) - + - + - + - - - - + - + @@ -861,9 +938,6 @@ nss.prepareFailedOperationStatusUpdate(execution) - - - @@ -898,62 +972,128 @@ nss.prepareFailedOperationStatusUpdate(execution) - + - + - - - - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateNSIandNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateNSIandNSSI.bpmn index c6268d3638..51f96ee8a9 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateNSIandNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateNSIandNSSI.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0xgfj7z @@ -155,7 +155,7 @@ dcnsio.createCnSliceProfileInstance(execution) def dcnsio = new DoAllocateNSIandNSSI() dcnsio.createCnSliceProfile(execution) - + SequenceFlow_0paqrtx SequenceFlow_1d48cil @@ -230,7 +230,7 @@ dcnsio.updateCnRelationship(execution) SequenceFlow_150xio1 - SequenceFlow_0ax2c4p + Flow_0ehx22x @@ -274,56 +274,363 @@ dcnsio.createANEndpoint(execution) def dcnsio = new DoAllocateNSIandNSSI() dcnsio.createCNEndpoint(execution) + + Flow_19564hj + + + + Flow_19564hj + Flow_1j649ha + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.createTnFHSliceProfileInstance(execution) + + + Flow_1j649ha + Flow_1hhipma + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.createTnFHSliceProfile(execution) + + + Flow_1hhipma + Flow_00n25jt + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.prepareAllocateTnFHNssi(execution) + + + + + + + + + + + + + + + + + + + + + + Flow_00n25jt + Flow_1b3a4vn + + + Flow_1b3a4vn + Flow_0dpbero + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.updateTnFHRelationship(execution) + + + + + + + + Flow_0bu5pc9 + + + + Flow_0bu5pc9 + Flow_04gnit7 + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.createTnMHSliceProfileInstance(execution) + + + Flow_04gnit7 + Flow_1i02ybs + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.createTnMHSliceProfile(execution) + + + Flow_1i02ybs + Flow_0shgflm + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.prepareAllocateTnMHNssi(execution) + + + + + + + + + + + + + + + + + + + + + + Flow_0shgflm + Flow_05lgxne + + + Flow_05lgxne + Flow_0imtsjm + import org.onap.so.bpmn.infrastructure.scripts.* +def dcnsio = new DoAllocateNSIandNSSI() +dcnsio.updateTnMHRelationship(execution) + + + + + + + + + Flow_0dpbero + + + + + Flow_0imtsjm + + + + SequenceFlow_0ax2c4p + Flow_0ehx22x + Flow_13i03hb + + + Flow_13i03hb + + + + + #{(execution.getVariable("processFHandMH" ) == true)} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - @@ -336,184 +643,149 @@ dcnsio.createCNEndpoint(execution) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + - + - - - - - - + + - - - - - - + + - - - - - - - + + + + + + + + - - - - - - - - - - - - - - + - - + + - + - - + + - - - - - - + + - - - - - - - - - - + + - - - - - - - - - - + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg