c595c71afc820994e35512a8eecd98edb8667b56
[portal.git] / ecomp-portal-FE-common / client / app / services / applications / applications.service.js
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * 
37  */
38 'use strict';
39
40 (function () {
41     class ApplicationsService {
42         constructor($q, $log, $http, conf, uuid, utilsService) {
43             this.$q = $q;
44             this.$log = $log;
45             this.$http = $http;
46             this.conf = conf;
47             this.uuid = uuid;
48             this.utilsService = utilsService
49         }
50         
51         getSingleAppInfo(appName) {
52             let deferred = this.$q.defer();
53             var _this12 = this;
54             this.$http.get(this.conf.api.singleAppInfo,
55                 {
56                     cache: false,
57                     params:{'appParam':appName},
58                     headers: {
59                         'X-ECOMP-RequestID':this.uuid.generate()
60                     }
61                 })
62                 .then( res => {
63                     // If response comes back as a redirected HTML page which IS NOT a success
64                         // But don't declare an empty list to be an error.
65                     if (res == null || res.data == null || _this12.utilsService.isValidJSON(res.data) == false) {
66                         deferred.reject("ApplicationsService::getSingleAppInfo Failed");
67                     } else {
68                         deferred.resolve(res.data);
69                     }
70                 })
71                 .catch( status => {
72                     deferred.reject(status);
73                 });
74             return deferred.promise;
75         }
76         
77         getSingleAppInfoById(appId) {
78             let deferred = this.$q.defer();
79             var _this14 = this;
80             this.$http.get(this.conf.api.singleAppInfoById,
81                 {
82                     cache: false,
83                     params:{'appParam':appId},
84                     headers: {
85                         'X-ECOMP-RequestID':this.uuid.generate()
86                     }
87                 })
88                 .then( res => {
89                     // If response comes back as a redirected HTML page which IS NOT a success
90                         // But don't declare an empty list to be an error.
91                     if (res == null || res.data == null || _this14.utilsService.isValidJSON(res.data) == false) {
92                         deferred.reject("ApplicationsService::getSingleAppInfoById Failed");
93                     } else {
94                         deferred.resolve(res.data);
95                     }
96                 })
97                 .catch( status => {
98                     deferred.reject(status);
99                 });
100             return deferred.promise;
101         }
102         
103         getPersUserApps() {
104             let deferred = this.$q.defer();
105             var _this0 = this;
106             // this.$log.info('ApplicationsService::getPersUserApps');
107             this.$http.get(this.conf.api.persUserApps,
108                 {
109                     cache: false,
110                     headers: {
111                         'X-ECOMP-RequestID':this.uuid.generate()
112                     }
113                 })
114                 .then( res => {
115                     // If response comes back as a redirected HTML page which IS NOT a success
116                         // But don't declare an empty list to be an error.
117                     if (res == null || res.data == null || _this0.utilsService.isValidJSON(res.data) == false) {
118                         deferred.reject("ApplicationsService::getPersUserApps Failed");
119                     } else {
120                         deferred.resolve(res.data);
121                     }
122                 })
123                 .catch( status => {
124                     deferred.reject(status);
125                 });
126             return deferred.promise;
127         }
128         
129         getAppsOrderBySortPref(userAppSortTypePref) {
130             let deferred = this.$q.defer();
131             var _this1 = this;
132             // this.$log.info('ApplicationsService::getAppsOrderBySortPref');
133             this.$http.get(this.conf.api.userAppsOrderBySortPref,
134                 {
135                     cache: false,
136                     params:{'mparams':userAppSortTypePref},
137                     headers: {
138                         'X-ECOMP-RequestID':this.uuid.generate()
139                     }
140                 })
141                 .then( res => {
142                     // If response comes back as a redirected HTML page which IS NOT a success
143                         // But don't declare an empty list to be an error.
144                     if (res == null || res.data == null || _this1.utilsService.isValidJSON(res.data)== false) {
145                         deferred.reject("ApplicationsService::getAppsOrderBySortPref Failed");
146                     } else {
147                         // this.$log.info('ApplicationsService::getAppsOrderBySortPref Succeeded');
148                         deferred.resolve(res.data);
149                     }
150                 })
151                 .catch( status => {
152                     deferred.reject(status);
153                 });
154
155             return deferred.promise;
156         }
157
158         saveAppsSortTypeManual(appsSortManual){
159             let deferred = this.$q.defer();
160             if (appsSortManual== undefined
161                                         || appsSortManual == null
162                                         || appsSortManual.length == 0) {
163                 this.$log.error('ApplicationsService::saveAppsSortTypeManual: Apps Sort Manual received empty string!'); 
164                 return deferred.reject('Apps Sort Manual received empty string ');
165             }
166             
167             this.$http({
168                 method: 'PUT',
169                 url: this.conf.api.saveUserAppsSortingManual,
170                 data: appsSortManual,
171                 cache: false,
172                 headers: {
173                     'X-ECOMP-RequestID':this.uuid.generate()
174                 }
175             }).then( res => {
176                     // If response comes back as a redirected HTML page which IS
177                                         // NOT a success
178                         // But don't declare an empty list to be an error.
179                     if (res == null || res.data == null) {
180                         deferred.reject("ApplicationsService::saveAppsSortTypeManual Failed");
181                     } else {
182                         // this.$log.info('ApplicationsService::saveAppsSortTypeManual
183                                                 // Succeeded');
184                         deferred.resolve(res.data);
185                     }
186                 })
187                 .catch( status => {
188                     deferred.reject(status);
189                 });
190             return deferred.promise;
191         }
192             
193         saveAppsSortTypePreference(appsSortPreference){
194             let deferred = this.$q.defer();
195             var _this2 = this;
196             if (appsSortPreference== undefined
197                                         || appsSortPreference == null
198                                         || appsSortPreference.length == 0){
199                 this.$log.error('ApplicationsService::saveAppsSortTypePreference: Apps Sort type Preference received empty string!'); 
200                          return deferred.reject('Apps Sort type Preference received empty string ');
201             }
202             this.$http({
203                 method: 'PUT',
204                 url: this.conf.api.saveUserAppsSortingPreference,
205                 data: appsSortPreference,
206                 cache: false,
207                 headers: {
208                     'X-ECOMP-RequestID':this.uuid.generate()
209                 }
210             }).then( res => {
211                     // If response comes back as a redirected HTML page which IS NOT a success
212                         // But don't declare an empty list to be an error.
213                     if (res == null || res.data == null || _this2.utilsService.isValidJSON(res) == false) {
214                         deferred.reject("ApplicationsService::saveAppsSortTypePreference Failed");
215                     } else {
216                         // this.$log.info('ApplicationsService::saveAppsSortTypePreference Succeeded');
217                         deferred.resolve(res.data);
218                     }
219                 })
220                 .catch( status => {
221                     deferred.reject(status);
222                 });
223             return deferred.promise;
224         }
225         
226         getUserAppsSortTypePreference() {
227                 let deferred = this.$q.defer();
228                 var _this3 = this;
229                 this.$http({
230                         method: "GET",
231                         url: this.conf.api.userAppsSortTypePreference,
232                         cache: false,
233                         headers: {
234                             'X-ECOMP-RequestID':this.uuid.generate()
235                         }
236                     })
237                     .then( res => {
238                         if (res == null || res.data == null || _this3.utilsService.isValidJSON(res) == false) {  
239                                 deferred.reject("ApplicationsService::getSortTypePreference Failed");
240                         } else {
241                             // this.$log.info('ApplicationsService::getUserAppsSortTypePreference Succeeded');
242                             deferred.resolve(res.data);
243                         }
244                     })
245                     .catch( status => {
246                         deferred.reject(status);
247                     });
248                         return deferred.promise;
249         }
250         
251         saveWidgetsSortManual(widgetsSortManual){
252             let deferred = this.$q.defer();
253             var _this4 = this;
254             if (widgetsSortManual== undefined
255                                         || widgetsSortManual == null
256                                         || widgetsSortManual.length == 0){
257                 this.$log.error('ApplicationsService::saveWidgetsSortManual: Widegts Sort type Preference received empty string!'); 
258                          return deferred.reject('Widgets Sort Manual received empty string ');
259             }
260             this.$http({
261                 method: 'PUT',
262                 url: this.conf.api.saveUserWidgetsSortManual,
263                 data: widgetsSortManual,
264                 cache: false,
265                 headers: {
266                     'X-ECOMP-RequestID':this.uuid.generate()
267                 }
268             }).then( res => {
269                     if (res == null || res.data == null || _this4.utilsService.isValidJSON(res) == false) {
270                         deferred.reject("ApplicationsService::saveWidgetsSortManual Failed");
271                     } else {
272                         // this.$log.info('ApplicationsService::saveWidgetsSortManual
273                                                 // Succeeded');
274                         deferred.resolve(res.data);
275                     }
276                 })
277                 .catch( status => {
278                     deferred.reject(status);
279                 });
280             return deferred.promise;
281         }
282         
283         delWidgetsSortPref(widgetsData){
284             let deferred = this.$q.defer();
285             var _this5 = this;
286              
287             if (widgetsData== undefined
288                                         || widgetsData == null
289                                         || widgetsData.length == 0){
290                 this.$log.error('ApplicationsService::delWidgetsSortPref: While deleting, widgets  received empty string!'); 
291                 return deferred.reject('Widgets received empty string ');
292             }
293             
294             this.$http({
295                 method: 'PUT',
296                 url: this.conf.api.updateWidgetsSortPref,
297                 data: widgetsData,
298                 cache: false,
299                 headers: {
300                     'X-ECOMP-RequestID':this.uuid.generate()
301                 }
302             }).then( res => {
303                     if (res == null || res.data == null || _this5.utilsService.isValidJSON(res) == false) {
304                         deferred.reject("ApplicationsService::delWidgetsSortPref Failed");
305                     } else {
306                         // this.$log.info('ApplicationsService::delWidgetsSortPref
307                                                 // Succeeded');
308                         deferred.resolve(res.data);
309                     }
310                 })
311                 .catch( status => {
312                     deferred.reject(status);
313                 });
314             return deferred.promise;
315         }
316         
317         getAvailableApps() {
318             let deferred = this.$q.defer();
319             var _this6 = this;
320             // this.$log.info('ApplicationsService::getAvailableApps');
321             
322             this.$http(
323                 {
324                     method: "GET",
325                     url: this.conf.api.availableApps,
326                     cache: false,
327                     headers: {
328                         'X-ECOMP-RequestID':this.uuid.generate()
329                     }
330                 })
331                 .then( res => {
332                     if (res == null || res.data == null || _this6.utilsService.isValidJSON(res) == false) {
333                         deferred.reject("ApplicationsService::getAvailableApps Failed");
334                     } else {
335                         // this.$log.info('ApplicationsService::getAvailableApps Succeeded');
336                         deferred.resolve(res.data);
337                     }
338                 })
339                 .catch( status => {
340                     deferred.reject(status);
341                 });
342
343             return deferred.promise;
344         }
345
346         getAdminApps(){
347             var _this7 = this;
348             let canceller = this.$q.defer();
349             let isActive = false;
350
351             let cancel = () => {
352                 if(isActive){
353                     this.$log.debug('ApplicationsService::getAdminApps: canceling the request');
354                     canceller.resolve();
355                 }
356             };
357
358             let promise = () => {
359                 isActive = true;
360                 let deferred = this.$q.defer();
361                 // this.$log.info('ApplicationsService::getAdminApps: starting');
362                 this.$http({method: "GET",
363                         url: this.conf.api.adminApps,
364                         cache: false,
365                         timeout: canceller.promise,
366                         headers: {
367                             'X-ECOMP-RequestID':this.uuid.generate()
368                         }
369                     }).then(res => {
370                         isActive = false;
371                         if (res == null || res.data == null || _this7.utilsService.isValidJSON(res) == false) {
372                             deferred.reject("ApplicationsService::adminApps Failed");
373                         } else {
374                             // this.$log.info('ApplicationsService::adminApps Succeeded');
375                             deferred.resolve(res.data);
376                         }
377                     })
378                     .catch(status => {
379                         isActive = false;
380                         deferred.reject(status);
381                     });
382                 return deferred.promise;
383             };
384
385             return {
386                 cancel: cancel,
387                 promise: promise
388             };
389         }
390
391         getLeftMenuItems(){
392             let deferred = this.$q.defer();
393             var _this8 = this;
394             // this.$log.info('ApplicationsService::getAppsForSuperAdminAndAccountAdmin');
395             this.$http({method: "GET",
396                 url: this.conf.api.leftmenuItems,
397                 cache: false,
398                 headers: {
399                     'X-ECOMP-RequestID':this.uuid.generate()
400                 }
401             }).then(res => {
402                     // If response comes back as a redirected HTML page which IS NOT a success
403                         // But don't declare an empty list to be an error.
404                 this.$log.debug('getLeftMenuItems::getAdminApps: canceling the request',res);
405
406                     if (res == null || res.data == null || _this8.utilsService.isValidJSON(res) == false) {
407                         deferred.reject("ApplicationsService::getLeftMenuItems Failed");
408                     } else {
409                         // this.$log.info('ApplicationsService::getAppsForSuperAdminAndAccountAdmin Succeeded');
410                         deferred.resolve(res.data);
411                     }
412                 })
413                 .catch(status => {
414                     deferred.reject(status);
415                 });
416             return deferred.promise;
417         }
418         
419         getAppsForSuperAdminAndAccountAdmin(){
420             let deferred = this.$q.defer();
421             var _this9 = this;
422             // this.$log.info('ApplicationsService::getAppsForSuperAdminAndAccountAdmin');
423             this.$http({method: "GET",
424                 url: this.conf.api.appsForSuperAdminAndAccountAdmin,
425                 cache: false,
426                 headers: {
427                     'X-ECOMP-RequestID':this.uuid.generate()
428                 }
429             }).then(res => {
430                     // If response comes back as a redirected HTML page which IS NOT a success
431                         // But don't declare an empty list to be an error.
432                     if (res == null || res.data == null || _this9.utilsService.isValidJSON(res) == false) {
433                         deferred.reject("ApplicationsService::getAppsForSuperAdminAndAccountAdmin Failed");
434                     } else {
435                         // this.$log.info('ApplicationsService::getAppsForSuperAdminAndAccountAdmin Succeeded');
436                         deferred.resolve(res.data);
437                     }
438                 })
439                 .catch(status => {
440                     deferred.reject(status);
441                 });
442             return deferred.promise;
443         }
444
445         getAdminAppsSimpler(){
446                 let deferred = this.$q.defer();
447                 var _this10 = this;
448             // this.$log.info('ApplicationsService::getAdminAppsSimpler');
449                 this.$http({method: "GET",
450                         url: this.conf.api.adminApps,
451                         cache: false,
452                         headers: {
453                                 'X-ECOMP-RequestID':this.uuid.generate()
454                         }
455                 }).then(res => {
456                         // If response comes back as a redirected HTML page which IS NOT a success
457                         // But don't declare an empty list to be an error.
458                         if (res == null || res.data == null || _this10.utilsService.isValidJSON(res.data) == false) {
459                                 deferred.reject("ApplicationsService::getAdminAppsSimpler Failed");
460                         } else {
461                                 // this.$log.info('ApplicationsService::getAdminAppsSimpler Succeeded');
462                                 deferred.resolve(res.data);
463                         }
464                 })
465                 .catch(status => {
466                         deferred.reject(status);
467                 });
468                 return deferred.promise;
469         }
470
471         getOnboardingApps(){
472             let deferred = this.$q.defer();
473             var _this11 = this;
474             // this.$log.debug('applications-service::getOnboardingApps');
475             this.$http.get(this.conf.api.onboardingApps,
476                 {
477                     cache: false,
478                     headers: {
479                         'X-ECOMP-RequestID':this.uuid.generate()
480                     }
481                 })
482                 .then( res => {
483                     // If response comes back as a redirected HTML page which IS NOT a success
484                         // But don't declare an empty list to be an error.
485                     if (res == null || res.data == null || _this11.utilsService.isValidJSON(res.data) == false) {
486                         deferred.reject("ApplicationsService::getOnboardingApps Failed");
487                     } else {
488                         // this.$log.info('ApplicationsService::getOnboardingApps Succeeded');
489                         deferred.resolve(res.data);
490                     }
491                 })
492                 .catch( status => {
493                     deferred.reject(status);
494                 });
495
496             return deferred.promise;
497         }
498
499         addOnboardingApp(newApp){
500             let deferred = this.$q.defer();
501             // this.$log.debug('applications-service::addOnboardingApp with:', newApp);
502             this.$http({
503                 method: "POST",
504                 url: this.conf.api.onboardingApps,
505                 data: newApp,
506                 cache: false,
507                 headers: {
508                     'X-ECOMP-RequestID':this.uuid.generate()
509                 }
510             }).then( res => {
511                     // If response comes back as a redirected HTML page which IS NOT a success
512                         // But don't declare an empty list to be an error.
513                     if (res == null || res.data == null) {
514                         deferred.reject("ApplicationsService::addOnboardingApp Failed");
515                     } else {
516                         // this.$log.info('ApplicationsService::addOnboardingApp Succeeded');
517                         deferred.resolve(res.data);
518                     }
519                 })
520                 .catch( status => {
521                     deferred.reject(status);
522                 });
523             return deferred.promise;
524         }
525
526         updateOnboardingApp(appData){
527             let deferred = this.$q.defer();
528             // this.$log.info('ApplicationsService::addOnboardingApp');
529             if(!appData.id){
530                 this.$log.error('ApplicationsService::addOnboardingApp: App id not found!');
531                 return deferred.reject('App id not found');
532             }
533
534             this.$http({
535                 method: "PUT",
536                 url: this.conf.api.onboardingApps,
537                 data: appData,
538                 cache: false,
539                 headers: {
540                     'X-ECOMP-RequestID':this.uuid.generate()
541                 }
542             }).then( res => {
543                     // If response comes back as a redirected HTML page which IS NOT a success
544                         // But don't declare an empty list to be an error.
545                     if (res == null || res.data == null) {
546                         deferred.reject("ApplicationsService::updateOnboardingApp Failed");
547                     } else {
548                         // this.$log.info('ApplicationsService::updateOnboardingApp Succeeded');
549                         deferred.resolve(res.data);
550                     }
551                 })
552                 .catch( status => {
553                     deferred.reject(status);
554                 });
555             return deferred.promise;
556         }
557         
558         saveUserAppsRoles(UserAppRolesRequest) {
559                  let deferred = this.$q.defer();
560                  
561                 if (UserAppRolesRequest== undefined
562                                 || UserAppRolesRequest == null
563                                 || UserAppRolesRequest.length == 0){
564                 this.$log.error('ApplicationsService::saveAppsSortTypeManual: Apps Sort Manual received empty string!'); 
565                          return deferred.reject('Apps Sort Manual received empty string ');
566                         }
567                         // var manualAppsJson = angular.toJson(appsSortManual);
568       
569                     // console.log(manual_jsonData);
570                     this.$http({
571                         method: 'PUT',
572                         url: this.conf.api.saveUserAppRoles,
573                         data: UserAppRolesRequest,
574                         cache: false,
575                         headers: {
576                             'X-ECOMP-RequestID':this.uuid.generate()
577                         }
578                     }).then( res => {
579                             // If response comes back as a redirected HTML page which IS
580                                         // NOT a success
581                                 // But don't declare an empty list to be an error.
582                             if (res == null || res.data == null) {
583                                 deferred.reject("ApplicationsService::saveAppsSortTypeManual Failed");
584                             } else {
585                                 // this.$log.info('ApplicationsService::saveAppsSortTypeManual
586                                                 // Succeeded');
587                                 deferred.resolve(res.data);
588                             }
589                         })
590                         .catch( status => {
591                             deferred.reject(status);
592                         });
593                     return deferred.promise;
594
595         }
596          
597
598         deleteOnboardingApp(appId) {
599             let deferred = this.$q.defer();
600             let url = this.conf.api.onboardingApps + '/' + appId;
601             // this.$log.info('applications.service::deleteOnboardingApp' +appId);
602
603             this.$http({
604                 method: "DELETE",
605                 url: url,
606                 cache: false,
607                 data:'',
608                 headers: {
609                     'X-ECOMP-RequestID':this.uuid.generate()
610                 }
611             }).then(res => {
612                     // If response comes back as a redirected HTML page which IS NOT a success
613                         // But don't declare an empty list to be an error.
614                     if (res == null || res.data == null) {
615                         deferred.reject("applications.service::deleteOnboardingApp Failed");
616                     } else {
617                         // this.$log.info('applications.service::deleteOnboardingApp succeeded: ');
618                         deferred.resolve(res.data);
619                     }
620                 })
621                 .catch(errRes => {
622                     deferred.reject(errRes);
623                 });
624             return deferred.promise;
625         }
626         
627         syncRolesEcompFromExtAuthSystem(appId){
628                  let deferred = this.$q.defer();
629                  let url = this.conf.api.syncRolesFromExternalAuthSystem;
630              var _this13 = this; 
631                 this.$http({
632                 method: "POST",
633                 url: url,
634                 cache: false,
635                 data:appId,
636                 headers: {
637                     'X-ECOMP-RequestID':this.uuid.generate()
638                 }
639               }).then( res => {
640                      // If response comes back as a redirected HTML page which IS NOT a success
641                         // But don't declare an empty list to be an error.
642                      if (res == null || res.data == null || _this13.utilsService.isValidJSON(res.data) == false ||  res.data.status == 'ERROR') {
643                          deferred.reject("ApplicationsService::syncRolesEcompFromExtAuthSystem Failed"  + res.data.message);
644                      } else {
645                          deferred.resolve(res);
646                      }
647                  })
648                  .catch( status => {
649                      deferred.reject(status);
650                  });
651              return deferred.promise;
652         }
653         
654         syncFunctionsFromExternalAuthSystem(appId){
655                  let deferred = this.$q.defer();
656                  let url = this.conf.api.syncFunctionsFromExternalAuthSystem;
657                var _this13 = this; 
658                   this.$http({
659                   method: "POST",
660                   url: url,
661                   cache: false,
662                   data:appId,
663                   headers: {
664                       'X-ECOMP-RequestID':this.uuid.generate()
665                   }
666                 }).then( res => {
667                        // If response comes back as a redirected HTML page which IS NOT a success
668                         // But don't declare an empty list to be an error.
669                        if (res == null || res.data == null || _this13.utilsService.isValidJSON(res.data) == false) {
670                            deferred.reject("ApplicationsService::syncFunctionsFromExternalAuthSystem Failed");
671                        } else {
672                            deferred.resolve(res);
673                        }
674                    })
675                    .catch( status => {
676                        deferred.reject(status);
677                    });
678                return deferred.promise;
679           }
680
681         getTopMenuData(selectedApp) {
682             let deferred = this.$q.defer();
683             // this.$log.info('ApplicationsService:getTopMenuData');
684             this.$log.debug('ApplicationsService:getTopMenuData with:', selectedApp);
685         }
686
687         ping(){
688             let deferred = this.$q.defer();
689             // this.$log.info('ApplicationsService::ping: ');
690             this.$http.get(this.conf.api.ping,
691                 {
692                     cache: false,
693                     headers: {
694                         'X-ECOMP-RequestID':this.uuid.generate()
695                     }
696                 })
697                 .success( res => {
698                     // If response comes back as a redirected HTML page which IS NOT a success
699                     if (Object.keys(res).length == 0) {
700                         deferred.reject("ApplicationsService::ping: Failed");
701                     } else {
702                         // this.$log.info('ApplicationsService::ping: Succeeded');
703                         deferred.resolve(res);
704                     }
705                 })
706                 .error( status => {
707                     deferred.reject(status);
708                 });
709
710             return deferred.promise;
711         }
712     }
713     ApplicationsService.$inject = ['$q', '$log', '$http', 'conf','uuid4','utilsService'];
714     angular.module('ecompApp').service('applicationsService', ApplicationsService)
715 })();