diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
17 files changed, 469 insertions, 380 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy index 00bd8e9ef8..9e71313e09 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy @@ -694,32 +694,6 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess } /** - * Constructs a workflow message callback URL for the specified message type and correlator. - * This type of callback URL is used when a workflow wants an MSO adapter (like the SDNC - * adapter) to call it back. In other words, this is for callbacks internal to the MSO - * complex. Use <code>createWorkflowMessageAdapterCallbackURL</code> if the callback - * will come from outside the MSO complex. - * @param endpoint endpoint address to contruct URL from - * @param messageType the message type (e.g. SDNCAResponse or VNFAResponse) - * @param correlator the correlator value (e.g. a request ID) - */ - public String createCallbackURL(String endpoint, String messageType, String correlator) { - if (endpoint == null || endpoint.isEmpty()) { - ExceptionUtil exceptionUtil = new ExceptionUtil() - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, - 'mso:workflow:message:endpoint was not passed in') - } - - while (endpoint.endsWith('/')) { - endpoint = endpoint.substring(0, endpoint.length()-1) - } - - return endpoint + - '/' + UriUtils.encodePathSegment(messageType, 'UTF-8') + - '/' + UriUtils.encodePathSegment(correlator, 'UTF-8') - } - - /** * * Constructs a workflow message callback URL for the specified message type and correlator. * This type of callback URL is used when a workflow wants a system outside the MSO complex diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy index 3bbc4bd110..d4777e234c 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy @@ -21,7 +21,6 @@ package org.onap.so.bpmn.common.scripts import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.so.bpmn.core.RollbackData -import org.onap.so.bpmn.core.UrnPropertiesReader import org.onap.so.client.aai.AAIObjectType import org.onap.so.client.aai.entities.uri.AAIResourceUri import org.onap.so.client.aai.entities.uri.AAIUriFactory @@ -29,7 +28,6 @@ import org.onap.so.client.graphinventory.entities.uri.Depth import org.onap.so.logger.MessageEnum import org.onap.so.logger.MsoLogger import org.onap.so.rest.APIResponse -import org.springframework.web.util.UriUtils public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateAAIVfModule.class); @@ -163,7 +161,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ String aaiNamespace = aaiUriUtil.getNamespace() msoLogger.debug('AAI namespace is: ' + aaiNamespace) - execution.setVariable("CAAIVfMod_aaiNamespace","${aaiNamespace}") + execution.setVariable("CAAIVfMod_aaiNamespace",aaiNamespace) } @@ -212,8 +210,6 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ // process the result from queryAAIForGenericVnf() // note: this method is primarily for logging as the actual decision logic is embedded in the bpmn flow public void processAAIGenericVnfQuery(DelegateExecution execution) { - def result = execution.getVariable("CAAIVfMod_queryGenericVnfResponse") - if (execution.getVariable("CAAIVfMod_queryGenericVnfResponseCode") == 404 && execution.getVariable("CAAIVfMod_vnfId").isEmpty()) { msoLogger.debug("New Generic VNF requested and it does not already exist") @@ -310,7 +306,6 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ moduleIndex = aaiUtil.getLowestUnusedVfModuleIndexFromAAIVnfResponse(execution, aaiVnfResponse, fieldToCheck, personaModelId) } - def moduleIndexString = String.valueOf(moduleIndex) // if we get to this point, we may be about to create the Vf Module, // add rollback information about the Generic VNF for this base/add-on module @@ -366,7 +361,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ String responseOut = "" String isVidRequest = execution.getVariable("isVidRequest") - + def moduleIndexString = String.valueOf(moduleIndex) if (isBaseModule && (isVidRequest == null || "false".equals(isVidRequest))) { responseOut = """<CreateAAIVfModuleResponse> @@ -411,20 +406,18 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ for (String qryModuleName : qryModuleNameList) { if (newModuleName.equals(qryModuleName)) { // a module with the requested name already exists - failure - msoLogger.debug("VF Module " + qryModuleName + " already exists for Generic VNF " + execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + msoLogger.debug("VF Module " + qryModuleName + " already exists for Generic VNF " + vnfNameFromAAI) execution.setVariable("CAAIVfMod_moduleExists", true) execution.setVariable("CAAIVfMod_parseModuleResponse", - "VF Module " + qryModuleName + " already exists for Generic VNF " + - execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + "VF Module " + qryModuleName + " already exists for Generic VNF " + vnfNameFromAAI) break } } } if (execution.getVariable("CAAIVfMod_moduleExists") == false) { - msoLogger.debug("VF Module " + execution.getVariable("CAAIVfMod_moduleName") + " does not exist for Generic VNF " + execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + msoLogger.debug("VF Module " + execution.getVariable("CAAIVfMod_moduleName") + " does not exist for Generic VNF " + vnfNameFromAAI) execution.setVariable("CAAIVfMod_parseModuleResponse", - "VF Module " + newModuleName + " does not exist for Generic VNF " + - execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + "VF Module " + newModuleName + " does not exist for Generic VNF " + vnfNameFromAAI) } } @@ -445,11 +438,10 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ for (String qryModuleName : qryModuleNameList) { if (newModuleName.equals(qryModuleName)) { // a module with the requested name already exists - failure - msoLogger.debug("VF Module " + qryModuleName + " already exists for Generic VNF " + execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + msoLogger.debug("VF Module " + qryModuleName + " already exists for Generic VNF " + vnfNameFromAAI) execution.setVariable("CAAIVfMod_baseModuleConflict", true) execution.setVariable("CAAIVfMod_parseModuleResponse", - "VF Module " + qryModuleName + " already exists for Generic VNF " + - execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + "VF Module " + qryModuleName + " already exists for Generic VNF " + vnfNameFromAAI) break } } @@ -460,21 +452,19 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ for (String baseValue : isBaseVfModuleList) { if (baseValue.equals("true")) { // a base module already exists in this VNF - failure - msoLogger.debug("Base VF Module already exists for Generic VNF " + execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + msoLogger.debug("Base VF Module already exists for Generic VNF " + vnfNameFromAAI) execution.setVariable("CAAIVfMod_baseModuleConflict", true) execution.setVariable("CAAIVfMod_parseModuleResponse", - "Base VF Module already exists for Generic VNF " + - execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + "Base VF Module already exists for Generic VNF " + vnfNameFromAAI) break } } } - if (execution.getVariable("CAAIVfMod_moduleExists") == false && execution.getVariable("CAAIVfMod_baseModuleConflict") == false) { + if (execution.getVariable("CAAIVfMod_baseModuleConflict") == false) { msoLogger.debug("VF Module " + execution.getVariable("CAAIVfMod_moduleName") + " does not exist for Generic VNF " + execution.getVariable("CAAIVfMod_vnfNameFromAAI")) execution.setVariable("CAAIVfMod_parseModuleResponse", - "VF Module " + newModuleName + " does not exist for Generic VNF " + - execution.getVariable("CAAIVfMod_vnfNameFromAAI")) + "VF Module " + newModuleName + " does not exist for Generic VNF " + vnfNameFromAAI) } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy index aa0d8ace6a..533df72285 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy @@ -41,6 +41,7 @@ import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.json.JSONArray import org.json.JSONObject +import org.springframework.web.util.UriUtils import static org.onap.so.bpmn.common.scripts.GenericUtils.* @@ -338,4 +339,37 @@ class OofHoming extends AbstractServiceTaskProcessor { */ public void preProcessRequest(DelegateExecution execution) {} // Not Implemented Method + + /** + * Constructs a workflow message callback URL for the specified message type and correlator. + * This type of callback URL is used when a workflow wants an MSO adapter (like the SDNC + * adapter) to call it back. In other words, this is for callbacks internal to the MSO + * complex. Use <code>createWorkflowMessageAdapterCallbackURL</code> if the callback + * will come from outside the MSO complex. + * @param endpoint endpoint address to contruct URL from + * @param messageType the message type (e.g. SDNCAResponse or VNFAResponse) + * @param correlator the correlator value (e.g. a request ID) + */ + public String createHomingCallbackURL(String endpoint, String messageType, String correlator) { + try { + if (endpoint == null || endpoint.isEmpty()) { + ExceptionUtil exceptionUtil = new ExceptionUtil() + exceptionUtil.buildAndThrowWorkflowException(execution, 2000, + 'mso:workflow:message:endpoint was not passed in') + } + + utils.log("DEBUG", "passed in endpoint: " + endpoint + " *****", "true") + + while (endpoint.endsWith('/')) { + endpoint = endpoint.substring(0, endpoint.length() - 1) + } + utils.log("DEBUG", "processed endpoint: " + endpoint + " *****", "true") + + return endpoint + + '/' + UriUtils.encodePathSegment(messageType, 'UTF-8') + + '/' + UriUtils.encodePathSegment(correlator, 'UTF-8') + } catch (Exception ex) { + utils.log("DEBUG", "createCallbackURL Exception: " + ex + " *****", "true") + } + } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy index b1da7cf49b..197589efa1 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy @@ -89,138 +89,148 @@ class OofUtils { utils.log("DEBUG", "Started Building OOF Request", isDebugEnabled) String callbackEndpoint = UrnPropertiesReader.getVariable("mso.oof.callbackEndpoint", execution) utils.log("DEBUG", "mso.oof.callbackEndpoint is: " + callbackEndpoint, isDebugEnabled) - def callbackUrl = utils.createWorkflowMessageAdapterCallbackURL(callbackEndpoint, "oofResponse", requestId) - def transactionId = requestId - //ServiceInstance Info - ServiceInstance serviceInstance = decomposition.getServiceInstance() - def serviceInstanceId = "" - def serviceName = "" - - serviceInstanceId = execution.getVariable("serviceInstanceId") - serviceName = execution.getVariable("subscriptionServiceType") - - if (serviceInstanceId == null || serviceInstanceId == "null") { - utils.log("DEBUG", "Unable to obtain Service Instance Id", isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + - "obtain Service Instance Id, execution.getVariable(\"serviceInstanceId\") is null") - } - if (serviceName == null || serviceName == "null") { - utils.log("DEBUG", "Unable to obtain Service Name", isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + - "obtain Service Name, execution.getVariable(\"subscriptionServiceType\") is null") - } - //Model Info - ModelInfo model = decomposition.getModelInfo() - String modelType = model.getModelType() - String modelInvariantId = model.getModelInvariantUuid() - String modelVersionId = model.getModelUuid() - String modelName = model.getModelName() - String modelVersion = model.getModelVersion() - //Subscriber Info - String subscriberId = "" - String subscriberName = "" - String commonSiteId = "" - if (subscriber != null){ - subscriberId = subscriber.getGlobalId() - subscriberName = subscriber.getName() - commonSiteId = subscriber.getCommonSiteId() - } - - //Determine RequestType - //TODO Figure out better way to determine this - String requestType = "create" - List<Resource> resources = decomposition.getServiceResources() - for(Resource r:resources){ - HomingSolution currentSolution = (HomingSolution) r.getCurrentHomingSolution() - if(currentSolution != null){ - requestType = "speed changed" + try { + def callbackUrl = utils.createHomingCallbackURL(callbackEndpoint, "oofResponse", requestId) + utils.log("DEBUG", "callbackUrl is: " + callbackUrl, isDebugEnabled) + + + def transactionId = requestId + utils.log("DEBUG", "transactionId is: " + transactionId, isDebugEnabled) + //ServiceInstance Info + ServiceInstance serviceInstance = decomposition.getServiceInstance() + def serviceInstanceId = "" + def serviceName = "" + + serviceInstanceId = execution.getVariable("serviceInstanceId") + utils.log("DEBUG", "serviceInstanceId is: " + serviceInstanceId, isDebugEnabled) + serviceName = execution.getVariable("subscriptionServiceType") + utils.log("DEBUG", "serviceName is: " + serviceName, isDebugEnabled) + + if (serviceInstanceId == null || serviceInstanceId == "null") { + utils.log("DEBUG", "Unable to obtain Service Instance Id", isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + + "obtain Service Instance Id, execution.getVariable(\"serviceInstanceId\") is null") + } + if (serviceName == null || serviceName == "null") { + utils.log("DEBUG", "Unable to obtain Service Name", isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + + "obtain Service Name, execution.getVariable(\"subscriptionServiceType\") is null") + } + //Model Info + ModelInfo model = decomposition.getModelInfo() + utils.log("DEBUG", "ModelInfo: " + model.toString(), isDebugEnabled) + String modelType = model.getModelType() + String modelInvariantId = model.getModelInvariantUuid() + String modelVersionId = model.getModelUuid() + String modelName = model.getModelName() + String modelVersion = model.getModelVersion() + //Subscriber Info + String subscriberId = "" + String subscriberName = "" + String commonSiteId = "" + if (subscriber != null) { + subscriberId = subscriber.getGlobalId() + subscriberName = subscriber.getName() + commonSiteId = subscriber.getCommonSiteId() } - } - //Demands - String placementDemands = "" - StringBuilder sb = new StringBuilder() - List<AllottedResource> allottedResourceList = decomposition.getAllottedResources() - List<VnfResource> vnfResourceList = decomposition.getVnfResources() + //Determine RequestType + //TODO Figure out better way to determine this + String requestType = "create" + List<Resource> resources = decomposition.getServiceResources() + for (Resource r : resources) { + HomingSolution currentSolution = (HomingSolution) r.getCurrentHomingSolution() + if (currentSolution != null) { + requestType = "speed changed" + } + } - if (allottedResourceList == null || allottedResourceList.isEmpty() ) { - utils.log("DEBUG", "Allotted Resources List is empty - will try to get service VNFs instead.", - isDebugEnabled) - allottedResourceList = decomposition.getVnfResources() - } + //Demands + String placementDemands = "" + StringBuilder sb = new StringBuilder() + List<AllottedResource> allottedResourceList = decomposition.getAllottedResources() + List<VnfResource> vnfResourceList = decomposition.getVnfResources() - if (allottedResourceList == null || allottedResourceList.isEmpty()) { - utils.log("DEBUG", "Resources List is Empty", isDebugEnabled) - } else { - for (AllottedResource resource : allottedResourceList) { - utils.log("DEBUG", "Allotted Resource: " + resource.toString(), + if (allottedResourceList == null || allottedResourceList.isEmpty()) { + utils.log("DEBUG", "Allotted Resources List is empty - will try to get service VNFs instead.", isDebugEnabled) - def serviceResourceId = resource.getResourceId() - def resourceModelInvariantId = resource.getModelInfo().getModelInvariantUuid() - def resourceModelVersionId = resource.getModelInfo().getModelUuid() - def resourceModelName = resource.getModelInfo().getModelName() - def resourceModelVersion = resource.getModelInfo().getModelVersion() - def resourceModelType = resource.getModelInfo().getModelType() - def tenantId = execution.getVariable("tenantId") - def requiredCandidatesJson = "" - - requiredCandidatesJson = createCandidateJson( - existingCandidates, - excludedCandidates, - requiredCandidates) - - String demand = - " {\n" + - " \"resourceModuleName\": \"${resourceModelName}\",\n" + - " \"serviceResourceId\": \"${serviceResourceId}\",\n" + - " \"tenantId\": \"${tenantId}\",\n" + - " \"resourceModelInfo\": {\n" + - " \"modelInvariantId\": \"${resourceModelInvariantId}\",\n" + - " \"modelVersionId\": \"${resourceModelVersionId}\",\n" + - " \"modelName\": \"${resourceModelName}\",\n" + - " \"modelType\": \"${resourceModelType}\",\n" + - " \"modelVersion\": \"${resourceModelVersion}\",\n" + - " \"modelCustomizationName\": \"\"\n" + - " }" + requiredCandidatesJson + "\n" + - " }," - - placementDemands = sb.append(demand) + } else { + for (AllottedResource resource : allottedResourceList) { + utils.log("DEBUG", "Allotted Resource: " + resource.toString(), + isDebugEnabled) + def serviceResourceId = resource.getResourceId() + def resourceModelInvariantId = resource.getModelInfo().getModelInvariantUuid() + def resourceModelVersionId = resource.getModelInfo().getModelUuid() + def resourceModelName = resource.getModelInfo().getModelName() + def resourceModelVersion = resource.getModelInfo().getModelVersion() + def resourceModelType = resource.getModelInfo().getModelType() + def tenantId = execution.getVariable("tenantId") + def requiredCandidatesJson = "" + + requiredCandidatesJson = createCandidateJson( + existingCandidates, + excludedCandidates, + requiredCandidates) + + String demand = + " {\n" + + " \"resourceModuleName\": \"${resourceModelName}\",\n" + + " \"serviceResourceId\": \"${serviceResourceId}\",\n" + + " \"tenantId\": \"${tenantId}\",\n" + + " \"resourceModelInfo\": {\n" + + " \"modelInvariantId\": \"${resourceModelInvariantId}\",\n" + + " \"modelVersionId\": \"${resourceModelVersionId}\",\n" + + " \"modelName\": \"${resourceModelName}\",\n" + + " \"modelType\": \"${resourceModelType}\",\n" + + " \"modelVersion\": \"${resourceModelVersion}\",\n" + + " \"modelCustomizationName\": \"\"\n" + + " }" + requiredCandidatesJson + "\n" + + " }," + + placementDemands = sb.append(demand) + } } - for (VnfResource vnfResource : vnfResourceList) { - utils.log("DEBUG", "VNF Resource: " + vnfResource.toString(), + + if (vnfResourceList == null || vnfResourceList.isEmpty()) { + utils.log("DEBUG", "VNF Resources List is empty", isDebugEnabled) - ModelInfo vnfResourceModelInfo = vnfResource.getModelInfo() - def serviceResourceId = vnfResource.getResourceId() - def resourceModelInvariantId = vnfResourceModelInfo.getModelInvariantUuid() - def resourceModelName = vnfResourceModelInfo.getModelName() - def resourceModelVersion = vnfResourceModelInfo.getModelVersion() - def resourceModelVersionId = vnfResourceModelInfo.getModelUuid() - def resourceModelType = vnfResourceModelInfo.getModelType() - def tenantId = execution.getVariable("tenantId") - def requiredCandidatesJson = "" - - - String placementDemand = - " {\n" + - " \"resourceModuleName\": \"${resourceModelName}\",\n" + - " \"serviceResourceId\": \"${serviceResourceId}\",\n" + - " \"tenantId\": \"${tenantId}\",\n" + - " \"resourceModelInfo\": {\n" + - " \"modelInvariantId\": \"${resourceModelInvariantId}\",\n" + - " \"modelVersionId\": \"${resourceModelVersionId}\",\n" + - " \"modelName\": \"${resourceModelName}\",\n" + - " \"modelType\": \"${resourceModelType}\",\n" + - " \"modelVersion\": \"${resourceModelVersion}\",\n" + - " \"modelCustomizationName\": \"\"\n" + - " }" + requiredCandidatesJson + "\n" + - " }," - - placementDemands = sb.append(placementDemand) + } else { + + for (VnfResource vnfResource : vnfResourceList) { + utils.log("DEBUG", "VNF Resource: " + vnfResource.toString(), + isDebugEnabled) + ModelInfo vnfResourceModelInfo = vnfResource.getModelInfo() + def serviceResourceId = vnfResource.getResourceId() + def resourceModelInvariantId = vnfResourceModelInfo.getModelInvariantUuid() + def resourceModelName = vnfResourceModelInfo.getModelName() + def resourceModelVersion = vnfResourceModelInfo.getModelVersion() + def resourceModelVersionId = vnfResourceModelInfo.getModelUuid() + def resourceModelType = vnfResourceModelInfo.getModelType() + def tenantId = execution.getVariable("tenantId") + def requiredCandidatesJson = "" + + + String placementDemand = + " {\n" + + " \"resourceModuleName\": \"${resourceModelName}\",\n" + + " \"serviceResourceId\": \"${serviceResourceId}\",\n" + + " \"tenantId\": \"${tenantId}\",\n" + + " \"resourceModelInfo\": {\n" + + " \"modelInvariantId\": \"${resourceModelInvariantId}\",\n" + + " \"modelVersionId\": \"${resourceModelVersionId}\",\n" + + " \"modelName\": \"${resourceModelName}\",\n" + + " \"modelType\": \"${resourceModelType}\",\n" + + " \"modelVersion\": \"${resourceModelVersion}\",\n" + + " \"modelCustomizationName\": \"\"\n" + + " }" + requiredCandidatesJson + "\n" + + " }," + + placementDemands = sb.append(placementDemand) + } + placementDemands = placementDemands.substring(0, placementDemands.length() - 1) } - placementDemands = placementDemands.substring(0, placementDemands.length() - 1) - } - /* Commenting Out Licensing as OOF doesn't support for Beijing + /* Commenting Out Licensing as OOF doesn't support for Beijing String licenseDemands = "" sb = new StringBuilder() if (vnfResourceList.isEmpty() || vnfResourceList == null) { @@ -265,50 +275,53 @@ class OofUtils { licenseDemands = licenseDemands.substring(0, licenseDemands.length() - 1) }*/ - String request = - "{\n" + - " \"requestInfo\": {\n" + - " \"transactionId\": \"${transactionId}\",\n" + - " \"requestId\": \"${requestId}\",\n" + - " \"callbackUrl\": \"${callbackUrl}\",\n" + - " \"sourceId\": \"so\",\n" + - " \"requestType\": \"${requestType}\"," + - " \"numSolutions\": 1,\n" + - " \"optimizers\": [\"placement\"],\n" + - " \"timeout\": 600\n" + - " },\n" + - " \"placementInfo\": {\n" + - " \"requestParameters\": {\n" + - " \"customerLatitude\": \"${customerLocation.customerLatitude}\",\n" + - " \"customerLongitude\": \"${customerLocation.customerLongitude}\",\n" + - " \"customerName\": \"${customerLocation.customerName}\"\n" + - " }," + - " \"subscriberInfo\": { \n" + - " \"globalSubscriberId\": \"${subscriberId}\",\n" + - " \"subscriberName\": \"${subscriberName}\",\n" + - " \"subscriberCommonSiteId\": \"${commonSiteId}\"\n" + - " },\n" + - " \"placementDemands\": [\n" + - " ${placementDemands}\n" + - " ]\n" + - " },\n" + - " \"serviceInfo\": {\n" + - " \"serviceInstanceId\": \"${serviceInstanceId}\",\n" + - " \"serviceName\": \"${serviceName}\",\n" + - " \"modelInfo\": {\n" + - " \"modelType\": \"${modelType}\",\n" + - " \"modelInvariantId\": \"${modelInvariantId}\",\n" + - " \"modelVersionId\": \"${modelVersionId}\",\n" + - " \"modelName\": \"${modelName}\",\n" + - " \"modelVersion\": \"${modelVersion}\",\n" + - " \"modelCustomizationName\": \"\"\n" + - " }\n" + - " }\n" + - "}" - - - utils.log("DEBUG", "Completed Building OOF Request", isDebugEnabled) - return request + String request = + "{\n" + + " \"requestInfo\": {\n" + + " \"transactionId\": \"${transactionId}\",\n" + + " \"requestId\": \"${requestId}\",\n" + + " \"callbackUrl\": \"${callbackUrl}\",\n" + + " \"sourceId\": \"so\",\n" + + " \"requestType\": \"${requestType}\"," + + " \"numSolutions\": 1,\n" + + " \"optimizers\": [\"placement\"],\n" + + " \"timeout\": 600\n" + + " },\n" + + " \"placementInfo\": {\n" + + " \"requestParameters\": {\n" + + " \"customerLatitude\": \"${customerLocation.customerLatitude}\",\n" + + " \"customerLongitude\": \"${customerLocation.customerLongitude}\",\n" + + " \"customerName\": \"${customerLocation.customerName}\"\n" + + " }," + + " \"subscriberInfo\": { \n" + + " \"globalSubscriberId\": \"${subscriberId}\",\n" + + " \"subscriberName\": \"${subscriberName}\",\n" + + " \"subscriberCommonSiteId\": \"${commonSiteId}\"\n" + + " },\n" + + " \"placementDemands\": [\n" + + " ${placementDemands}\n" + + " ]\n" + + " },\n" + + " \"serviceInfo\": {\n" + + " \"serviceInstanceId\": \"${serviceInstanceId}\",\n" + + " \"serviceName\": \"${serviceName}\",\n" + + " \"modelInfo\": {\n" + + " \"modelType\": \"${modelType}\",\n" + + " \"modelInvariantId\": \"${modelInvariantId}\",\n" + + " \"modelVersionId\": \"${modelVersionId}\",\n" + + " \"modelName\": \"${modelName}\",\n" + + " \"modelVersion\": \"${modelVersion}\",\n" + + " \"modelCustomizationName\": \"\"\n" + + " }\n" + + " }\n" + + "}" + + + utils.log("DEBUG", "Completed Building OOF Request", isDebugEnabled) + return request + } catch (Exception ex) { + utils.log("DEBUG", "buildRequest Exception: " + ex, isDebugEnabled) + } } /** diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/BuildingBlockExecution.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/BuildingBlockExecution.java index a2f6637b5b..1ffd9dd167 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/BuildingBlockExecution.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/BuildingBlockExecution.java @@ -34,4 +34,5 @@ public interface BuildingBlockExecution { public <T> T getRequiredVariable(String key) throws RequiredExecutionVariableExeception; public void setVariable(String key, Serializable value); public Map<ResourceKey, String> getLookupMap(); + public String getFlowToBeCalled(); } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java index ef564c6af4..1c1d6b73fd 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java @@ -97,6 +97,10 @@ public class DelegateExecutionImpl implements BuildingBlockExecution, Serializab return this.get("lookupKeyMap"); } + @Override + public String getFlowToBeCalled() { + return this.get("flowToBeCalled"); + } public DelegateExecution getDelegateExecution() { return this.execution; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/SpringContextHelper.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/SpringContextHelper.java deleted file mode 100644 index edc544d939..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/SpringContextHelper.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.common; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.stereotype.Component; - -@Component -public class SpringContextHelper implements ApplicationContextAware { - - private static ApplicationContext context; - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - context = applicationContext; - } - - public static ApplicationContext getAppContext() { - return context; - } -} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 769d3e4e89..8cc25a2c52 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -571,7 +571,7 @@ public class BBInputSetup implements JavaDelegate { if (relatedInstanceList != null) { for (RelatedInstanceList relatedInstList : relatedInstanceList) { RelatedInstance relatedInstance = relatedInstList.getRelatedInstance(); - if (relatedInstance.getModelInfo().getModelType().equals(ModelType.networkCollection)) { + if (relatedInstance.getModelInfo().getModelType().equals(ModelType.networkInstanceGroup)) { instanceGroupModelInfo = relatedInstance.getModelInfo(); instanceGroupId = relatedInstance.getInstanceId(); } diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenantTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenantTest.groovy index 1b76f5cb3f..5a01c83a80 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenantTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenantTest.groovy @@ -77,7 +77,7 @@ class ConfirmVolumeGroupTenantTest extends MsoGroovyTest { when(mockExecution.getVariable("aicCloudRegion")).thenReturn('aicCloudRegion') when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true') when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn('8') - when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn('/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic') + when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn('/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner') when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/') @@ -89,17 +89,17 @@ class ConfirmVolumeGroupTenantTest extends MsoGroovyTest { /* Mockito.verify(mockExecution, times(5)).setVariable(captor.capture(), captor.capture())*/ verify(mockExecution).setVariable("prefix", "CVGT_") verify(mockExecution).setVariable("queryVolumeGroupResponseCode", 200) - verify(mockExecution).setVariable("queryAAIVolumeGroupResponse", "<volume-group xmlns=\"http://org.openecomp.aai.inventory/v10\"><volume-group-id>17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c</volume-group-id><volume-group-name>MSOTESTVOL103a-vSAMP12_base_module-0_vol</volume-group-name><heat-stack-id>9d1f53e3-3158-44f8-8032-a6bf40bbc9db</heat-stack-id><vnf-type>pcrf-capacity</vnf-type><orchestration-status>Active</orchestration-status><resource-version>0000020</resource-version><relationship-list><relationship><related-to>tenant</related-to><relationship-data><relationship-key>cloud-region.cloud-owner</relationship-key><relationship-value>att-aic</relationship-value></relationship-data><relationship-data><relationship-key>cloud-region.cloud-region-id</relationship-key><relationship-value>RegionOne</relationship-value></relationship-data><relationship-data><relationship-key>tenant.tenant-id</relationship-key><relationship-value>22eb191dd41a4f3c9be370fc638322f4</relationship-value></relationship-data></relationship></relationship-list></volume-group>") + verify(mockExecution).setVariable("queryAAIVolumeGroupResponse", "<volume-group xmlns=\"http://org.openecomp.aai.inventory/v10\"><volume-group-id>17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c</volume-group-id><volume-group-name>MSOTESTVOL103a-vSAMP12_base_module-0_vol</volume-group-name><heat-stack-id>9d1f53e3-3158-44f8-8032-a6bf40bbc9db</heat-stack-id><vnf-type>pcrf-capacity</vnf-type><orchestration-status>Active</orchestration-status><resource-version>0000020</resource-version><relationship-list><relationship><related-to>tenant</related-to><relationship-data><relationship-key>cloud-region.cloud-owner</relationship-key><relationship-value>CloudOwner</relationship-value></relationship-data><relationship-data><relationship-key>cloud-region.cloud-region-id</relationship-key><relationship-value>RegionOne</relationship-value></relationship-data><relationship-data><relationship-key>tenant.tenant-id</relationship-key><relationship-value>22eb191dd41a4f3c9be370fc638322f4</relationship-value></relationship-data></relationship></relationship-list></volume-group>") verify(mockExecution).setVariable("tenantIdsMatch", false) verify(mockExecution).setVariable("groupNamesMatch", false) } private void mockData() { - stubFor(get(urlMatching("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/att-aic/aicCloudRegion/volume-groups/volume-group/testVolumeGroupId")) + stubFor(get(urlMatching("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/aicCloudRegion/volume-groups/volume-group/testVolumeGroupId")) .willReturn(aResponse() .withStatus(200) - .withBody("<volume-group xmlns=\"http://org.openecomp.aai.inventory/v10\"><volume-group-id>17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c</volume-group-id><volume-group-name>MSOTESTVOL103a-vSAMP12_base_module-0_vol</volume-group-name><heat-stack-id>9d1f53e3-3158-44f8-8032-a6bf40bbc9db</heat-stack-id><vnf-type>pcrf-capacity</vnf-type><orchestration-status>Active</orchestration-status><resource-version>0000020</resource-version><relationship-list><relationship><related-to>tenant</related-to><relationship-data><relationship-key>cloud-region.cloud-owner</relationship-key><relationship-value>att-aic</relationship-value></relationship-data><relationship-data><relationship-key>cloud-region.cloud-region-id</relationship-key><relationship-value>RegionOne</relationship-value></relationship-data><relationship-data><relationship-key>tenant.tenant-id</relationship-key><relationship-value>22eb191dd41a4f3c9be370fc638322f4</relationship-value></relationship-data></relationship></relationship-list></volume-group>"))) + .withBody("<volume-group xmlns=\"http://org.openecomp.aai.inventory/v10\"><volume-group-id>17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c</volume-group-id><volume-group-name>MSOTESTVOL103a-vSAMP12_base_module-0_vol</volume-group-name><heat-stack-id>9d1f53e3-3158-44f8-8032-a6bf40bbc9db</heat-stack-id><vnf-type>pcrf-capacity</vnf-type><orchestration-status>Active</orchestration-status><resource-version>0000020</resource-version><relationship-list><relationship><related-to>tenant</related-to><relationship-data><relationship-key>cloud-region.cloud-owner</relationship-key><relationship-value>CloudOwner</relationship-value></relationship-data><relationship-data><relationship-key>cloud-region.cloud-region-id</relationship-key><relationship-value>RegionOne</relationship-value></relationship-data><relationship-data><relationship-key>tenant.tenant-id</relationship-key><relationship-value>22eb191dd41a4f3c9be370fc638322f4</relationship-value></relationship-data></relationship></relationship-list></volume-group>"))) } private ExecutionEntity setupMock() { diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy new file mode 100644 index 0000000000..999a12c869 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleTest.groovy @@ -0,0 +1,205 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Copyright (C) 2018 Nokia. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.common.scripts + +import joptsimple.internal.Strings +import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake +import org.junit.Before +import org.junit.Test +import org.onap.so.bpmn.core.UrnPropertiesReader +import org.springframework.core.env.Environment + +import static org.assertj.core.api.Assertions.assertThat +import static org.mockito.Mockito.mock +import static org.mockito.Mockito.when + +class CreateAAIVfModuleTest { + + private static final String VNF_ID = "vnfIdTest" + private static final String VNF_TYPE = "vnfTypeTest" + private static final String VNF_NAME = "testVnf" + private static final String SERVICE_ID = "123" + private static final String PERSONAL_MODEL_ID = "modelTest" + private static final String PERSONAL_MODEL_VERSION = "12" + private static final String MODEL_CUST_ID = "modelCustIdTest" + private static final String VNF_PERSONAL_MODEL_ID = "perModIdTest" + private static final String VNF_PERSONAL_MODEL_VER = "14" + private static final String VF_MODULE_NAME = "modTestName" + private static final String VF_MODULE_MODEL_NAME = "modModelNameTest" + private static final String DEFAULT_AAI_VERSION = "9" + private static final String DEFAULT_AAI_NAMESPACE = "defaultTestNamespace" + + private CreateAAIVfModule testedObject + private DelegateExecutionFake executionFake + + @Before + void setupTest() { + testedObject = new CreateAAIVfModule() + executionFake = new DelegateExecutionFake() + } + + @Test + void preProcessRequest_successful() { + //given + prepareUrnPropertiesReader() + executionFake.setVariable("vnfId", VNF_ID) + executionFake.setVariable("vnfType", VNF_TYPE) + executionFake.setVariable("vnfName", VNF_NAME) + executionFake.setVariable("serviceId", SERVICE_ID) + executionFake.setVariable("personaModelId", PERSONAL_MODEL_ID) + executionFake.setVariable("personaModelVersion", PERSONAL_MODEL_VERSION) + executionFake.setVariable("modelCustomizationId", MODEL_CUST_ID) + executionFake.setVariable("vnfPersonaModelId", VNF_PERSONAL_MODEL_ID) + executionFake.setVariable("vnfPersonaModelVersion", VNF_PERSONAL_MODEL_VER) + executionFake.setVariable("isBaseVfModule", "true") + executionFake.setVariable("vfModuleName", VF_MODULE_NAME) + executionFake.setVariable("vfModuleModelName", VF_MODULE_MODEL_NAME) + //when + testedObject.preProcessRequest(executionFake) + //then + assertThat(executionFake.getVariable("CAAIVfMod_vnfId")).isEqualTo(VNF_ID) + assertThat(executionFake.getVariable("CAAIVfMod_vnfName")).isEqualTo(VNF_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_vnfType")).isEqualTo(VNF_TYPE) + assertThat(executionFake.getVariable("CAAIVfMod_serviceId")).isEqualTo(SERVICE_ID) + assertThat(executionFake.getVariable("CAAIVfMod_personaId")).isEqualTo(PERSONAL_MODEL_ID) + assertThat(executionFake.getVariable("CAAIVfMod_personaVer")).isEqualTo(PERSONAL_MODEL_VERSION) + assertThat(executionFake.getVariable("CAAIVfMod_modelCustomizationId")).isEqualTo(MODEL_CUST_ID) + assertThat(executionFake.getVariable("CAAIVfMod_vnfPersonaId")).isEqualTo(VNF_PERSONAL_MODEL_ID) + assertThat(executionFake.getVariable("CAAIVfMod_vnfPersonaVer")).isEqualTo(VNF_PERSONAL_MODEL_VER) + assertThat(executionFake.getVariable("CAAIVfMod_isBaseVfModule")).isEqualTo(true) + assertThat(executionFake.getVariable("CAAIVfMod_moduleName")).isEqualTo(VF_MODULE_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_moduleModelName")).isEqualTo(VF_MODULE_MODEL_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_aaiNamespace")) + .isEqualTo(DEFAULT_AAI_NAMESPACE + "v" + DEFAULT_AAI_VERSION) + } + + @Test + void processAAIGenericVnfQuery_setVnfResponse() { + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponseCode", 200) + executionFake.setVariable("CAAIVfMod_vnfId", Strings.EMPTY) + executionFake.setVariable("CAAIVfMod_vnfName", VNF_NAME) + + testedObject.processAAIGenericVnfQuery(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_queryGenericVnfResponse")) + .isEqualTo("Invalid request for new Generic VNF which already exists, Vnf Name=" + VNF_NAME) + } + + @Test + void processAAIGenericVnfQuery_setVfModuleResponse() { + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponseCode", 500) + executionFake.setVariable("CAAIVfMod_vnfId", VNF_ID) + + testedObject.processAAIGenericVnfQuery(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_createVfModuleResponse")) + .isEqualTo("Invalid request for Add-on Module requested for non-existant Generic VNF, VNF Id=" + VNF_ID) + } + + @Test + void parseForAddOnModule_moduleNameFound() { + String xml = "<CAAIVfMod_queryGenericVnfResponse><vnf-name>" + VNF_NAME + "</vnf-name>" + + "<vf-module-name>" + VF_MODULE_NAME + "</vf-module-name></CAAIVfMod_queryGenericVnfResponse>" + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponse", xml) + executionFake.setVariable("CAAIVfMod_moduleName", VF_MODULE_NAME) + + testedObject.parseForAddOnModule(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_vnfNameFromAAI")).isEqualTo(VNF_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_moduleExists")).isEqualTo(true) + assertThat(executionFake.getVariable("CAAIVfMod_parseModuleResponse")) + .isEqualTo("VF Module " + VF_MODULE_NAME + " already exists for Generic VNF " + VNF_NAME) + } + + @Test + void parseForAddOnModule_moduleNameNotFound() { + String xml = "<CAAIVfMod_queryGenericVnfResponse><vnf-name>" + VNF_NAME + "</vnf-name>" + + "</CAAIVfMod_queryGenericVnfResponse>" + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponse", xml) + executionFake.setVariable("CAAIVfMod_moduleName", VF_MODULE_NAME) + executionFake.setVariable("CAAIVfMod_moduleExists", false) + + testedObject.parseForAddOnModule(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_vnfNameFromAAI")).isEqualTo(VNF_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_moduleExists")).isEqualTo(false) + assertThat(executionFake.getVariable("CAAIVfMod_parseModuleResponse")) + .isEqualTo("VF Module " + VF_MODULE_NAME + " does not exist for Generic VNF " + VNF_NAME) + } + + @Test + void parseForBaseModule_moduleNameFound() { + String xml = "<CAAIVfMod_queryGenericVnfResponse><vnf-name>" + VNF_NAME + "</vnf-name>" + + "<vf-module-name>" + VF_MODULE_NAME + "</vf-module-name></CAAIVfMod_queryGenericVnfResponse>" + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponse", xml) + executionFake.setVariable("CAAIVfMod_moduleName", VF_MODULE_NAME) + + testedObject.parseForBaseModule(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_vnfNameFromAAI")).isEqualTo(VNF_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_moduleExists")).isEqualTo(false) + assertThat(executionFake.getVariable("CAAIVfMod_baseModuleConflict")).isEqualTo(true) + assertThat(executionFake.getVariable("CAAIVfMod_parseModuleResponse")) + .isEqualTo("VF Module " + VF_MODULE_NAME + " already exists for Generic VNF " + VNF_NAME) + } + + @Test + void parseForBaseModule_isBaseVfModule() { + String xml = "<CAAIVfMod_queryGenericVnfResponse><vnf-name>" + VNF_NAME + "</vnf-name>" + + "<is-base-vf-module>true</is-base-vf-module></CAAIVfMod_queryGenericVnfResponse>" + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponse", xml) + executionFake.setVariable("CAAIVfMod_baseModuleConflict", false) + + testedObject.parseForBaseModule(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_vnfNameFromAAI")).isEqualTo(VNF_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_moduleExists")).isEqualTo(false) + assertThat(executionFake.getVariable("CAAIVfMod_baseModuleConflict")).isEqualTo(true) + assertThat(executionFake.getVariable("CAAIVfMod_parseModuleResponse")) + .isEqualTo("Base VF Module already exists for Generic VNF " + VNF_NAME) + } + + @Test + void parseForBaseModule_baseModuleConflictIsFalse() { + String xml = "<CAAIVfMod_queryGenericVnfResponse><vnf-name>" + VNF_NAME + "</vnf-name></CAAIVfMod_queryGenericVnfResponse>" + executionFake.setVariable("CAAIVfMod_queryGenericVnfResponse", xml) + executionFake.setVariable("CAAIVfMod_baseModuleConflict", false) + executionFake.setVariable("CAAIVfMod_moduleName", VF_MODULE_NAME) + + testedObject.parseForBaseModule(executionFake) + + assertThat(executionFake.getVariable("CAAIVfMod_vnfNameFromAAI")).isEqualTo(VNF_NAME) + assertThat(executionFake.getVariable("CAAIVfMod_moduleExists")).isEqualTo(false) + assertThat(executionFake.getVariable("CAAIVfMod_parseModuleResponse")) + .isEqualTo("VF Module " + VF_MODULE_NAME + " does not exist for Generic VNF " + VNF_NAME) + } + + private void prepareUrnPropertiesReader() { + Environment mockEnvironment = mock(Environment.class) + when(mockEnvironment.getProperty("mso.workflow.global.default.aai.version")).thenReturn(DEFAULT_AAI_VERSION) + when(mockEnvironment.getProperty("mso.workflow.global.default.aai.namespace")).thenReturn(DEFAULT_AAI_NAMESPACE) + UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader() + urnPropertiesReader.setEnvironment(mockEnvironment) + } + +} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy index 3a2673c9ee..19638f42da 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - */ + */ package org.onap.so.bpmn.common.scripts @@ -30,29 +30,15 @@ import org.junit.Rule import org.junit.rules.ExpectedException import org.junit.runner.RunWith import org.mockito.runners.MockitoJUnitRunner -import org.onap.aai.domain.yang.GenericVnf -import org.onap.so.bpmn.mock.FileUtil -import org.onap.so.client.aai.AAIObjectPlurals -import org.onap.so.client.aai.AAIObjectType import org.onap.so.client.aai.AAIResourcesClient -import org.onap.so.client.aai.entities.AAIResultWrapper -import org.onap.so.client.aai.entities.uri.AAIResourceUri -import org.onap.so.client.aai.entities.uri.AAIUriFactory -import org.onap.so.client.graphinventory.entities.uri.Depth -import org.onap.so.constants.Defaults @RunWith(MockitoJUnitRunner.class) abstract class MsoGroovyTest { - + @Rule public ExpectedException thrown = ExpectedException.none() - protected ExecutionEntity mockExecution protected AAIResourcesClient client - protected AllottedResourceUtils allottedResourceUtils_MOCK - protected final String SEARCH_RESULT_AAI_WITH_RESULTDATA = - FileUtil.readResourceFile("__files/aai/searchResults.json") - protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString(); protected void init(String procName){ mockExecution = setupMock(procName) @@ -63,91 +49,14 @@ abstract class MsoGroovyTest { protected ExecutionEntity setupMock(String procName) { ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) when(mockProcessDefinition.getKey()).thenReturn(procName) - RepositoryService mockRepositoryService = mock(RepositoryService.class) when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(procName) when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - ExecutionEntity mockExecution = mock(ExecutionEntity.class) when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - return mockExecution } - - protected ExecutionEntity setupMockWithPrefix(String procName, String prefix) { - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("prefix")).thenReturn(prefix) - - ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class) - RepositoryService repositoryService = mock(RepositoryService.class) - ProcessDefinition processDefinition = mock(ProcessDefinition.class) - - when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices) - when(processEngineServices.getRepositoryService()).thenReturn(repositoryService) - when(repositoryService.getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(processDefinition) - when(processDefinition.getKey()).thenReturn(procName) - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - return mockExecution - } - - protected <T> Optional<T> getAAIObjectFromJson(Class<T> clazz , String file){ - String json = FileUtil.readResourceFile(file) - AAIResultWrapper resultWrapper = new AAIResultWrapper(json) - return resultWrapper.asBean(clazz) - } - - protected Optional<GenericVnf> mockAAIGenericVnf(String vnfId){ - return mockAAIGenericVnf(vnfId,"__files/aai/GenericVnf.json") - } - - protected Optional<GenericVnf> mockAAIGenericVnf(String vnfId,String file){ - AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) - AAIResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).depth(Depth.ONE) - Optional<GenericVnf> genericVnf = getAAIObjectFromJson(GenericVnf.class,file); - when(client.get(GenericVnf.class, resourceUri)).thenReturn(genericVnf) - when(client.get(GenericVnf.class, resourceUriDepthOne)).thenReturn(genericVnf) - return genericVnf - } - - protected Optional<GenericVnf> mockAAIGenericVnfByName(String vnfName){ - AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName) - AAIResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE) - Optional<GenericVnf> genericVnf = getAAIObjectFromJson(GenericVnf.class,"__files/aai/GenericVnf.json"); - when(client.get(GenericVnf.class, resourceUri)).thenReturn(genericVnf) - when(client.get(GenericVnf.class, resourceUriDepthOne)).thenReturn(genericVnf) - return genericVnf - } - - protected void mockAAIGenericVnfNotFound(String vnfId){ - AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).depth(Depth.ONE) - AAIResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).depth(Depth.ONE) - when(client.get(GenericVnf.class, resourceUri)).thenReturn(Optional.empty()) - when(client.get(GenericVnf.class, resourceUriDepthOne)).thenReturn(Optional.empty()) - } - - protected void mockAAIGenericVnfByNameNotFound(String vnfName){ - AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName) - AAIResourceUri resourceUriDepthOne = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE) - when(client.get(GenericVnf.class, resourceUri)).thenReturn(Optional.empty()) - when(client.get(GenericVnf.class, resourceUriDepthOne)).thenReturn(Optional.empty()) - } - - protected AAIResultWrapper mockVolumeGroupWrapper(String region, String volumeGroupId, String file){ - AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP,CLOUD_OWNER, region,volumeGroupId) - String json = FileUtil.readResourceFile(file) - AAIResultWrapper resultWrapper = new AAIResultWrapper(json) - when(client.get(resourceUri)).thenReturn(resultWrapper) - return resultWrapper - } - - void initAR(String procName){ - init(procName) - allottedResourceUtils_MOCK = spy(new AllottedResourceUtils(mock(AbstractServiceTaskProcessor.class))) - when(allottedResourceUtils_MOCK.getAAIClient()).thenReturn(client) - } } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java index 38be9f3790..79b0d33062 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java @@ -505,7 +505,7 @@ public class StubResponseAAI { } public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) { - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion)) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegion)) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "text/xml") @@ -529,7 +529,7 @@ public class StubResponseAAI { } public static void MockGetNetworkCloudRegion_404(String cloudRegion) { - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion)) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegion)) .willReturn(aResponse() .withStatus(404))); } @@ -722,12 +722,12 @@ public class StubResponseAAI { .withStatus(200) .withHeader("Content-Type", "text/xml") .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml"))); - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987")) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/MDTWNJ21/volume-groups/volume-group/78987")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "text/xml") .withBodyFile("VfModularity/VolumeGroup.xml"))); - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987")) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/volume-groups/volume-group/78987")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "text/xml") @@ -757,7 +757,7 @@ public class StubResponseAAI { */ public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) { - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId)) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId)) .willReturn(aResponse() .withStatus(statusCode) .withHeader("Content-Type", "text/xml") @@ -772,7 +772,7 @@ public class StubResponseAAI { } public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int responseCode) { - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId)) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId)) .willReturn(aResponse() .withStatus(responseCode) .withHeader("Content-Type", "text/xml") @@ -780,7 +780,7 @@ public class StubResponseAAI { } public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) { - stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId)) + stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId)) .willReturn(aResponse() .withStatus(statusCode) .withHeader("Content-Type", "text/xml") @@ -788,7 +788,7 @@ public class StubResponseAAI { } public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) { - stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName)) + stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName)) .willReturn(aResponse() .withStatus(statusCode) .withHeader("Content-Type", "text/xml") @@ -796,19 +796,19 @@ public class StubResponseAAI { } public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) { - stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion)) + stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion)) .willReturn(aResponse() .withStatus(statusCode))); } public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) { - stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName)) + stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName)) .willReturn(aResponse() .withStatus(404))); } public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) { - stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion)) + stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion)) .willReturn(aResponse() .withStatus(200))); } @@ -913,7 +913,7 @@ public class StubResponseAAI { } public static void MockGetDefaultCloudRegionByCloudRegionId(String cloudRegionId, String responseFile, int statusCode) { - stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegionId + ".*")) + stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegionId + ".*")) .willReturn(aResponse() .withStatus(statusCode) .withHeader("Content-Type", "application/json; charset=utf-8") diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index eed4b1411f..0db2f9fc12 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -118,7 +118,7 @@ public class BBInputSetupTest { private static final String RESOURCE_PATH = "src/test/resources/__files/ExecuteBuildingBlock/"; protected ObjectMapper mapper = new ObjectMapper(); - private static final String CLOUD_OWNER = "att-aic"; + private static final String CLOUD_OWNER = "CloudOwner"; @Spy private BBInputSetup SPY_bbInputSetup = new BBInputSetup(); diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json index 60dd880040..8640c2e899 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json @@ -14,7 +14,7 @@ }, "cloudRegion": { "lcp-cloud-region-id" : "myRegionId", - "cloud-owner": "att-aic" + "cloud-owner": "CloudOwner" }, "userInput": null, "customer": { diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetails_CreateVnf.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetails_CreateVnf.json index 8332ddc28f..a6072bbb57 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetails_CreateVnf.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetails_CreateVnf.json @@ -45,7 +45,7 @@ "relatedInstance": { "instanceId": "{instanceGroupId}", "modelInfo": { - "modelType": "networkCollection", + "modelType": "networkInstanceGroup", "modelInvariantId": "9ea660dc-155f-44d3-b45c-cc7648b4f31c", "modelVersionId": "bb07aad1-ce2d-40c1-85cb-5392f76bb1ef", "modelName": "{network collection model name}", diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/aai-volume-group-id-info.xml b/bpmn/MSOCommonBPMN/src/test/resources/__files/aai-volume-group-id-info.xml index 4167e2e87d..dff05c908a 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/aai-volume-group-id-info.xml +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/aai-volume-group-id-info.xml @@ -11,7 +11,7 @@ <tns:related-to>tenant</tns:related-to> <tns:relationship-data> <tns:relationship-key>cloud-region.cloud-owner</tns:relationship-key> - <tns:relationship-value>att-aic</tns:relationship-value> + <tns:relationship-value>CloudOwner</tns:relationship-value> </tns:relationship-data> <tns:relationship-data> <tns:relationship-key>cloud-region.cloud-region-id</tns:relationship-key> diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/resources/e2e-complex.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/resources/e2e-complex.json index 21bacbd5ce..e3d830e978 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/resources/e2e-complex.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/resources/e2e-complex.json @@ -547,11 +547,11 @@ }, { "related-to": "cloud-region", - "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtcnj2", + "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtcnj2", "relationship-data": [ { "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" + "relationship-value": "CloudOwner" }, { "relationship-key": "cloud-region.cloud-region-id", @@ -567,11 +567,11 @@ }, { "related-to": "oam-network", - "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/oam-networks/oam-network/f9263cat-4eaa-43a0-bea4-adcf6e123456", + "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/oam-networks/oam-network/f9263cat-4eaa-43a0-bea4-adcf6e123456", "relationship-data": [ { "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" + "relationship-value": "CloudOwner" }, { "relationship-key": "cloud-region.cloud-region-id", @@ -591,11 +591,11 @@ }, { "related-to": "oam-network", - "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/oam-networks/oam-network/b9263fab-4eaa-43a0-bea4-adcf6e999999", + "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/oam-networks/oam-network/b9263fab-4eaa-43a0-bea4-adcf6e999999", "relationship-data": [ { "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" + "relationship-value": "CloudOwner" }, { "relationship-key": "cloud-region.cloud-region-id", @@ -615,11 +615,11 @@ }, { "related-to": "oam-network", - "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/oam-networks/oam-network/cf33dc95-c5d2-48fd-8078-fd949363f63b", + "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/oam-networks/oam-network/cf33dc95-c5d2-48fd-8078-fd949363f63b", "relationship-data": [ { "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" + "relationship-value": "CloudOwner" }, { "relationship-key": "cloud-region.cloud-region-id", @@ -639,11 +639,11 @@ }, { "related-to": "availability-zone", - "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/availability-zones/availability-zone/mtcnj-esx-az01", + "related-link": "https://localhost:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/availability-zones/availability-zone/mtcnj-esx-az01", "relationship-data": [ { "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "att-aic" + "relationship-value": "CloudOwner" }, { "relationship-key": "cloud-region.cloud-region-id", |