2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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 * ============LICENSE_END=========================================================
23 app.factory('PolicyScopeService', function ($http, $q) {
26 getPSClosedLoopDictionaryData : function(url){
27 console.log("url on the service js: " + url);
28 var url = url+'/ecomp/get_PSClosedLoopData';
30 .then(function(response) {
31 if (typeof response.data === 'object') {
34 return $q.reject(response.data);
37 }, function(response) {
38 // something went wrong
39 return $q.reject(response.data);
43 getPSClosedLoopDictionaryDataByName : function(url){
44 console.log("url on the service js: " + url);
45 var url = url+'/ecomp/get_PSClosedLoopDataByName';
47 .then(function(response) {
48 if (typeof response.data === 'object') {
51 return $q.reject(response.data);
54 }, function(response) {
55 // something went wrong
56 return $q.reject(response.data);
60 getPSServiceDictionaryData: function(url) {
61 console.log("url on the service js: " + url);
62 var url = url+'/ecomp/get_PSServiceData';
64 .then(function(response) {
65 if (typeof response.data === 'object') {
68 return $q.reject(response.data);
71 }, function(response) {
72 // something went wrong
73 return $q.reject(response.data);
77 getPSServiceDictionaryDataByName: function(url) {
78 console.log("url on the service js: " + url);
79 var url = url+'/ecomp/get_PSServiceDataByName';
81 .then(function(response) {
82 if (typeof response.data === 'object') {
85 return $q.reject(response.data);
88 }, function(response) {
89 // something went wrong
90 return $q.reject(response.data);
95 getPSTypeDictionaryData : function(url){
96 console.log("url on the service js: " + url);
97 var url = url+'/ecomp/get_PSTypeData';
99 .then(function(response) {
100 if (typeof response.data === 'object') {
101 return response.data;
103 return $q.reject(response.data);
106 }, function(response) {
107 // something went wrong
108 return $q.reject(response.data);
112 getPSTypeDictionaryDataByName : function(url){
113 console.log("url on the service js: " + url);
114 var url = url+'/ecomp/get_PSTypeDataByName';
115 return $http.get(url)
116 .then(function(response) {
117 if (typeof response.data === 'object') {
118 return response.data;
120 return $q.reject(response.data);
123 }, function(response) {
124 // something went wrong
125 return $q.reject(response.data);
130 getPSResourceDictionaryData : function(url){
131 console.log("url on the service js: " + url);
132 var url = url+'/ecomp/get_PSResourceData';
133 return $http.get(url)
134 .then(function(response) {
135 if (typeof response.data === 'object') {
136 return response.data;
138 return $q.reject(response.data);
141 }, function(response) {
142 // something went wrong
143 return $q.reject(response.data);
147 getPSResourceDictionaryDataByName : function(url){
148 console.log("url on the service js: " + url);
149 var url = url+'/ecomp/get_PSResourceDataByName';
150 return $http.get(url)
151 .then(function(response) {
152 if (typeof response.data === 'object') {
153 return response.data;
155 return $q.reject(response.data);
158 }, function(response) {
159 // something went wrong
160 return $q.reject(response.data);
165 getPSGroupPolicyScopeDictionaryData : function(url){
166 console.log("url on the service js: " + url);
167 var url = url+'/ecomp/get_GroupPolicyScopeData';
168 return $http.get(url)
169 .then(function(response) {
170 if (typeof response.data === 'object') {
171 return response.data;
173 return $q.reject(response.data);
176 }, function(response) {
177 // something went wrong
178 return $q.reject(response.data);