summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2021-12-10 09:34:53 +0000
committerGerrit Code Review <gerrit@onap.org>2021-12-10 09:34:53 +0000
commit5724c4f084e48c93004d0c0f3c0ebbffc0f34d52 (patch)
tree172a5a009681c0fa6bd74ad870c10b4347334a9e
parentac72b81b53a366fbd6d38d4563d81dac26480f72 (diff)
parent832fd95969c42436d352e8965a4a51d6d5201648 (diff)
Merge "Fix issues in shared RAN NSSI flow"
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy8
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy35
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java3
4 files changed, 32 insertions, 17 deletions
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 10acd6ef50..9800428c68 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
@@ -1033,7 +1033,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
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
@@ -1047,7 +1047,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
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
@@ -1063,7 +1063,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
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)
@@ -1074,7 +1074,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
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 {
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 bc155c5943..a22819f2e9 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
@@ -444,6 +444,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
.sST(sliceTaskInfo.getSliceProfile().getSST() ?: sliceParams.getServiceProfile().get("sST") as String)
.nssiName(sliceTaskInfo.getSuggestNssiId() ? sliceTaskInfo.getNSSTInfo().getName() : allocateAnNssi.getNssiName())
.nssiId(sliceTaskInfo.getSuggestNssiId())
+ .resourceSharingLevel(sliceParams.serviceProfile.get("resourceSharingLevel") as String)
.build()
nbiRequest.setServiceInfo(serviceInfo)
@@ -590,6 +591,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
serviceInfo.nssiId = sliceTaskInfo.suggestNssiId //if shared
serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST")
serviceInfo.nssiName = allocateCnNssi.nssiName
+ serviceInfo.resourceSharingLevel = sliceParams.serviceProfile.get("resourceSharingLevel")
nbiRequest.setServiceInfo(serviceInfo)
nbiRequest.setEsrInfo(esrInfo)
@@ -727,6 +729,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
serviceInfo.nssiId = sliceTaskInfo.suggestNssiId
serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST")
serviceInfo.nssiName = "nssi_tn" + execution.getVariable("sliceServiceInstanceName")
+ serviceInfo.resourceSharingLevel = sliceParams.serviceProfile.get("resourceSharingLevel")
nbiRequest.setServiceInfo(serviceInfo)
nbiRequest.setEsrInfo(esrInfo)
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 90dd831308..7571f07081 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
@@ -21,6 +21,7 @@
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
@@ -473,7 +474,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
*/
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)
@@ -495,7 +499,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
*/
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)
@@ -516,7 +523,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
*/
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)
@@ -624,8 +634,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
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)
@@ -639,8 +651,8 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
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)
@@ -670,13 +682,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{
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)
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
index 5146685058..df137d0c01 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java
@@ -56,4 +56,7 @@ public class ServiceInfo implements Serializable {
private String pLMNIdList;
private String actionType;
+
+ private String resourceSharingLevel;
+
}