import java.util.List
import static org.apache.commons.lang3.StringUtils.isBlank
import com.google.gson.JsonObject
+import com.google.gson.Gson
import com.fasterxml.jackson.databind.ObjectMapper
import com.google.gson.JsonArray
import com.google.gson.JsonParser
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aai.domain.yang.NetworkPolicy
import org.onap.aai.domain.yang.NetworkRoute
+import org.json.JSONArray
class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
" subscriptionServiceType - "+execution.getVariable("subscriptionServiceType")+
" jobId - "+execution.getVariable("jobId")+
" sliceParams - "+execution.getVariable("sliceParams")+
- " servicename - "+ execution.getVariable("servicename"))
+ " servicename - "+ execution.getVariable("servicename")+
+ " sst - "+ execution.getVariable("sst"))
//validate slice subnet inputs
execution.setVariable("sliceProfile", sliceProfile)
}
String sliceProfileId = jsonUtil.getJsonValue(sliceProfile, "sliceProfileId")
- def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "sNSSAI"))
+ def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "snssaiList"))
def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "pLMNIdList"))
- def coverageAreaTAList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList"))
+ String jsonArray = jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList")
+ List<Integer> list = new ArrayList<>();
+ JSONArray arr = new JSONArray(jsonArray);
+ for (int i = 0; i < arr.length(); i++) {
+ int s = (int) arr.get(i);
+ list.add(s);
+ }
+ def coverageAreaTAList = list;
if (isBlank(sliceProfileId) || (snssaiList.empty) || (plmnIdList.empty)
|| (coverageAreaTAList.empty)) {
} else {
execution.setVariable("sliceProfileId", sliceProfileId)
execution.setVariable("snssaiList", snssaiList)
- execution.setVariable("plmnIdList", plmnIdList)
+ execution.setVariable("pLMNIdList", plmnIdList)
execution.setVariable("coverageAreaTAList", coverageAreaTAList)
}
String nsiName = jsonUtil.getJsonValue(sliceParams, "nsiInfo.nsiName")
execution.setVariable("job_timeout", 10)
//set BH end point
- List<String> BH_endPoints = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceParams, "endPoints"))
- logger.debug("BH end points list : "+BH_endPoints)
- if(BH_endPoints.empty) {
- msg = "End point info is empty"
- logger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- }else {
- execution.setVariable("bh_endpoint", BH_endPoints.get(0))
- }
-
+ def BH_endPoints = jsonUtil.getJsonValue(sliceParams, "endPoint")
+ logger.debug("BH end points list : "+BH_endPoints)
+ if(isBlank(BH_endPoints)) {
+ msg = "End point info is empty"
+ logger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }else {
+ execution.setVariable("bh_endpoint", BH_endPoints)
+ }
+
} catch(BpmnError e) {
throw e
} catch(Exception ex) {
//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)
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
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)
}
/*
String requestId = execution.getVariable("msoRequestId")
String messageType = "NSISelectionResponse"
Map<String, Object> profileInfo = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class)
+ profileInfo.put("sST",execution.getVariable("sst"))
String modelUuid = execution.getVariable("modelUuid")
String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
String modelName = execution.getVariable("ranModelName")
execution.setVariable("isRspRanNssi", true)
}else {
JsonObject newNSISolution = sol.get("newNSISolution").getAsJsonObject()
- JsonArray sliceProfiles = newNSISolution.get("slice_profiles").getAsJsonArray()
+ JsonArray sliceProfiles = newNSISolution.get("sliceProfiles").getAsJsonArray()
logger.debug("RanConstituentSliceProfiles list from OOF "+sliceProfiles)
execution.setVariable("RanConstituentSliceProfiles", sliceProfiles.toString())
}
modifySliceParams.addProperty("snssaiList", snssaiList)
modifySliceParams.addProperty("sliceProfileId", sliceProfileId)
modifySliceParams.addProperty("nsiInfo", nsiInfo)
- modifySliceParams.addProperty("scriptName", scriptName)
execution.setVariable("modifySliceParams", modifySliceParams.toString())
//create operation status in request db
- String serviceId = execution.getVariable("RANServiceInstanceId")
String nsiId = execution.getVariable("nsiId")
- logger.debug("Generated new job for Service Instance serviceId:" + serviceId + "jobId:" + jobId)
+ String modelUuid = execution.getVariable("modelUuid")
+ logger.debug("Generated new job for Service Instance serviceId:" + nsiId + "jobId:" + jobId)
ResourceOperationStatus initStatus = new ResourceOperationStatus()
- initStatus.setServiceId(serviceId)
+ initStatus.setServiceId(nsiId)
initStatus.setOperationId(jobId)
- initStatus.setResourceTemplateUUID(nsiId)
+ initStatus.setResourceTemplateUUID(modelUuid)
initStatus.setOperType("Modify")
requestDBUtil.prepareInitResourceOperationStatus(execution, initStatus)
}
serviceInfo.addProperty("nssiId", execution.getVariable("RANServiceInstanceId"))
serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
serviceInfo.addProperty("nssiName", execution.getVariable("servicename"))
- String sST = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- serviceInfo.addProperty("sST", sST)
- serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
+ serviceInfo.addProperty("sST", execution.getVariable("sst"))
+ serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("pLMNIdList")))
serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("modelInvariantUuid"))
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)
//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")
String modelInvariantUuid = execution.getVariable("ANNF_modelInvariantUuid")
String modelName = execution.getVariable("ANNF_modelName")
ServiceDecomposition serviceDecomposition = execution.getVariable("ANNF_ServiceDecomposition")
serviceDecomposition.setServiceInstance(serviceInstance);
execution.setVariable("ANNF_ServiceDecomposition", serviceDecomposition)
+ execution.setVariable("modifyAction","allocate")
execution.setVariable("isRspRanNfNssi", true)
}else {
logger.debug("No solutions returned from OOF .. Create new RAN NF NSSI")
String sliceInstanceName = execution.getVariable("servicename")
ANServiceInstance.setServiceInstanceName(sliceInstanceName)
String serviceType = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- ANServiceInstance.setServiceType(serviceType)
+ ANServiceInstance.setServiceType(execution.getVariable("sst"))
String serviceStatus = "deactivated"
ANServiceInstance.setOrchestrationStatus(serviceStatus)
- String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
- ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+ String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList")
+ ANServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
String serviceRole = "nssi"
ANServiceInstance.setServiceRole(serviceRole)
- List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+ List<String> snssaiList = execution.getVariable("snssaiList")
String snssai = snssaiList.get(0)
- ANServiceInstance.setEnvironmentContext(snssai)
- ANServiceInstance.setWorkloadContext("AN")
+ //ANServiceInstance.setEnvironmentContext(snssai)
+ String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
+ String modelUuid = execution.getVariable("modelUuid") as String
+ ANServiceInstance.setModelInvariantId(modelInvariantUuid)
+ ANServiceInstance.setModelVersionId(modelUuid)
+ ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type
+ ANServiceInstance.setWorkloadContext("AN") //domain Type
logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
String msg = ""
def createSdnrRequest = { DelegateExecution execution ->
logger.debug(Prefix+"createSdnrRequest method start")
String callbackUrl = UrnPropertiesReader.getVariable("mso.workflow.message.endpoint") + "/AsyncSdnrResponse/"+execution.getVariable("msoRequestId")
- String sdnrRequest = buildSdnrAllocateRequest(execution, "allocate", "InstantiateRANSlice", callbackUrl)
+ String sdnrRequest = buildSdnrAllocateRequest(execution, "allocate", "instantiateRANSlice", callbackUrl)
execution.setVariable("createNSSI_sdnrRequest", sdnrRequest)
execution.setVariable("createNSSI_timeout", "PT10M")
execution.setVariable("createNSSI_correlator", execution.getVariable("msoRequestId"))
//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(serviceType)
- String serviceStatus = "deactivated"
+ ANServiceInstance.setServiceType(execution.getVariable("sst") as String)
ANServiceInstance.setOrchestrationStatus(serviceStatus)
- String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList")
- ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
- String serviceRole = "nssi"
+ String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList") as String
+ ANServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
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)
+ String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
+ String modelUuid = execution.getVariable("modelUuid") as String
+ ANServiceInstance.setModelInvariantId(modelInvariantUuid)
+ ANServiceInstance.setModelVersionId(modelUuid)
+ ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type
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"))
- sliceInstanceName = execution.getVariable("ANNF_modelName")
+ ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId") as String)
+ String ANNF_nssiInstanceId = UUID.randomUUID().toString()
+ sliceInstanceName = "nssi_an_nf_" + ANNF_nssiInstanceId
ANNFServiceInstance.setServiceInstanceName(sliceInstanceName)
- ANNFServiceInstance.setServiceType(serviceType)
+ ANNFServiceInstance.setServiceType(execution.getVariable("sst") as String)
ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
- serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList")
- ANNFServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+ 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.setWorkloadContext("AN-NF")
- String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "resourceSharingLevel")
+ ANNFServiceInstance.setEnvironmentContext(execution.getVariable("networkType") as String)
+ ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid"))
+ ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid"))
+ ANNFServiceInstance.setWorkloadContext("AN_NF")
+ String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile") as String, "resourceSharingLevel")
ANNFServiceInstance.setServiceFunction(serviceFunctionAnnf)
logger.debug("completed AN service instance build "+ ANNFServiceInstance.toString())
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) {
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")
}
def createFhAllocateNssiJobQuery = { DelegateExecution execution ->
- logger.debug(Prefix+"createModifyNssiQueryJobStatus method start")
+ logger.debug(Prefix+"createFhAllocateNssiJobQuery method start")
createTnAllocateNssiJobQuery(execution, "TN_FH")
}
def createMhAllocateNssiJobQuery = { DelegateExecution execution ->
- logger.debug(Prefix+"createModifyNssiQueryJobStatus method start")
+ logger.debug(Prefix+"createMhAllocateNssiJobQuery method start")
createTnAllocateNssiJobQuery(execution, "TN_MH")
}
esrInfo.addProperty("vendor", "ONAP_internal")
execution.setVariable("esrInfo", esrInfo.toString())
JsonObject serviceInfo = new JsonObject()
- serviceInfo.addProperty("nssiId", null)
serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
- String sST = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- serviceInfo.addProperty("sST", sST)
- serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
+ serviceInfo.addProperty("sST", execution.getVariable("sst"))
+ serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("pLMNIdList")))
serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
if(domainType.equals("TN_FH")) {
logger.debug(Prefix+"processJobStatusRsp method start")
String jobResponse = execution.getVariable("TNFH_jobResponse")
logger.debug("Job status response "+jobResponse)
- String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status")
- String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi")
+ String status = jsonUtil.getJsonValue(jobResponse, "status")
+ String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId")
if(status.equalsIgnoreCase("finished")) {
execution.setVariable("TNFH_NSSI", nssi)
logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi)
}
else {
- String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.statusDescription")
+ String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription")
logger.error("received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription)
}
logger.debug(Prefix+"processJobStatusRsp method start")
String jobResponse = execution.getVariable("TNMH_jobResponse")
logger.debug("Job status response "+jobResponse)
- String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status")
- String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi")
+ String status = jsonUtil.getJsonValue(jobResponse, "status")
+ String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId")
if(status.equalsIgnoreCase("finished")) {
execution.setVariable("TNMH_NSSI", nssi)
logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi)
}
else {
- String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.statusDescription")
+ String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription")
logger.error("received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription)
}
logger.debug(Prefix+"processJobStatusRsp method start")
String jobResponse = execution.getVariable("jobResponse")
logger.debug("Job status response "+jobResponse)
- String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status")
- String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi")
+ String status = jsonUtil.getJsonValue(jobResponse, "status")
+ String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId")
if(status.equalsIgnoreCase("finished")) {
logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi)
}
else {
- String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.statusDescription")
+ String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription")
logger.error("received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription)
}
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)
+ }
}
}
def prepareOperationStatusUpdate = { DelegateExecution execution ->
logger.debug(Prefix + "prepareOperationStatusUpdate Start")
- String serviceId = execution.getVariable("dummyServiceId")
String jobId = execution.getVariable("jobId")
String nsiId = execution.getVariable("nsiId")
+ String modelUuid = execution.getVariable("modelUuid")
String nssiId = execution.getVariable("RANServiceInstanceId")
- logger.debug("Service Instance serviceId:" + serviceId + " jobId:" + jobId)
+ logger.debug("Service Instance serviceId:" + nsiId + " jobId:" + jobId)
ResourceOperationStatus updateStatus = new ResourceOperationStatus()
- updateStatus.setServiceId(serviceId)
+ updateStatus.setServiceId(nsiId)
updateStatus.setOperationId(jobId)
- updateStatus.setResourceTemplateUUID(nsiId)
+ updateStatus.setResourceTemplateUUID(modelUuid)
updateStatus.setResourceInstanceID(nssiId)
updateStatus.setOperType("Allocate")
updateStatus.setProgress("100")
def prepareFailedOperationStatusUpdate = { DelegateExecution execution ->
logger.debug(Prefix + "prepareFailedOperationStatusUpdate Start")
- String serviceId = execution.getVariable("dummyServiceId")
String jobId = execution.getVariable("jobId")
String nsiId = execution.getVariable("nsiId")
+ String modelUuid = execution.getVariable("modelUuid")
String nssiId = execution.getVariable("RANServiceInstanceId")
- logger.debug("Service Instance serviceId:" + serviceId + " jobId:" + jobId)
+ logger.debug("Service Instance serviceId:" + nsiId + " jobId:" + jobId)
ResourceOperationStatus updateStatus = new ResourceOperationStatus()
- updateStatus.setServiceId(serviceId)
+ updateStatus.setServiceId(nsiId)
updateStatus.setOperationId(jobId)
- updateStatus.setResourceTemplateUUID(nsiId)
+ updateStatus.setResourceTemplateUUID(modelUuid)
updateStatus.setResourceInstanceID(nssiId)
updateStatus.setOperType("Allocate")
updateStatus.setProgress("0")
String requestId = execution.getVariable("msoRequestId")
Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)
sliceProfile.put("sliceProfileId", execution.getVariable("ANNF_sliceProfileInstanceId"))
- sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSessions"))
+ sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSession"))
sliceProfile.put("uLThptPerSlice", sliceProfile.get("expDataRateUL"))
sliceProfile.put("dLThptPerSlice", sliceProfile.get("expDataRateDL"))
- String sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
+
JsonObject response = new JsonObject()
JsonObject body = new JsonObject()
JsonObject input = new JsonObject()
JsonObject commonHeader = new JsonObject()
JsonObject payload = new JsonObject()
JsonObject payloadInput = new JsonObject()
- commonHeader.addProperty("TimeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss", TimeZone.getDefault()))
- commonHeader.addProperty("APIver", "1.0")
- commonHeader.addProperty("RequestID", requestId)
- commonHeader.addProperty("SubRequestID", "1")
- commonHeader.add("RequestTrack", new JsonObject())
- commonHeader.add("Flags", new JsonObject())
- payloadInput.addProperty("sliceProfile", sliceProfileString)
+ commonHeader.addProperty("timestamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault()))
+ commonHeader.addProperty("api-ver", "1.0")
+ commonHeader.addProperty("originator-id", "testing")
+ commonHeader.addProperty("request-id", requestId)
+ commonHeader.addProperty("sub-request-id", "1")
+ commonHeader.add("flags", new JsonObject())
+ Gson jsonConverter = new Gson()
+ payloadInput.add("sliceProfile", jsonConverter.toJsonTree(sliceProfile))
payloadInput.addProperty("RANNSSIId", execution.getVariable("RANServiceInstanceId"))
payloadInput.addProperty("NSIID", execution.getVariable("nsiId"))
payloadInput.addProperty("RANNFNSSIId", execution.getVariable("RANNFServiceInstanceId"))
payloadInput.addProperty("callbackURL", callbackUrl)
+ payloadInput.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
+ payloadInput.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
payloadInput.add("additionalproperties", new JsonObject())
payload.add("input", payloadInput)
- input.add("CommonHeader", commonHeader)
- input.addProperty("Action", action)
- input.addProperty("Payload", payload.toString())
+ input.add("common-header", commonHeader)
+ input.addProperty("action", action)
+ input.addProperty("payload", payload.toString())
body.add("input", input)
response.add("body", body)
response.addProperty("version", "1.0")
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 CU_IpAddress = jsonUtil.getJsonValue(bh_endpoint, "ipAddress")
+ String LogicalLinkId = jsonUtil.getJsonValue(bh_endpoint, "logicInterfaceId")
String nextHopInfo = jsonUtil.getJsonValue(bh_endpoint, "nextHopInfo")
NetworkRoute bh_ep = new NetworkRoute()
bh_ep.setRouteId(bh_routeId)
RU_ep.setType(type)
RU_ep.setIpAddress("192.168.100.4")
RU_ep.setLogicalInterfaceId("1234")
- RU_ep.setNextHop("Host1")
+ RU_ep.setNextHop("networkId-providerId-10-clientId-0-topologyId-2-nodeId-10.1.1.1-ltpId-512")
RU_ep.setPrefixLength(prefixLength)
RU_ep.setAddressFamily(addressFamily)
//DU Ingress
DU_ep.setType(type)
DU_ep.setIpAddress("192.168.100.5")
DU_ep.setLogicalInterfaceId("1234")
- DU_ep.setNextHop("Host2")
+ DU_ep.setNextHop("networkId-providerId-20-clientId-0-topologyId-2-nodeId-10.2.1.2-ltpId-512")
DU_ep.setPrefixLength(prefixLength)
DU_ep.setAddressFamily(addressFamily)
//MH RAN end point update
DUEG_ep.setLogicalInterfaceId("1234")
DUEG_ep.setPrefixLength(prefixLength)
DUEG_ep.setAddressFamily(addressFamily)
- DUEG_ep.setNextHop("Host3")
+ DUEG_ep.setNextHop("networkId-providerId-10-clientId-0-topologyId-2-nodeId-10.1.1.1-ltpId-512")
//CUIN
String CUIN_routeId = UUID.randomUUID().toString()
execution.setVariable("tranportEp_ID_CUIN", CUIN_routeId)
CUIN_ep.setType(type)
CUIN_ep.setIpAddress("192.168.100.6")
CUIN_ep.setLogicalInterfaceId("1234")
- CUIN_ep.setNextHop("Host4")
+ CUIN_ep.setNextHop("networkId-providerId-20-clientId-0-topologyId-2-nodeId-10.2.1.2-ltpId-512")
CUIN_ep.setPrefixLength(prefixLength)
CUIN_ep.setAddressFamily(addressFamily)
try {