aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/services
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/services')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js77
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/asdcService.js59
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js6
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js12
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js6
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js38
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/propertyService.js9
7 files changed, 149 insertions, 58 deletions
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 ceb5a754..6ede6ef3 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
@@ -76,8 +76,8 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
}];
}
return {displayData: displayData};
- })
- }
+ });
+ };
function getJoinedQueryString(queries) {
return queries.filter(function (val) {return val;}).join("&");
@@ -347,27 +347,16 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
});
},
- getPortMirroringData : function (ids) {
+ getPortMirroringData: function (ids) {
var defer = $q.defer();
- if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_REGION_ID_FROM_REMOTE)){
- var url = COMPONENT.AAI_GET_PORT_MIRRORING_CONFIGS_DATA +'?configurationIds=' + ids.join(',');
- $http.get(url).then(function(res){
- defer.resolve(res);
- }).catch(function(err) {
- $log.error(err);
- defer.resolve({});
- });
- }else {
- var staticConfigurationData = {};
- angular.forEach(ids, function(id) {
- staticConfigurationData[id] = {
- "cloudRegionId": "mdt1"
- }
- });
- defer.resolve({
- "data": staticConfigurationData
- });
- }
+
+ var url = COMPONENT.AAI_GET_PORT_MIRRORING_CONFIGS_DATA + '?configurationIds=' + ids.join(',');
+ $http.get(url).then(function (res) {
+ defer.resolve(res);
+ }).catch(function (err) {
+ $log.error(err);
+ defer.resolve({});
+ });
return defer.promise;
@@ -385,6 +374,29 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
return defer.promise;
},
+ getVlansByNetworksMapping : function (globalCustomerId, serviceType, serviceInstanceId, sdcModelUuid) {
+ var defer = $q.defer();
+ if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS)) {
+ var url = COMPONENT.AAI_GET_PROVIDER_NETWORKS_ASSOCIATIONS + '?'
+ + 'globalCustomerId=' + globalCustomerId
+ + '&serviceType=' + serviceType
+ + '&serviceInstanceId=' + serviceInstanceId
+ + '&sdcModelUuid=' + sdcModelUuid
+ ;
+
+ $http.get(url).then(function(res){
+ defer.resolve(res.data);
+ }).catch(function(err) {
+ $log.error(err);
+ defer.resolve({});
+ });
+
+ } else {
+ defer.resolve({});
+ }
+ return defer.promise;
+ },
+
getSubscriptionServiceTypeList : function(globalCustomerId,
successCallbackFunction) {
$log
@@ -434,8 +446,8 @@ 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],
+ "cloudOwner": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_OWNER],
"tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
"tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID],
"isPermitted": aaiLcpCloudRegionTenants[i][COMPONENT.IS_PERMITTED]});
@@ -741,8 +753,25 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
"headers: " + header +
"config: " + config);
});
+ },
+
+ getHomingData: function(vnfInstanceId, vfModuleId) {
+ var url = COMPONENT.AAI_GET_HOMING_DATA.replace('@vnfInstanceId', vnfInstanceId)
+ .replace('@vfModuleId', vfModuleId);
+
+ var deferred = $q.defer();
+
+ $http.get(url)
+ .success(function (response) {
+ deferred.resolve({data: response});
+ }).error(function (data, status, headers, config) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
+
}
- }
+ };
};
appDS2.factory("AaiService", ["$http", "$log", "PropertyService",
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/asdcService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/asdcService.js
index 6bdc0ae9..52adcc94 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/asdcService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/asdcService.js
@@ -21,6 +21,22 @@
"use strict";
var AsdcService = function ($http, $log, PropertyService, UtilityService, VIDCONFIGURATION, COMPONENT, DataService, featureFlags) {
+ var shouldExcludeMacroFromAsyncInstantiationFlow = function(serviceModel){
+ if (!featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_ASYNC_INSTANTIATION))
+ return true;
+ if (DataService.getE2EService())
+ return true;
+ if (!_.isEmpty(serviceModel.pnfs))
+ return true;
+ if (!_.isEmpty(serviceModel.collectionResource))
+ return true;
+ if (!_.isEmpty(serviceModel.networks) && !featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_NETWORK_TO_ASYNC_INSTANTIATION))
+ return true;
+ if(serviceModel.service.instantiationType === "ClientConfig")
+ return true;
+ return false;
+ };
+
return {
getModel: function (modelId, successCallbackFunction) {
$log.debug("AsdcService:getModel: modelId: " + modelId);
@@ -34,19 +50,30 @@ var AsdcService = function ($http, $log, PropertyService, UtilityService, VIDCON
(UtilityService.runHttpErrorHandler);
},
- shouldExcludeMacroFromAsyncInstatiationFlow: function(serviceModel){
- if (!featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_ASYNC_INSTANTIATION))
- return true;
- if (DataService.getE2EService())
- return true;
- if (!_.isEmpty(serviceModel.pnfs))
- return true;
- if (!_.isEmpty(serviceModel.collectionResource))
- return true;
- if (!_.isEmpty(serviceModel.networks) && !featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_NETWORK_TO_ASYNC_INSTANTIATION))
- return true;
- if(serviceModel.service.instantiationType === "ClientConfig")
- return true;
+ shouldTakeTheDrawingBoardViewEdit: function(serviceModel) {
+ if (serviceModel.service.vidNotions
+ && serviceModel.service.vidNotions.viewEditUI
+ && serviceModel.service.vidNotions.viewEditUI !== 'legacy'
+ ) return true;
+
+ return false;
+ },
+
+ shouldTakeTheAsyncInstantiationFlow: function(serviceModel) {
+ // First of all, respect serviceModel.service.vidNotions.instantiationUI
+ if (serviceModel.service.vidNotions
+ && serviceModel.service.vidNotions.instantiationUI
+ && serviceModel.service.vidNotions.instantiationUI !== 'legacy'
+ ) return true;
+
+ // If defined 'legacy' or not defined, other client-side
+ // logic still apply:
+
+ if (this.isMacro(serviceModel)
+ && !shouldExcludeMacroFromAsyncInstantiationFlow(serviceModel)
+ ) return true;
+
+ // otherwise...
return false;
},
@@ -63,15 +90,15 @@ var AsdcService = function ($http, $log, PropertyService, UtilityService, VIDCON
return UtilityService.arrayContains(VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid);
default:
console.debug("Unexpected serviceModel.service.instantiationType: " + serviceModel.service.instantiationType);
- return true;
+ return UtilityService.arrayContains(VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid);
}
} else {
$log.debug("isMscro=false, because serviceModel.service is undefined");
return false;
}
}
- }
-}
+ };
+};
appDS2.factory("AsdcService", ["$http", "$log", "PropertyService",
"UtilityService", "VIDCONFIGURATION","COMPONENT", "DataService", "featureFlags", AsdcService]);
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 b896847d..7d07714d 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
@@ -1117,8 +1117,14 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
if (j < parameter.optionList.length) {
continue;
}
+
+ var optionName = featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST) && cloudRegionTenantList[i].cloudOwner ?
+ cloudRegionTenantList[i].cloudRegionId + " (" + cloudRegionTenantList[i].cloudOwner.trim().toLowerCase().replace(/^att-/, "").toUpperCase() + ")" :
+ cloudRegionTenantList[i].cloudRegionId;
+
parameter.optionList.push({
id : cloudRegionTenantList[i].cloudRegionId,
+ name: optionName,
isPermitted : cloudRegionTenantList[i].isPermitted
});
}
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 0e163551..6cc71b41 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
@@ -270,15 +270,15 @@ var DataService = function($log, DataService) {
}
return _this.aLaCarte;
},
- setShouldExcludeMacroFromAsyncInstatiationFlow: function (val) {
- _this.shouldExcludeMacroFromAsyncInstatiationFlow = val;
+ setShouldIncludeInAsyncInstantiationFlow: function (val) {
+ _this.shouldIncludeInAsyncInstantiationFlow = val;
},
- getShouldExcludeMacroFromAsyncInstatiationFlow: function(){
- if (_this.shouldExcludeMacroFromAsyncInstatiationFlow === undefined) {
+ getShouldIncludeInAsyncInstantiationFlow: function(){
+ if (_this.shouldIncludeInAsyncInstantiationFlow === undefined) {
return false;
}
- return _this.shouldExcludeMacroFromAsyncInstatiationFlow;
- },
+ return _this.shouldIncludeInAsyncInstantiationFlow;
+ },
setMacro : function(aval) {
_this.macro = aval;
},
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
index 416096a1..a8db5214 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -422,8 +422,14 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
if (j < parameter.optionList.length) {
continue;
}
+
+ var optionName = featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST) && cloudRegionTenantList[i].cloudOwner ?
+ cloudRegionTenantList[i].cloudRegionId + " (" + cloudRegionTenantList[i].cloudOwner.trim().toLowerCase().replace(/^att-/, "").toUpperCase() + ")" :
+ cloudRegionTenantList[i].cloudRegionId;
+
parameter.optionList.push({
id : cloudRegionTenantList[i].cloudRegionId,
+ name: optionName,
isPermitted : cloudRegionTenantList[i].isPermitted
});
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
index 273f8e9e..790f7988 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
@@ -80,6 +80,30 @@ var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityS
};
+ var buildPayloadForActivateFabricConfiguration = function (model, userId) {
+ var requestDetails = {
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": model.service.invariantUuid,
+ "modelVersionId": model.service.uuid,
+ "modelName": model.service.name,
+ "modelVersion": model.service.version
+ },
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": userId
+ },
+ "requestParameters": {
+ "aLaCarte": false
+ }
+ };
+
+ $log.debug("Service Activate Fabric Configuration payload", requestDetails);
+
+ return requestDetails;
+
+ };
+
var activateInstance = function(requestParams) {
var requestDetails = buildPayloadForServiceActivateDeactivate(requestParams.model, requestParams.userId);
@@ -94,12 +118,10 @@ var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityS
requestDetails);
};
- var sendPostRequest = function(url, requestDetails) {
+ var sendPostRequestWithBody = function(url, requestBody) {
var deferred = $q.defer();
if (url) {
- $http.post(url, {
- requestDetails: requestDetails
- }, {
+ $http.post(url, requestBody, {
timeout: PropertyService.getServerResponseTimeoutMsec()
}).success(function (response) {
deferred.resolve({data: response});
@@ -111,9 +133,16 @@ var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityS
return deferred.promise;
};
+ var sendPostRequest = function(url, requestDetails) {
+ return sendPostRequestWithBody(url, {requestDetails: requestDetails});
+ };
+
return {
createInstance : requestInstanceUpdate,
deleteInstance : requestInstanceUpdate,
+ createAndDeleteInstance: function(requestParams) {
+ return sendPostRequest("mso/" + requestParams.url, requestParams.requestDetails);
+ },
getOrchestrationRequest : function(requestId, successCallbackFunction) {
$log.debug("MsoService:getOrchestrationRequest: requestId: "
+ requestId);
@@ -312,7 +341,6 @@ var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityS
"modelCustomizationName": requestParams.configurationModelInfo.modelCustomizationName
},
"cloudConfiguration": {
- // "tenantId": ????
"lcpCloudRegionId": requestParams.portMirroringConfigFields.lcpRegion.value
},
"requestInfo": {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/propertyService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/propertyService.js
index ad9bf7df..b576b29e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/propertyService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/propertyService.js
@@ -29,7 +29,6 @@ var PropertyService = function($location, $http, VIDCONFIGURATION ) {
var DEFAULT_MSO_MAX_POLLING_INTERVAL_MSEC = 60000;
var DEFAULT_MSO_MAX_POLLS = 10;
var DEFAULT_MSO_BASE_URL = "/" + BASE_PATH + "/mso";
- var DEFAULT_SERVER_RESPONSE_TIMEOUT_MSEC = 60000;
var MSO_POLLING_INTERVAL_MSECS = "mso_polling_interval_msecs";
var MSO_MAX_POLLS = "mso_max_polls";
@@ -40,7 +39,6 @@ var PropertyService = function($location, $http, VIDCONFIGURATION ) {
_this.msoMaxPollingIntervalMsec = DEFAULT_MSO_MAX_POLLING_INTERVAL_MSEC;
_this.msoMaxPolls = DEFAULT_MSO_MAX_POLLS;
_this.msoBaseUrl = DEFAULT_MSO_BASE_URL;
- _this.serverResponseTimeoutMsec = DEFAULT_SERVER_RESPONSE_TIMEOUT_MSEC;
return {
@@ -78,12 +76,9 @@ var PropertyService = function($location, $http, VIDCONFIGURATION ) {
_this.msoBaseUrl = msoBaseUrl;
},
getServerResponseTimeoutMsec : function() {
- return _this.serverResponseTimeoutMsec;
- },
- setServerResponseTimeoutMsec : function(serverResponseTimeoutMsec) {
- _this.serverResponseTimeoutMsec = serverResponseTimeoutMsec;
+ return VIDCONFIGURATION.SERVER_RESPONSE_TIMEOUT_MSECS;
}
};
-}
+};
appDS2.factory("PropertyService", PropertyService);