aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/main
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2021-09-17 14:01:07 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2021-10-12 19:41:04 +0530
commit315ac8db2585e2df5b608fb699b23754a80f764c (patch)
tree719248182c505d337ecb870bbead6d2516238bac /bpmn/so-bpmn-infrastructure-common/src/main
parent44d0dc792cb84b0c91b8024876e2c43116e54211 (diff)
Add feature to Support NSMF based TN slices
Issue-ID: SO-3764 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: I57f6db8fab6cbd0032f58ca8254d3f93d7a78147
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy101
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy231
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy506
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy38
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy2
7 files changed, 732 insertions, 152 deletions
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<String> 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<String> 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<String> snssaiList = execution.getVariable("snssaiList")
+ ArrayList<String> 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<String> sNssaiList = execution.getVariable("snssaiList")
+ List<String> sNssaiList = execution.getVariable("snssaiList") as List<String>
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<ServiceProxy> serviceProxyList = ranNsstServiceDecomposition.getServiceProxy()
List<String> 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<String> ranConstituentSliceProfiles = jsonUtil.StringArrayToList(execution.getVariable("RanConstituentSliceProfiles"))
- anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution)
+ if(execution.getVariable("maxIndex") > 1) {
+ List<String> ranConstituentSliceProfiles = jsonUtil.StringArrayToList(execution.getVariable("RanConstituentSliceProfiles") as String)
+ anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution)
+ }
Map<String, Object> 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<String> snssaiList = execution.getVariable("snssaiList")
+ List<String> 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<String, Object> 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<SliceProfileAdapter> sliceTaskInfo = sliceParams.anSliceTaskInfo
+ SliceTaskInfo<SliceProfileAdapter> 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<String> 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<SliceProfileAdapter> 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<SliceProfileAdapter> 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<SliceProfileAdapter> sliceTaskInfo = sliceParams.getTnFHSliceTaskInfo()
+
+ NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest()
+
+ AllocateTnNssi allocateTnNssi = new AllocateTnNssi()
+ allocateTnNssi.setNssiId(sliceTaskInfo.getSuggestNssiId())
+ //todo: AllocateTnNssi
+ //todo: endPointId -> set into tn
+ List<TransportSliceNetwork> transportSliceNetworks = new ArrayList<>()
+ TransportSliceNetwork transportSliceNetwork = new TransportSliceNetwork()
+ List<ConnectionLink> 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<SliceProfileAdapter> 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<SliceProfileAdapter> 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<SliceProfileAdapter> sliceTaskInfo = sliceParams.getTnMHSliceTaskInfo()
+
+ NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest()
+
+ AllocateTnNssi allocateTnNssi = new AllocateTnNssi()
+ allocateTnNssi.setNssiId(sliceTaskInfo.getSuggestNssiId())
+ List<TransportSliceNetwork> transportSliceNetworks = new ArrayList<>()
+ TransportSliceNetwork transportSliceNetwork = new TransportSliceNetwork()
+ List<ConnectionLink> 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)