diff options
author | Ofir Sonsino <os0695@att.com> | 2018-01-31 17:19:00 +0200 |
---|---|---|
committer | Ofir Sonsino <os0695@att.com> | 2018-01-31 17:19:00 +0200 |
commit | 1cfb08779ea0e00be69e072a940b3063e049fe6b (patch) | |
tree | 6602a900387c8393ed0dcd81c0539381632903c6 /vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js | |
parent | 2f20b001b9243e0f8b44aecc768ec265fd538732 (diff) |
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d
Issue-ID: VID-86
Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js')
-rw-r--r-- | vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js | 93 |
1 files changed, 18 insertions, 75 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js index 83cc4ddac..cd0c45e7d 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js @@ -22,81 +22,24 @@ var SchedulerService = function($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) { return { - - getStatusSchedulerId : function(schedulerInfo,successCallbackFunction) { - $log - .debug("SchedulerService:getSchedulerStatusAndSchedulerId"); - var url = COMPONENT.POST_CREATE_NEW_VNF_CHANGE+COMPONENT.ASSIGN + Math.random(); - - $http.post(url, schedulerInfo, - { - timeout : PropertyService - .getServerResponseTimeoutMsec() - }).then(function(response) { - if (response.data) { - successCallbackFunction(response); - } else { - successCallbackFunction([]); - } - })["catch"] - (UtilityService.runHttpErrorHandler); - }, - - getTimeSotsForSchedulerId:function(schedulerID,successCallbackFunction){ - $log - .debug("SchedulerService:getTimeSlotsForSchedulerID"); - var url = COMPONENT.GET_TIME_SLOTS+COMPONENT.FORWARD_SLASH +schedulerID+COMPONENT.ASSIGN; - - $http.get(url, - { - timeout : PropertyService - .getServerResponseTimeoutMsec() - }).then(function(response) { - if (response.data) { - successCallbackFunction(response); - } else { - successCallbackFunction([]); - } - })["catch"] - - (UtilityService.runHttpErrorHandler); - }, - getSubmitForapprovedTimeslots: function(ApprovedTimeSlotsObj,successCallbackFunction) { - $log - .debug("SchedulerService:getSchedulerStatusAndSchedulerId"); - var url = COMPONENT.SUBMIT_VNF_CHANGE_TIMESLOTS+COMPONENT.ASSIGN + Math.random(); - - $http.post(url, ApprovedTimeSlotsObj, - { - timeout : PropertyService - .getServerResponseTimeoutMsec() - }).then(function(response) { - if (response.data) { - successCallbackFunction(response); - } else { - successCallbackFunction([]); - } - })["catch"] - (UtilityService.runHttpErrorHandler); - }, - getPolicyInfo:function(policyName,successCallbackFunction){ - $log - .debug("SchedulerService:getPolicyInfo"); - var url = COMPONENT.GET_POLICY +COMPONENT.ASSIGN + Math.random(); - - $http.post(url, policyName, - { - timeout : PropertyService - .getServerResponseTimeoutMsec() - }).then(function(response) { - if (response.data) { - successCallbackFunction(response); - } else { - successCallbackFunction([]); - } - })["catch"] - (UtilityService.runHttpErrorHandler); - } + cancelScheduleRequest: function(schedulerID, successCallbackFunction, errorCallbackFunction) { + $log.debug("SchedulerService:cancelPendingBySchedulerId"); + var url = COMPONENT.CANCEL_SCHEDULE_REQUEST + COMPONENT.FORWARD_SLASH + schedulerID + COMPONENT.ASSIGN; + + $http.delete(url, + { + timeout : PropertyService + .getServerResponseTimeoutMsec() + }).then(function(response) { + if (response.data) { + successCallbackFunction(response); + } else { + successCallbackFunction([]); + } + }).catch(function(error) { + errorCallbackFunction(error); + }); + } } } |