ANNF_sliceProfileInstance.setServiceType(serviceType)
String serviceStatus = "deactivated"
ANNF_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
- String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
+ String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList")
ANNF_sliceProfileInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
String serviceRole = "slice-profile-instance"
ANNF_sliceProfileInstance.setServiceRole(serviceRole)
serviceType = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "sST")
TNFH_sliceProfileInstance.setServiceType(serviceType)
TNFH_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
- serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "plmnIdList")
+ serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "pLMNIdList")
TNFH_sliceProfileInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
TNFH_sliceProfileInstance.setServiceRole(serviceRole)
TNFH_sliceProfileInstance.setEnvironmentContext(snssai)
serviceType = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "sST")
TNMH_sliceProfileInstance.setServiceType(serviceType)
TNMH_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
- serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "plmnIdList")
+ serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "pLMNIdList")
TNMH_sliceProfileInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
TNMH_sliceProfileInstance.setServiceRole(serviceRole)
TNMH_sliceProfileInstance.setEnvironmentContext(snssai)
JsonArray connectionLinksList = new JsonArray()
JsonObject connectionLinks = new JsonObject()
Gson jsonConverter = new Gson()
+ String TNFH_nssiInstanceId = UUID.randomUUID().toString()
+ String TNMH_nssiInstanceId = UUID.randomUUID().toString()
+
if(action.equals("allocate")){
JsonObject endpoints = new JsonObject()
if(domainType.equals("TN_FH")) {
serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNFH_modelInvariantUuid"))
serviceInfo.addProperty("serviceUuid", execution.getVariable("TNFH_modelUuid"))
- serviceInfo.addProperty("nssiName", "nssi_"+execution.getVariable("TNFH_modelName"))
+ serviceInfo.addProperty("nssiName", "nssi_tn_fh_"+TNFH_nssiInstanceId)
serviceInfo.addProperty("sst", execution.getVariable("sst"))
allocateTnNssi.addProperty("nsstId", execution.getVariable("TNFH_modelUuid"))
allocateTnNssi.addProperty("nssiName", execution.getVariable("TNFH_modelName"))
}else if(domainType.equals("TN_MH")) {
serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNMH_modelInvariantUuid"))
serviceInfo.addProperty("serviceUuid", execution.getVariable("TNMH_modelUuid"))
- serviceInfo.addProperty("nssiName", "nssi_"+execution.getVariable("TNMH_modelName"))
+ serviceInfo.addProperty("nssiName", "nssi_tn_mh_"+TNMH_nssiInstanceId)
serviceInfo.addProperty("sst", execution.getVariable("sst"))
allocateTnNssi.addProperty("nsstId", execution.getVariable("TNMH_modelUuid"))
allocateTnNssi.addProperty("nssiName", execution.getVariable("TNMH_modelName"))
public String buildDeallocateNssiRequest(DelegateExecution execution,String domainType) {
String globalSubscriberId = execution.getVariable("globalSubscriberId")
String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
+
+ List<String> sNssaiList = execution.getVariable("snssaiList")
+
+ DeAllocateNssi deallocateNssi = new DeAllocateNssi()
+ deallocateNssi.setNsiId(execution.getVariable("nsiId"))
+ deallocateNssi.setScriptName("TN1")
+ deallocateNssi.setSnssaiList(sNssaiList)
+ deallocateNssi.setTerminateNssiOption(0)
- JsonObject deAllocateNssi = new JsonObject()
- deAllocateNssi.addProperty("snssaiList", execution.getVariable("snssaiList"))
- deAllocateNssi.addProperty("nsiId", execution.getVariable("nsiId"))
- deAllocateNssi.addProperty("modifyAction", true)
- deAllocateNssi.addProperty("terminateNssiOption", 0)
- deAllocateNssi.addProperty("scriptName", "TN1")
-
-
JsonObject esrInfo = new JsonObject()
esrInfo.addProperty("networkType", "tn")
esrInfo.addProperty("vendor", "ONAP_internal")
JsonObject serviceInfo = new JsonObject()
serviceInfo.addProperty("globalSubscriberId", globalSubscriberId)
serviceInfo.addProperty("subscriptionServiceType", subscriptionServiceType)
-
+ serviceInfo.addProperty("modifyAction", true)
+
if(domainType.equals("TN_FH")) {
- deAllocateNssi.addProperty("nssiId", execution.getVariable("TNFH_NSSI"))
+ deallocateNssi.setNssiId(execution.getVariable("TNFH_NSSI"))
+ deallocateNssi.setSliceProfileId(execution.getVariable("TNFH_sliceProfileInstanceId"))
serviceInfo.addProperty("nssiId", execution.getVariable("TNFH_NSSI"))
- deAllocateNssi.addProperty("sliceProfileId", execution.getVariable("TNFH_sliceProfileInstanceId"))
}else if(domainType.equals("TN_MH")) {
- deAllocateNssi.addProperty("nssiId", execution.getVariable("TNMH_NSSI"))
+ deallocateNssi.setNssiId(execution.getVariable("TNMH_NSSI"))
+ deallocateNssi.setSliceProfileId(execution.getVariable("TNMH_sliceProfileInstanceId"))
serviceInfo.addProperty("nssiId", execution.getVariable("TNMH_NSSI"))
- deAllocateNssi.addProperty("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId"))
}
JsonObject json = new JsonObject()
- json.add("deAllocateNssi", deAllocateNssi)
+ Gson jsonConverter = new Gson()
+ json.add("deAllocateNssi", jsonConverter.toJsonTree(deallocateNssi))
json.add("esrInfo", esrInfo)
json.add("serviceInfo", serviceInfo)
return json.toString()
}
String sliceProfileId = jsonUtil.getJsonValue(sliceProfile, "sliceProfileId")
def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "snssaiList"))
- def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "plmnIdList"))
+ def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "pLMNIdList"))
String jsonArray = jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList")
List<Integer> list = new ArrayList<>();
JSONArray arr = new JSONArray(jsonArray);
} 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")
serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
serviceInfo.addProperty("nssiName", execution.getVariable("servicename"))
serviceInfo.addProperty("sST", execution.getVariable("sst"))
- serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
+ 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"))
ANServiceInstance.setServiceType(execution.getVariable("sst"))
String serviceStatus = "deactivated"
ANServiceInstance.setOrchestrationStatus(serviceStatus)
- String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
+ String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList")
ANServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
String serviceRole = "nssi"
ANServiceInstance.setServiceRole(serviceRole)
ANServiceInstance.setServiceType(execution.getVariable("sst"))
String serviceStatus = "deactivated"
ANServiceInstance.setOrchestrationStatus(serviceStatus)
- String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
+ String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList")
ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
String serviceRole = "nssi"
ANServiceInstance.setServiceRole(serviceRole)
logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
//create RAN NF NSSI
ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId"))
- 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"))
ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
- serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
+ serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList")
ANNFServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
ANNFServiceInstance.setServiceRole(serviceRole)
snssaiList = execution.getVariable("snssaiList")
JsonObject serviceInfo = new JsonObject()
serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
serviceInfo.addProperty("sST", execution.getVariable("sst"))
- serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
+ 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")) {
ServiceInstance ranSliceProfileInstance = execution.getVariable("ranSliceProfileInstance")
profileInfo.put("sST",ranSliceProfileInstance.getServiceType())
profileInfo.put("snssaiList",execution.getVariable("snssaiList"))
- profileInfo.put("plmnIdList",Arrays.asList(ranSliceProfileInstance.getServiceInstanceLocationId()))
+ profileInfo.put("pLMNIdList",Arrays.asList(ranSliceProfileInstance.getServiceInstanceLocationId()))
profileInfo.put("uEMobilityLevel",profileInfo.get("ueMobilityLevel"))
profileInfo.put("cSAvailabilityTarget",profileInfo.get("csAvailabilityTarget"))
profileInfo.put("maxNumberofPDUSession",profileInfo.get("maxNumberOfPDUSession"))
def prepareTnMhDeallocateRequest = { DelegateExecution execution ->
logger.debug(Prefix+"prepareTnFhDeallocateRequest method start")
- String nssmfRequest = anNssmfUtils.buildDeallocateNssiRequest(execution, "TN_FH")
+ String nssmfRequest = anNssmfUtils.buildDeallocateNssiRequest(execution, "TN_MH")
String nssiId = execution.getVariable("TNFH_NSSI")
execution.setVariable("tnFHNSSIId", nssiId)
String urlString = "/api/rest/provMns/v1/NSS/SliceProfiles/" + nssiId
}
private void deleteServiceInstanceInAAI(DelegateExecution execution,String instanceId) {
try {
- AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("serviceType")).serviceInstance(instanceId))
- getAAIClient().delete(serviceInstanceUri)
+ AAIResourcesClient client = getAAIClient()
+ AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(instanceId))
+ client.delete(serviceInstanceUri)
logger.debug("${Prefix} Exited deleteServiceInstance")
}catch(Exception e){
logger.debug("Error occured within deleteServiceInstance method: " + e)