2 * ================================================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ================================================================================
\r
21 * Created by mlittle on 9/9/2016.
\r
26 class ManifestService {
\r
27 constructor($q, $log, $http, conf, uuid, utilsService) {
\r
33 this.utilsService = utilsService;
\r
37 let deferred = this.$q.defer();
\r
40 url: this.conf.api.getManifest,
\r
43 'X-ECOMP-RequestID':this.uuid.generate()
\r
46 if (this.utilsService.isValidJSON(res)== false) {
\r
47 this.$log.error('ManifestService.getManifest failed: ');
\r
48 deferred.reject('ManifestService.getManifest: response.data null or not object');
\r
50 // this.$log.info('ManifestService.getManifest Succeeded');
\r
51 // this.$log.debug('ManifestService.getManifest: ', JSON.stringify(res))
\r
52 deferred.resolve(res.data);
\r
54 }).catch( status => {
\r
55 this.$log.error('ManifestService.getManifest failed: ' + status.data);
\r
56 deferred.reject(status);
\r
58 return deferred.promise;
\r
62 ManifestService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4', 'utilsService'];
\r
63 angular.module('ecompApp').service('manifestService', ManifestService)
\r