2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
23 class ExternalRequestAccessService {
24 constructor($q, $log, $http, conf, uuid, utilsService) {
30 this.utilsService = utilsService;
33 getExternalRequestAccessServiceInfo() {
34 let deferred = this.$q.defer();
36 let url = this.conf.api.externalRequestAccessSystem;
42 'X-ECOMP-RequestID':this.uuid.generate()
46 if (res == null || res.data == null || _this.utilsService.isValidJSON(res.data) == false) {
47 deferred.reject("ExternalRequestAccessService::getExternalRequestAccessServiceInfo Failed");
49 deferred.resolve(res.data);
53 this.$log.error('ExternalRequestAccessService::getExternalRequestAccessServiceInfo Failed', status);
54 deferred.reject(status);
57 return deferred.promise;
61 ExternalRequestAccessService.$inject = ['$q', '$log', '$http', 'conf','uuid4', 'utilsService'];
62 angular.module('ecompApp').service('ExternalRequestAccessService', ExternalRequestAccessService)