X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2Fso-bpmn-infrastructure-common%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fonap%2Fso%2Fbpmn%2Finfrastructure%2Fscripts%2FDoAllocateNSIandNSSI.groovy;h=59decb56a47c5cf066db7e5320500293dcf501df;hb=73416d2bebe39643e30c91d0ce5a6f4d3f91ce62;hp=059a2093361bf8778a2f10665d790e3b1a5a1333;hpb=fa1596d23cec5ef99548069ad6f20077917f7e59;p=so.git 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 059a209336..59decb56a4 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 @@ -263,9 +263,10 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter SliceTaskInfo sliceTaskInfo = sliceParams.anSliceTaskInfo sliceTaskInfo.setSliceInstanceId(serviceInstanceId) + String sliceProfileName = "an_" + sliceParams.serviceName // create slice profile - ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, oStatus) + 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())) @@ -338,10 +339,11 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String routeId = UUID.randomUUID().toString() route.setRouteId(routeId) route.setType("endpoint") - route.setRole("an") + route.setRole("AN") route.setFunction("3gppTransportEP") route.setIpAddress( sliceTaskInfo.sliceProfile.ipAddress) route.setNextHop(sliceTaskInfo.sliceProfile.nextHopInfo) + route.setLogicalInterfaceId(sliceTaskInfo.sliceProfile.logicInterfaceId) route.setAddressFamily("ipv4") route.setPrefixLength(24) sliceTaskInfo.setEndPointId(routeId) @@ -363,10 +365,11 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String routeId = UUID.randomUUID().toString() route.setRouteId(routeId) route.setType("endpoint") - route.setRole("cn") + route.setRole("CN") route.setFunction("3gppTransportEP") route.setIpAddress( sliceTaskInfo.sliceProfile.ipAddress) route.setNextHop(sliceTaskInfo.sliceProfile.nextHopInfo) + route.setLogicalInterfaceId(sliceTaskInfo.sliceProfile.logicInterfaceId) route.setAddressFamily("ipv4") route.setPrefixLength(24) @@ -454,9 +457,10 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter SliceTaskInfo sliceTaskInfo = sliceParams.cnSliceTaskInfo sliceTaskInfo.setSliceInstanceId(serviceInstanceId) + String sliceProfileName = "cn_"+sliceParams.serviceName // create slice profile - ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, oStatus) + 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())) @@ -597,10 +601,11 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String serviceInstanceId = UUID.randomUUID().toString() sliceTaskInfo.setSliceInstanceId(serviceInstanceId) + String sliceProfileName = "tn_" + sliceParams.serviceName //execution.setVariable("cnSliceProfileInstanceId", serviceInstanceId) //todo: // create slice profile - ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, oStatus) + 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())) @@ -664,6 +669,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest() AllocateTnNssi allocateTnNssi = new AllocateTnNssi() + allocateTnNssi.setNssiId(sliceTaskInfo.suggestNssiId) //todo: AllocateTnNssi //todo: endPointId -> set into tn List transportSliceNetworks = new ArrayList<>() @@ -701,6 +707,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID serviceInfo.nssiId = sliceTaskInfo.suggestNssiId serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") + serviceInfo.nssiName = "nssi_tn" + execution.getVariable("sliceServiceInstanceName") nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) @@ -923,10 +930,10 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ client.create(sourceInstanceUri, relationship) } - static def createSliceProfileInstance(SliceTaskInfo sliceTaskInfo, String oStatus) { + static def createSliceProfileInstance(SliceTaskInfo sliceTaskInfo, String sliceProfileName, String oStatus) { // create slice profile ServiceInstance rspi = new ServiceInstance() - rspi.setServiceInstanceName(sliceTaskInfo.NSSTInfo.name) + rspi.setServiceInstanceName(sliceProfileName) rspi.setServiceType(sliceTaskInfo.sliceProfile.getSST()) rspi.setServiceRole("slice-profile") rspi.setOrchestrationStatus(oStatus)