summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-05-06 13:31:32 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-05-06 13:31:32 +0300
commit9e8835dd593b382f369308fac3cc1cfc64c0971c (patch)
treef1e2af99695f2cbb91173a0547d991a9cb72652b /vid-app-common/src/main/webapp
parentcaf0ab3707f8177e4b20d1cf735e5e20c2e6ec14 (diff)
VoLTE support
Change-Id: I593b9c92bf9330c2d28f2ccbd59c0651b67fe94a Issue-ID: VID-189 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js3
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js10
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js1
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js108
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js6
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js9
6 files changed, 128 insertions, 9 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
index a9278c36..b08b2b16 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
@@ -25,7 +25,8 @@ appDS2
.constant("COMPONENT", (function() {
return {
A_LA_CARTE : "a la carte",
- CLOUD_REGION_ID : "cloudRegionID",
+ CLOUD_OWNER : "cloudOwner",
+ CLOUD_REGION_ID : "cloudRegionID",
COMPONENT_STATUS : "ComponentStatus",
CREATE_COMPONENT : "createComponent",
DELETE_RESUME_COMPONENT : "deleteResumeComponent",
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
index 967a3900..cbb93571 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
@@ -120,7 +120,15 @@
var serviceModel = getServiceResponse.data;
DataService.setServiceName(serviceModel.service.name);
-
+
+ //VOLTE services need input list generated and macro style
+ DataService.setE2EService(false);
+ if(serviceModel.service.category === 'E2E Service') {
+ DataService.setE2EService(true);
+ DataService.setHideServiceFields(false);
+ VIDCONFIGURATION.MACRO_SERVICES.push(serviceModel.service.invariantUuid);
+ }
+
DataService.setModelInfo(COMPONENT.SERVICE, {
"modelInvariantId": serviceModel.service.invariantUuid,
"modelVersion": serviceModel.service.version,
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
index 53a941bf..4b1d7713 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
@@ -378,6 +378,7 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
lcpCloudRegionTenants.push({
+ "cloudOwner": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_OWNER],
"cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
"tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
"tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID],
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
index 56ec715b..0e7dbe46 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
@@ -199,8 +199,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
var getUserProvidedList = function() {
var parameterList = [];
var isUserProvidedNaming = false;
- if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null)
- && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) {
+ if ( ((DataService.getModelInfo(_this.componentId).serviceEcompNaming != null)
+ && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false")) || DataService.getE2EService() ) {
isUserProvidedNaming = true;
}
@@ -228,8 +228,9 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
FIELD.PARAMETER.TENANT_DISABLED
]);
- parameterList = parameterList.concat([ getAicZonesParameter() ]);
-
+ if(!DataService.getE2EService()) {
+ parameterList = parameterList.concat([getAicZonesParameter()]);
+ }
}else{
parameterList = parameterList.concat([ getServiceId(),
@@ -239,8 +240,11 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
}
}
- parameterList = parameterList.concat([ getProjectParameter() ]);
- parameterList = parameterList.concat([ getOwningEntityParameter() ]);
+ if(!DataService.getE2EService()) {
+ parameterList = parameterList.concat([getProjectParameter()]);
+ parameterList = parameterList.concat([getOwningEntityParameter()]);
+ }
+
//if service model has a pnf, add a PNF ID parameter
if (DataService.getPnf()) {
parameterList = parameterList.concat([ FIELD.PARAMETER.PNF_ID ]);
@@ -516,7 +520,10 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
return "mso_create_nw_instance/"
+ DataService.getServiceInstanceId();
case COMPONENT.SERVICE:
- return "mso_create_svc_instance";
+ if(DataService.getE2EService() === true)
+ return "mso_create_e2e_svc_instance";
+ else
+ return "mso_create_svc_instance";
case COMPONENT.VNF:
return "mso_create_vnf_instance/"
+ DataService.getServiceInstanceId();
@@ -531,11 +538,98 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
}
};
+ var getMsoE2ERequest = function(parameterList) {
+ var modelInfo = DataService.getModelInfo(_this.componentId);
+
+ //region id
+ var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+ if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+ lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+ parameterList);
+ }
+ var cloudOwner = _.find(DataService.getCloudRegionTenantList(), function(region){
+ return region.cloudRegionId === lcpRegion;
+ }).cloudOwner;
+
+ var params = [];
+ var displayInputs = modelInfo.displayInputs;
+ var groupBy = _.groupBy(displayInputs, "templateUUID");
+
+ _.forEach(groupBy, function(nodeTemplateInputs, nodeTemplateUUID) {
+ var reqParas = {};
+ var vfLocations = [];
+
+ nodeTemplateInputs.forEach(function(parameter){
+ if(parameter.type === 'vf_location') {
+ var loc = {
+ vnfProfileId: parameter.displayName,
+ locationConstraints : {
+ vimId: cloudOwner + '_' + lcpRegion
+ }
+ };
+ vfLocations.push(loc);
+ } else if(parameter.type === 'sdn_controller') {
+ if(parameter.value === undefined || parameter.value === null) {
+ reqParas[parameter.name] = '';
+ } else {
+ reqParas[parameter.name] = parameter.value.value;
+ }
+ } else {
+ var name;
+ _.forEach(displayInputs, function(item, key){
+ if(item === parameter) {
+ name = key;
+ }
+ });
+ var value = _.find(parameterList, function(item){
+ return item.id === name;
+ }).value;
+ reqParas[parameter.displayName] = value;
+ }
+ });
+
+ params.push({
+ resourceName: nodeTemplateInputs[0].templateName,
+ resourceInvariantUuid: nodeTemplateInputs[0].templateInvariantUUID,
+ resourceUuid: nodeTemplateInputs[0].templateUUID,
+ resourceCustomizationUuid: nodeTemplateInputs[0].templateCustomizationUUID,
+ parameters: {
+ locationConstraints: vfLocations,
+ //TODO resources: [],
+ requestInputs: reqParas
+ }
+ });
+ });
+
+ var requestBody = {
+ service: {
+ name: getValueFromList(FIELD.ID.INSTANCE_NAME, parameterList),
+ description: modelInfo["description"],
+ serviceInvariantUuid: modelInfo["modelInvariantId"],
+ serviceUuid: modelInfo["modelNameVersionId"],
+ globalSubscriberId: DataService.getGlobalCustomerId(),
+ serviceType: getValueFromList(FIELD.ID.SERVICE_TYPE, parameterList) || modelInfo["serviceTypeName"],
+ parameters: {
+ locationConstraints: [],
+ resources: params,
+ requestInputs: {} //TODO
+ }
+ }
+ };
+
+ return requestBody;
+ };
+
var getMsoRequestDetails = function(parameterList) {
console.log("getMsoRequestDetails invoked, parameterList="); console.log(JSON.stringify(parameterList,null,4));
//console.log("getMsoRequestDetails invoked, DataService.getArbitraryParameters()=");
//console.log(JSON.stringify(DataService.getArbitraryParameters(),null,4));
+ //VoLTE logic goes here
+ if(DataService.getE2EService() === true) {
+ return getMsoE2ERequest(parameterList);
+ }
+
var modelInfo = DataService.getModelInfo(_this.componentId);
var requestorloggedInId = DataService.getLoggedInUserId();
var owningEntityId = getValueFromList(FIELD.ID.OWNING_ENTITY, parameterList);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
index 716854ed..77523e9c 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
@@ -300,6 +300,12 @@ var DataService = function($log, DataService) {
getArbitraryParameters : function () {
return _this.arbitraryParameters;
},
+ setE2EService:function(b){
+ _this.e2eService=b;
+ },
+ getE2EService:function(){
+ return _this.e2eService;
+ },
setHideServiceFields:function(b){
_this.hideServiceFields=b;
},
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
index 8577e993..942bd795 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
@@ -156,6 +156,11 @@ var UtilityService = function($log, DataService, PARAMETER) {
serviceModel.service.inputs[cmdObj.inputName] != null ) {
networkModelDisplayInputs[cmdObj.inputName] = (serviceModel.service.inputs[cmdObj.inputName]);
networkModelDisplayInputs[cmdObj.inputName][PARAMETER.DISPLAY_NAME] = cmdObj.displayName;
+ //E2E services need this
+ ["templateInvariantUUID", "templateCustomizationUUID", "templateUUID", "templateName"].forEach(function(templateProp) {
+ networkModelDisplayInputs[cmdObj.inputName][templateProp] = networkModel.inputs[cmdObj.displayName][templateProp];
+ });
+
}
}
@@ -237,6 +242,10 @@ var UtilityService = function($log, DataService, PARAMETER) {
serviceModel.service.inputs[cmdObj.inputName] != null ) {
vnfModelDisplayInputs[cmdObj.inputName] = (serviceModel.service.inputs[cmdObj.inputName]);
vnfModelDisplayInputs[cmdObj.inputName][PARAMETER.DISPLAY_NAME] = cmdObj.displayName;
+ //E2E services need this
+ ["templateInvariantUUID", "templateCustomizationUUID", "templateUUID", "templateName"].forEach(function(templateProp) {
+ networkModelDisplayInputs[cmdObj.inputName][templateProp] = vnfModel.inputs[cmdObj.displayName][templateProp];
+ });
}
}