diff options
author | Ofir Sonsino <os0695@att.com> | 2017-09-20 13:20:42 +0300 |
---|---|---|
committer | Ofir Sonsino <os0695@att.com> | 2017-09-20 13:37:03 +0300 |
commit | 9dfd7e28c1eb348fcb4a2de8c6faae2a01b34942 (patch) | |
tree | c273862f59b0b64c19ccfea5f59ab574071cb323 /vid-app-common/src/main/webapp/app/vid/scripts/services | |
parent | c3722d135481cfab5978c84853d8229d1e7d9cb3 (diff) |
Global Read only role, Support VID specific Roles
Issue-ID: VID-46 , VID-47
Change-Id: Ib100d20ac40a65d39e27a6e2741b19a173a2b8ea
Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/services')
6 files changed, 533 insertions, 375 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 ee99547b..09c70eb5 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 @@ -20,339 +20,365 @@ "use strict";
-var AaiService = function($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) {
+var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) {
return {
- getSubscriberName : function(globalCustomerId,
- successCallbackFunction) {
- $log
- .debug("AaiService:getSubscriberName: globalCustomerId: "
- + globalCustomerId);
- $http.get(
- COMPONENT.AAI_SUB_DETAILS_PATH
- + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- var subName = "";
- if (response.data) {
- subName = response.data[FIELD.ID.SUBNAME];
- }
- successCallbackFunction(subName);
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
+ getSubscriberName: function (globalCustomerId,
+ successCallbackFunction) {
+ $log
+ .debug("AaiService:getSubscriberName: globalCustomerId: "
+ + globalCustomerId);
+ $http.get(
+ COMPONENT.AAI_SUB_DETAILS_PATH
+ + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var subName = "";
+ if (response.data) {
+ subName = response.data[FIELD.ID.SUBNAME];
+ }
+ successCallbackFunction(subName);
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
-
- runNamedQuery : function (namedQueryId, globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
-
- var url = COMPONENT.AAI_SUB_VIEWEDIT_PATH +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(namedQueryId) +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(globalCustomerId) +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceType) +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceInstanceId);
- $http.get(url, {
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data != null) {
- successCallback(response);
- } else {
- errorCallback(response);
- }
- }, function(response) {
- errorCallback(response);
- });
- },
-
-
- getSubDetails : function(selectedSubscriber, selectedServiceInstance, successCallback, errorCallback) {
- var subscriber;
- var displayData;
- $http.get( COMPONENT.AAI_SUB_DETAILS_PATH + selectedSubscriber, {
+ runNamedQuery: function (namedQueryId, globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- displayData = [];
- subscriber = response.data;
- var subscriberName = subscriber[FIELD.ID.SUBNAME];
- if (subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS] != null) {
- angular.forEach(subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION], function(serviceSubscription, key) {
- var serviceInstanceId = [];
- var serviceType = "";
- if (serviceSubscription[FIELD.ID.SERVICETYPE] != null) {
- serviceType = serviceSubscription[FIELD.ID.SERVICETYPE];
- } else {
- serviceType = FIELD.PROMPT.NO_SERVICE_SUB;
- }
- if (serviceSubscription[FIELD.ID.SERVICE_INSTANCES] != null) {
- angular.forEach(serviceSubscription[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE], function(instValue, instKey) {
- // put them together, i guess
- var inst = { "serviceInstanceId": instValue[FIELD.ID.SERVICE_INSTANCE_ID],
- "aaiModelInvariantId": instValue[FIELD.ID.MODEL_INVAR_ID],
- "aaiModelVersionId": instValue[FIELD.ID.MODEL_VERSION_ID],
- "serviceInstanceName": instValue[FIELD.ID.SERVICE_INSTANCE_NAME]
- };
- if (selectedServiceInstance != null) {
- if ((instValue[FIELD.ID.SERVICE_INSTANCE_ID] == selectedServiceInstance ) || (instValue[FIELD.ID.SERVICE_INSTANCE_NAME] == selectedServiceInstance)) {
- serviceInstanceId.push(inst);
- }
- } else {
- serviceInstanceId.push(inst);
- }
- });
- } else {
- if (serviceInstanceId == []) {
- serviceInstanceId = [ FIELD.PROMPT.NO_SERVICE_INSTANCE ];
- }
- }
- angular.forEach(serviceInstanceId, function(subVal, subKey) {
- displayData.push({
- globalCustomerId : selectedSubscriber,
- subscriberName : subscriberName,
- serviceType : serviceType,
- serviceInstanceId : subVal.serviceInstanceId,
- aaiModelInvariantId : subVal.aaiModelInvariantId,
- aaiModelVersionId
- : subVal.aaiModelVersionId,
- serviceInstanceName : subVal.serviceInstanceName
- });
- });
- });
- } else {
- displayData.push({
- globalCustomerId : selectedSubscriber,
- subscriberName : selectedSubscriberName,
- serviceType : FIELD.PROMPT.NO_SERVICE_SUB,
- serviceInstanceId : FIELD.PROMPT.NO_SERVICE_INSTANCE
- });
- }
- successCallback(displayData, subscriberName);
- }, function(response) {
- errorCallback(response);
- });
- },
- getSubList : function(successCallback, errorCallback ) {
+ var url = COMPONENT.AAI_SUB_VIEWEDIT_PATH +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(namedQueryId) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(globalCustomerId) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceType) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceInstanceId);
+ $http.get(url, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data != null) {
+ successCallback(response);
+ } else {
+ errorCallback(response);
+ }
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
- $http.get( FIELD.ID.AAI_GET_FULL_SUBSCRIBERS, {
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- var customerList = [];
- if (response.data.customer != null) {
- angular.forEach(response.data.customer, function(subVal, subKey) {
- var cust = { "globalCustomerId": subVal[FIELD.ID.GLOBAL_CUSTOMER_ID], "subscriberName": subVal[FIELD.ID.SUBNAME] };
- customerList.push(cust);
- });
- successCallback(customerList);
- } else {
- errorCallback(response);
- }
- },function(response) {
- errorCallback(response);
- });
- },
-
- getServices2 : function(successCallback, errorCallback ) {
+ getSubDetails: function (selectedSubscriber, selectedServiceInstance, successCallback, errorCallback) {
+ var subscriber;
+ var displayData;
+ $http.get(COMPONENT.AAI_SUB_DETAILS_PATH + selectedSubscriber, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ displayData = [];
+ subscriber = response.data;
+ var subscriberName = subscriber[FIELD.ID.SUBNAME];
+ if (subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS] != null) {
+ angular.forEach(subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION], function (serviceSubscription, key) {
+ var serviceInstanceId = [];
+ var serviceType = "";
+ if (serviceSubscription[FIELD.ID.SERVICETYPE] != null) {
+ serviceType = serviceSubscription[FIELD.ID.SERVICETYPE];
+ } else {
+ serviceType = FIELD.PROMPT.NO_SERVICE_SUB;
+ }
+ if (serviceSubscription[FIELD.ID.SERVICE_INSTANCES] != null) {
+ angular.forEach(serviceSubscription[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE], function (instValue, instKey) {
+ // put them together, i guess
+ var inst = {
+ "serviceInstanceId": instValue[FIELD.ID.SERVICE_INSTANCE_ID],
+ "aaiModelInvariantId": instValue[FIELD.ID.MODEL_INVAR_ID],
+ "aaiModelVersionId": instValue[FIELD.ID.MODEL_VERSION_ID],
+ "serviceInstanceName": instValue[FIELD.ID.SERVICE_INSTANCE_NAME]
+ };
+ if (selectedServiceInstance != null) {
+ if ((instValue[FIELD.ID.SERVICE_INSTANCE_ID] == selectedServiceInstance ) || (instValue[FIELD.ID.SERVICE_INSTANCE_NAME] == selectedServiceInstance)) {
+ serviceInstanceId.push(inst);
+ }
+ } else {
+ serviceInstanceId.push(inst);
+ }
+ });
+ } else {
+ if (serviceInstanceId == []) {
+ serviceInstanceId = [FIELD.PROMPT.NO_SERVICE_INSTANCE];
+ }
+ }
+ angular.forEach(serviceInstanceId, function (subVal, subKey) {
+ displayData.push({
+ globalCustomerId: selectedSubscriber,
+ subscriberName: subscriberName,
+ serviceType: serviceType,
+ serviceInstanceId: subVal.serviceInstanceId,
+ aaiModelInvariantId: subVal.aaiModelInvariantId,
+ aaiModelVersionId: subVal.aaiModelVersionId,
+ serviceInstanceName: subVal.serviceInstanceName,
+ isPermitted: serviceSubscription[FIELD.ID.IS_PERMITTED]
+ });
+ });
+ });
+ } else {
+ displayData.push({
+ globalCustomerId: selectedSubscriber,
+ subscriberName: selectedSubscriberName,
+ serviceType: FIELD.PROMPT.NO_SERVICE_SUB,
+ serviceInstanceId: FIELD.PROMPT.NO_SERVICE_INSTANCE
+ });
+ }
+ successCallback(displayData, subscriberName);
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
+ getSubList: function (successCallback, errorCallback) {
- $http.get( FIELD.ID.AAI_GET_SERVICES, {
+ $http.get(FIELD.ID.AAI_GET_FULL_SUBSCRIBERS, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var customerList = [];
+ if (response.data.customer != null) {
+ angular.forEach(response.data.customer, function (subVal, subKey) {
+ var cust = {
+ "globalCustomerId": subVal[FIELD.ID.GLOBAL_CUSTOMER_ID],
+ "subscriberName": subVal[FIELD.ID.SUBNAME],
+ "isPermitted": subVal[FIELD.ID.IS_PERMITTED],
+ };
+ customerList.push(cust);
+ });
+ successCallback(customerList);
+ } else {
+ errorCallback(response);
+ }
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- var customerList = [];
- if (response.data != null) {
- var serviceIdList = [];
- angular.forEach(response.data, function(value, key) {
- angular.forEach(value, function(subVal, key) {
- var newVal = { "id" : subVal[FIELD.ID.SERVICE_ID], "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION] };
- serviceIdList.push(newVal);
- });
- });
- successCallback(serviceIdList);
- } else {
- errorCallback(response);
- }
- },function(response) {
- errorCallback(response);
- });
- },
-
- getSubscriptionServiceTypeList : function(globalCustomerId,
- successCallbackFunction) {
- $log
- .debug("AaiService:getSubscriptionServiceTypeList: globalCustomerId: "
- + globalCustomerId);
- if ( UtilityService.hasContents(globalCustomerId) ) {
- $http.get(
- COMPONENT.AAI_SUB_DETAILS_PATH
- + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data && response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS]) {
- var serviceTypes = [];
- var serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION];
-
- for (var i = 0; i < serviceSubscriptions.length; i++) {
- serviceTypes.push(serviceSubscriptions[i][FIELD.ID.SERVICETYPE]);
- }
- successCallbackFunction(serviceTypes);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- }
- },
- getLcpCloudRegionTenantList : function(globalCustomerId, serviceType,
- successCallbackFunction) {
- $log
- .debug("AaiService:getLcpCloudRegionTenantList: globalCustomerId: "
- + globalCustomerId);
- var url = COMPONENT.AAI_GET_TENANTS
- + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- var lcpCloudRegionTenants = [];
- var aaiLcpCloudRegionTenants = response.data;
-
- lcpCloudRegionTenants.push({
- "cloudRegionId": "",
- "tenantName": FIELD.PROMPT.REGION,
- "tenantId": ""
- });
-
- for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
- lcpCloudRegionTenants.push({
- "cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
- "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
- "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID]
- });
- }
-
- successCallbackFunction(lcpCloudRegionTenants);
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getSubscribers : function(successCallbackFunction) {
- $log
- .debug("AaiService:getSubscribers");
- var url = FIELD.ID.AAI_GET_SUBSCRIBERS + COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response.data.customer);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getProvOptionsFromSystemProp : function(successCallbackFunction) {
- $log
- .debug("AaiService:getProvOptionsFromSystemProp");
- var url = COMPONENT.GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH;
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getLoggedInUserID : function(successCallbackFunction) {
- $log
- .debug("AaiService:getLoggedInUserID");
- var url = COMPONENT.GET_USER_ID;
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getServices : function(successCallbackFunction) {
- $log
- .debug("AaiService:getServices");
- var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getServiceModels : function(globalCustomerId,serviceType,successCallbackFunction) {
- $log
- .debug("AaiService:getServices");
- var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.FORWARD_SLASH+globalCustomerId+ COMPONENT.FORWARD_SLASH +serviceType+COMPONENT.ASSIGN + Math.random();
+ getServices2: function (successCallback, errorCallback) {
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
-},
-getServiceModelsByServiceType : function(namedQueryId,globalCustomerId,serviceType,successCallbackFunction) {
- $log
- .debug("AaiService:getServiceModelsByServiceType");
- var url = COMPONENT.AAI_GET_SERVICES_BY_TYPE+COMPONENT.FORWARD_SLASH+namedQueryId+COMPONENT.FORWARD_SLASH+globalCustomerId+COMPONENT.FORWARD_SLASH +serviceType+COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- }
+ $http.get(FIELD.ID.AAI_GET_SERVICES, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var customerList = [];
+ if (response.data != null) {
+ var serviceIdList = [];
+ angular.forEach(response.data, function (value, key) {
+ angular.forEach(value, function (subVal, key) {
+ var newVal = {
+ "id": subVal[FIELD.ID.SERVICE_ID],
+ "description": subVal[FIELD.ID.SERVICE_DESCRIPTION],
+ "isPermitted" : subVal[FIELD.ID.IS_PERMITTED]
+
+ };
+ serviceIdList.push(newVal);
+ });
+ });
+ successCallback(serviceIdList);
+ } else {
+ errorCallback(response);
+ }
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
+
+ getSubscriptionServiceTypeList: function (globalCustomerId,
+ successCallbackFunction) {
+ $log
+ .debug("AaiService:getSubscriptionServiceTypeList: globalCustomerId: "
+ + globalCustomerId);
+ if (UtilityService.hasContents(globalCustomerId)) {
+ $http.get(
+ COMPONENT.AAI_SUB_DETAILS_PATH
+ + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data && response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS]) {
+ var serviceTypes = [];
+ var serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION];
+
+ for (var i = 0; i < serviceSubscriptions.length; i++) {
+ serviceTypes.push({
+ "name": serviceSubscriptions[i][FIELD.ID.SERVICETYPE],
+ "isPermitted": serviceSubscriptions[i][FIELD.ID.IS_PERMITTED],
+ "id": i
+ });
+ }
+ successCallbackFunction(serviceTypes);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ }
+ },
+ getLcpCloudRegionTenantList: function (globalCustomerId, serviceType,
+ successCallbackFunction) {
+ $log
+ .debug("AaiService:getLcpCloudRegionTenantList: globalCustomerId: "
+ + globalCustomerId);
+ var url = COMPONENT.AAI_GET_TENANTS
+ + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var lcpCloudRegionTenants = [];
+ var aaiLcpCloudRegionTenants = response.data;
+
+ lcpCloudRegionTenants.push({
+ "cloudRegionId": "",
+ "tenantName": FIELD.PROMPT.REGION,
+ "tenantId": ""
+ });
+
+ for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
+ lcpCloudRegionTenants.push({
+ "cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
+ "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
+ "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID],
+ "isPermitted": aaiLcpCloudRegionTenants[i][COMPONENT.IS_PERMITTED]
+ });
+ }
+
+ successCallbackFunction(lcpCloudRegionTenants);
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getSubscribers: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getSubscribers");
+ var url = FIELD.ID.AAI_GET_SUBSCRIBERS + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response.data.customer);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getProvOptionsFromSystemProp: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getProvOptionsFromSystemProp");
+ var url = COMPONENT.GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH;
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getLoggedInUserID: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getLoggedInUserID");
+ var url = COMPONENT.GET_USER_ID;
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getServices: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getServices");
+ var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+
+ getAicZones: function (successCallbackFunction) {
+ $log
+ .debug("getAicZones:getAicZones");
+ var url = COMPONENT.AAI_GET_AIC_ZONES + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getServiceModels: function (globalCustomerId, serviceType, successCallbackFunction) {
+ $log
+ .debug("AaiService:getServices");
+ var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.FORWARD_SLASH + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getServiceModelsByServiceType: function (namedQueryId, globalCustomerId, serviceType, successCallbackFunction) {
+ $log
+ .debug("AaiService:getServiceModelsByServiceType");
+ var url = COMPONENT.AAI_GET_SERVICES_BY_TYPE + COMPONENT.FORWARD_SLASH + namedQueryId + COMPONENT.FORWARD_SLASH + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ }
}
}
-appDS2.factory("AaiService", [ "$http", "$log", "PropertyService",
- "UtilityService", "COMPONENT", "FIELD", AaiService ]);
+appDS2.factory("AaiService", ["$http", "$log", "PropertyService",
+ "UtilityService", "COMPONENT", "FIELD", AaiService]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js index 391c6ba1..ea46dcb9 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js @@ -30,7 +30,9 @@ var ComponentService = function($log, COMPONENT, UtilityService) { }, {
id : COMPONENT.SERVICE,
displayName : "Service Instance"
- }, {
+ }, {id : COMPONENT.OLDVERSION,
+ displayName : "Previous Version"
+ }, {
id : COMPONENT.VNF,
displayName : "Virtual Network Function"
}, {
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 11e61b3a..9309ce6c 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 @@ -39,7 +39,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON getLoggedInUserID();
switch (_this.componentId) {
case COMPONENT.SERVICE:
- return [ getSubscribers, getServices ];
+ return [ getSubscribers, getServices,getAicZones ];
case COMPONENT.NETWORK:
return [ getLcpCloudRegionTenantList ];
case COMPONENT.VNF:
@@ -121,6 +121,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
.getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
+ if (DataService.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE] != "null") {
+ addToList(FIELD.NAME.SERVICE_TYPE, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE]);
+ addToList(FIELD.NAME.SERVICE_ROLE, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_ROLE]);
+ }
+
break;
case COMPONENT.VF_MODULE:
addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
@@ -209,14 +216,18 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON if(!isInTop){
if (isUserProvidedNaming) {
parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-
+
}
parameterList = parameterList.concat([ getSubscribersParameter() ]);
parameterList = parameterList.concat([ getServiceId(),
FIELD.PARAMETER.SERVICE_TYPE,
FIELD.PARAMETER.LCP_REGION,
FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
+ FIELD.PARAMETER.TENANT_DISABLED,
+ ]);
+ parameterList = parameterList.concat([ getAICZones() ]);
+
+
}else{
parameterList = parameterList.concat([ getServiceId(),
FIELD.PARAMETER.LCP_REGION,
@@ -263,23 +274,27 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }
parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
if(_this.componentId === COMPONENT.VF_MODULE ){
- parameterList.push({name: "SDN-C Pre-Load",
- id: "sdncPreload",
+ if(DataService.getSubscriberName() === FIELD.NAME.MOBILITY){
+ parameterList.push({name: FIELD.NAME.SDN_C_PRELOAD,
+ id: FIELD.ID.SDN_C_PRELOAD,
type: "checkbox",
isEnabled: true,
- isRequired: false
+ isRequired: false,
+ hideFieldAndLabel: true
}
);
- parameterList.push({name: "Upload Supplementory Data file",
- id: "uploadSupplementoryDataFile",
+ }
+ parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
type: "checkbox",
isEnabled: true,
- isRequired: false
+ isRequired: false,
+ value:false
}
);
- parameterList.push({name: "Supplemetory file (JSON format)",
- id: "supplementoryDataFile",
+ parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
type: "file",
isRequired: false,
isVisiblity: false
@@ -288,16 +303,16 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }
if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED && _this.componentId === COMPONENT.VOLUME_GROUP){
- parameterList.push({name: "Upload Supplementory Data file",
- id: "uploadSupplementoryDataFile",
+ parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
type: "checkbox",
isEnabled: true,
isRequired: false
}
);
- parameterList.push({name: "Supplemetory file (JSON format)",
- id: "supplementoryDataFile",
+ parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
type: "file",
isRequired: false,
isVisiblity: false
@@ -584,7 +599,12 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON break;
case COMPONENT.VF_MODULE:
- break;
+ requestDetails.requestParameters.usePreload = getValueFromList(
+ FIELD.ID.SDN_C_PRELOAD, parameterList);
+ if(_this.componentId == COMPONENT.VF_MODULE &&(requestDetails.requestParameters.usePreload== null || requestDetails.requestParameters.usePreload === '')){
+ requestDetails.requestParameters.usePreload = true;
+ }
+ break;
case COMPONENT.VOLUME_GROUP:
break;
}
@@ -716,12 +736,24 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON break;
case FIELD.ID.SUBSCRIBER_NAME:
break;
+ case FIELD.ID.SDN_C_PRELOAD:
+ break;
+ case FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE:
+ break;
+ case FIELD.ID.SUPPLEMENTORY_DATA_FILE:
+ arbitraryParameters = FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'];
+ arbitraryArray=arbitraryParameters;
+ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=[];
+ break;
+
default:
- arbitraryParameters = {
- name : parameter.id,
- value : parameter.value
+ if (parameter.value != '') {
+ arbitraryParameters = {
+ name: parameter.id,
+ value: parameter.value
+ }
+ arbitraryArray.push(arbitraryParameters);
}
- arbitraryArray.push(arbitraryParameters);
}
}
return (arbitraryArray);
@@ -766,15 +798,40 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON var serviceIdList = [];
angular.forEach(response.data, function(value, key) {
angular.forEach(value, function(subVal, key) {
- var newVal = { "id" : subVal[FIELD.ID.SERVICE_ID], "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION] };
+ var newVal = {
+ "id" : subVal[FIELD.ID.SERVICE_ID],
+ "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION],
+ "isPermitted" : subVal[FIELD.ID.IS_PERMITTED],
+ };
serviceIdList.push(newVal);
DataService.setServiceIdList(serviceIdList);
});
});
-
+
UtilityService.startNextAsyncOperation();
});
};
+ var getAicZones = function() {
+ AaiService.getAicZones(function(response) {
+ var serviceIdList = [];
+ angular.forEach(response.data, function(value, key) {
+ angular.forEach(value, function(subVal, key) {
+ var newVal = {
+ "id" : subVal[FIELD.ID.ZONE_ID],
+ "name" : subVal[FIELD.ID.ZONE_NAME],
+ };
+ serviceIdList.push(newVal);
+ DataService.setAicZones(serviceIdList);
+ });
+ });
+
+ UtilityService.startNextAsyncOperation();
+ });
+
+ };
+
+
+
var getLcpCloudRegionTenantList = function() {
AaiService.getLcpCloudRegionTenantList(DataService
.getGlobalCustomerId(), DataService.getServiceType(), function(
@@ -802,7 +859,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < subscribers.length; i++) {
parameter.optionList.push({
id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
- name : subscribers[i][FIELD.ID.SUBNAME]
+ name : subscribers[i][FIELD.ID.SUBNAME],
+ isPermitted : subscribers[i][FIELD.ID.IS_PERMITTED]
})
}
}
@@ -819,7 +877,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < serviceIdList.length; i++) {
parameter.optionList.push({
id : serviceIdList[i].id,
- name : serviceIdList[i].description
+ name : serviceIdList[i].description,
+ isPermitted : serviceIdList[i].isPermitted
});
}
}
@@ -827,6 +886,26 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON return parameter;
};
+ var getAICZones = function() {
+ var aicList = DataService.getAicZones();
+ var parameter = FIELD.PARAMETER.AIC_ZONES;
+ parameter.optionList = new Array();
+ if ( UtilityService.hasContents(aicList) ) {
+ // load them all
+ for (var i = 0; i < aicList.length; i++) {
+ parameter.optionList.push({
+ id : aicList[i].id,
+ name : aicList[i].name,
+ isPermitted : true
+
+ });
+ }
+ }
+
+ return parameter;
+ };
+
+
var getLcpRegion = function() {
var cloudRegionTenantList = DataService.getCloudRegionTenantList();
console.log ( "cloudRegionTenantList=");
@@ -838,14 +917,17 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < cloudRegionTenantList.length; i++) {
for (var j = 0; j < parameter.optionList.length; j++) {
if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
- break;
- }
+ parameter.optionList[j].isPermitted =
+ parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+ break;
+ }
}
if (j < parameter.optionList.length) {
continue;
}
parameter.optionList.push({
- id : cloudRegionTenantList[i].cloudRegionId
+ id : cloudRegionTenantList[i].cloudRegionId,
+ isPermitted : cloudRegionTenantList[i].isPermitted
});
}
}
@@ -862,8 +944,10 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
parameter.optionList.push({
id : cloudRegionTenantList[i].tenantId,
- name : cloudRegionTenantList[i].tenantName
- });
+ name : cloudRegionTenantList[i].tenantName,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+
+ });
}
}
}
@@ -878,7 +962,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }
for (var i = 0; i < optionSimpleArray.length; i++) {
optionList.push({
- name : optionSimpleArray[i]
+ name : optionSimpleArray[i],
+ isPermitted :true,
});
}
parameter.optionList = optionList;
@@ -918,6 +1003,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
}else{
$('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
+ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=false;
parameterListControl
.updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
}
@@ -959,9 +1045,11 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < response.length; i++) {
serviceTypeParameters.optionList.push({
- "id" : response[i],
- "name" : response[i]
- });
+ "id" : response[i].name,
+ "name" : response[i].name,
+ "isPermitted" :response[i].isPermitted
+
+ });
}
console.log ( "updateUserParameterList: service type parameters " );
console.log ( JSON.stringify (serviceTypeParameters, null, 4));
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 bb5adad3..2d7fa6ca 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 @@ -94,6 +94,12 @@ var DataService = function($log, DataService) { setServiceIdList : function(serviceIdList) {
_this.serviceIdList = serviceIdList;
},
+ setAicZones : function(aicZones) {
+ _this.aicZones = aicZones;
+ },
+ getAicZones : function(){
+ return _this.aicZones;
+ },
getServiceInstanceId : function() {
return _this.serviceInstanceId;
},
@@ -249,6 +255,15 @@ var DataService = function($log, DataService) { }
return _this.aLaCarte;
},
+ setMacro : function(aval) {
+ _this.macro = aval;
+ },
+ getMacro : function() {
+ if (_this.macro === undefined) {
+ return false;
+ }
+ return _this.macro;
+ },
getResources : function() {
return _this.resources;
},
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js index 62c2b19c..79282997 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js @@ -380,15 +380,19 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, for (var i = 0; i < cloudRegionTenantList.length; i++) {
for (var j = 0; j < parameter.optionList.length; j++) {
if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
- break;
+ parameter.optionList[j].isPermitted =
+ parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+ break;
}
}
if (j < parameter.optionList.length) {
continue;
}
parameter.optionList.push({
- id : cloudRegionTenantList[i].cloudRegionId
- });
+ id : cloudRegionTenantList[i].cloudRegionId,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+
+ });
}
}
return parameter;
@@ -404,8 +408,9 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
parameter.optionList.push({
id : cloudRegionTenantList[i].tenantId,
- name : cloudRegionTenantList[i].tenantName
- });
+ name : cloudRegionTenantList[i].tenantName,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+ });
}
}
}
@@ -465,8 +470,8 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, for (var i = 0; i < response.length; i++) {
serviceTypeParameters.optionList.push({
- "id" : response[i],
- "name" : response[i]
+ "id" : response[i].name,
+ "name" : response[i].name
});
}
parameterListControl.updateList([ serviceTypeParameters ]);
@@ -493,7 +498,8 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, },
updateUserParameterList : updateUserParameterList,
getMsoRequestDetails : getMsoRequestDetails,
- getMsoUrl : getMsoUrl
+ getMsoUrl : getMsoUrl,
+ isMacro : DataService.getMacro()
}
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js index 836279b9..3fc04ba0 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js @@ -41,21 +41,42 @@ var VnfService = function($http, $log, VIDCONFIGURATION, FIELD, UtilityService) if ( ( UtilityService.hasContents ( vnfInstance.object[FIELD.ID.ORCHESTRATION_STATUS] ) ) &&
( UtilityService.hasContents ( vnfInstance.object[FIELD.ID.IN_MAINT] ) ) &&
( UtilityService.hasContents ( vnfInstance.object[FIELD.ID.PROV_STATUS] ) ) ) {
-
+
status.provStatus = vnfInstance.object[FIELD.ID.PROV_STATUS].toLowerCase();
+ console.log ("PROVSTATUS: " + vnfInstance.object[FIELD.ID.PROV_STATUS].toLowerCase());
+
status.orchestrationStatus = vnfInstance.object[FIELD.ID.ORCHESTRATION_STATUS].toLowerCase();
+ console.log ("ORCHESTRATION STATUS: " + vnfInstance.object[FIELD.ID.ORCHESTRATION_STATUS].toLowerCase());
+
status.inMaint = vnfInstance.object[FIELD.ID.IN_MAINT];
-
+ console.log ("IN MAINT: " + vnfInstance.object[FIELD.ID.IN_MAINT]);
+
if ( UtilityService.hasContents(vnfInstance.object[FIELD.ID.OPERATIONAL_STATUS]) ) {
status.operationalStatus = vnfInstance.object[FIELD.ID.OPERATIONAL_STATUS].toLowerCase();
}
-
- if ( UtilityService.arrayContains ( VIDCONFIGURATION.VNF_VALID_STATUS_LIST, status ) ) {
- return ("");
- }
- else {
- return (errorInvalidCombinationMsg);
- }
+ var i = VIDCONFIGURATION.VNF_VALID_STATUS_LIST.length;
+ if ( i > 0 ) {
+ while (i--) {
+ var item = VIDCONFIGURATION.VNF_VALID_STATUS_LIST[i];
+ if ( (item.provStatus === status.provStatus) && (item.inMaint === status.inMaint )
+ && (item.orchestrationStatus === status.orchestrationStatus) ) {
+ if (UtilityService.hasContents(vnfInstance.object[FIELD.ID.OPERATIONAL_STATUS])) {
+ if (status.operationalStatus === "") { status.operationalStatus = null }
+ if ( item.operationalStatus === status.operationalStatus ) {
+ return ("");
+ }
+ }
+ else {
+ // no contents
+ if ( item.operationalStatus === null ) {
+ return ("");
+ }
+ }
+ }
+ }
+ }
+
+ return (errorInvalidCombinationMsg);
}
else {
return (errorAaiStatusMsg);
|