logger.debug("completed AN service instance build " + ANServiceInstance.toString())
//create RAN NF NSSI
ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId") as String)
- sliceInstanceName = "nssi_"+execution.getVariable("ANNF_modelName")
+ String ANNF_nssiInstanceId = UUID.randomUUID().toString()
+ sliceInstanceName = "nssi_an_nf_" + ANNF_nssiInstanceId
ANNFServiceInstance.setServiceInstanceName(sliceInstanceName)
ANNFServiceInstance.setServiceType(execution.getVariable("sst") as String)
ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
ANNFServiceInstance.setServiceRole(serviceRole)
snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String)
snssai = snssaiList.get(0)
- ANNFServiceInstance.setEnvironmentContext(snssai)
+ ANNFServiceInstance.setEnvironmentContext(execution.getVariable("networkType") as String)
ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid"))
ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid"))
ANNFServiceInstance.setWorkloadContext("AN_NF")
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 {
package org.onap.so.bpmn.infrastructure.scripts
import com.fasterxml.jackson.databind.ObjectMapper
+ import com.fasterxml.jackson.core.type.TypeReference
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.aai.domain.yang.ServiceInstance
import org.onap.so.beans.nsmf.EsrInfo
* @return
*/
private SubnetType convertServiceCategory(String serviceCategory){
- if("CN NSST".equals(serviceCategory)){
+ if(serviceCategory ==~ /CN.*/){
return SubnetType.CN
}
- if ("AN NF NSST".equals(serviceCategory)){
- return SubnetType.AN_NF
- }
- if ("AN NSST".equals(serviceCategory)){
+ if (serviceCategory ==~ /AN.*/){
return SubnetType.AN
}
- if ("TN BH NSST".equals(serviceCategory)){
+ if (serviceCategory ==~ /TN.*BH.*/){
return SubnetType.TN_BH
}
- if("TN MH NSST".equals(serviceCategory)){
+ if(serviceCategory ==~ /TN.*MH.*/){
return SubnetType.TN_MH
}
- if("TN FH NSST".equals(serviceCategory)){
+ if(serviceCategory ==~ /TN.*FH.*/){
return SubnetType.TN_FH
}
+
return null
}
*/
void getNSSISelectionCap4AN(DelegateExecution execution) {
- def vendor = execution.getVariable("vendor") as String
+ SliceTaskParamsAdapter sliceParams =
+ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+
+ def vendor = sliceParams.anSliceTaskInfo.vendor
String strRequest = buildNSSISelectionReq(vendor, NetworkType.ACCESS)
*/
void getNSSISelectionCap4TN(DelegateExecution execution) {
- def vendor = execution.getVariable("vendor") as String
+ SliceTaskParamsAdapter sliceParams =
+ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+
+ def vendor = sliceParams.tnBHSliceTaskInfo.vendor
String strRequest = buildNSSISelectionReq(vendor, NetworkType.TRANSPORT)
*/
void getNSSISelectionCap4CN(DelegateExecution execution) {
- def vendor = execution.getVariable("vendor") as String
+ SliceTaskParamsAdapter sliceParams =
+ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter
+
+ def vendor = sliceParams.cnSliceTaskInfo.vendor
String strRequest = buildNSSISelectionReq(vendor, NetworkType.CORE)
Map nssiNeedHandlerInfo = nssiNeedHandlerInfos.get(currNssiIndex) as Map
TemplateInfo nsstInfo = nssiNeedHandlerInfo.get("nsstInfo") as TemplateInfo
- Map<String, Object> profileInfo = nssiNeedHandlerInfo.get("sliceProfile") as Map
- //profileInfo.remove("profileId")
+ SliceProfileAdapter sliceProfileInfo = nssiNeedHandlerInfo.get("sliceProfile") as SliceProfileAdapter
+
+ Map profileInfo = objectMapper.convertValue(sliceProfileInfo, new TypeReference<Map<String, Object>>() {});
+ while (profileInfo.values().remove(null));
String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
logger.debug( "get NSI option OOF Url: " + urlString)
String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution)
execution.setVariable("nssiSelection_timeout", timeout)
- String oofRequest = oofUtils.buildSelectNSSIRequest(requestId, nsstInfo, messageType,
- profileInfo, 600)
+ String oofRequest = oofUtils.buildSelectNSSIRequest(requestId, messageType, nsstInfo.UUID,
+ nsstInfo.invariantUUID, nsstInfo.name, profileInfo)
execution.setVariable("nssiSelection_oofRequest", oofRequest)
logger.debug("Sending request to OOF: " + oofRequest)
Map<String, Object> resMap = objectMapper.readValue(OOFResponse, Map.class)
List<Map<String, Object>> nsiSolutions = (List<Map<String, Object>>) resMap.get("solutions")
- Map<String, Object> solution = nsiSolutions.get(0)
-
- String resourceSharingLevel = execution.getVariable("resourceSharingLevel")
- Boolean isSharable = resourceSharingLevel == "shared" //todo
- if (isSharable && solution != null) {
- processNssiResult(sliceTaskParams, subnetType, solution)
+ if(nsiSolutions.size()>=1) {
+ Map<String,Object> solution = nsiSolutions.get(0) as Map
+ processNssiResult(sliceTaskParams, subnetType, solution)
}
execution.setVariable("sliceTaskParams", sliceTaskParams)