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('FWDictionaryService', function ($http, $q) {
26 getActionListDictionaryData : function(url){
27 console.log("url on the service js: " + url);
28 var url = url+'/ecomp/get_ActionListData';
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 getAddressGroupDictionaryData: function(url) {
44 console.log("url on the service js: " + url);
45 var url = url+'/ecomp/get_AddressGroupData';
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 getParentListDictionaryData : function(url){
61 console.log("url on the service js: " + url);
62 var url = url+'/ecomp/get_FWDictionaryListData';
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 getPortListDictionaryData : function(url){
78 console.log("url on the service js: " + url);
79 var url = url+'/ecomp/get_PortListData';
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 getPrefixListDictionaryData : function(url){
96 console.log("url on the service js: " + url);
97 var url = url+'/ecomp/get_PrefixListData';
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);
113 getProtocolListDictionaryData : function(url){
114 console.log("url on the service js: " + url);
115 var url = url+'/ecomp/get_ProtocolListData';
116 return $http.get(url)
117 .then(function(response) {
118 if (typeof response.data === 'object') {
119 return response.data;
121 return $q.reject(response.data);
124 }, function(response) {
125 // something went wrong
126 return $q.reject(response.data);
131 getSecurityZoneDictionaryData : function(url){
132 console.log("url on the service js: " + url);
133 var url = url+'/ecomp/get_SecurityZoneData';
134 return $http.get(url)
135 .then(function(response) {
136 if (typeof response.data === 'object') {
137 return response.data;
139 return $q.reject(response.data);
142 }, function(response) {
143 // something went wrong
144 return $q.reject(response.data);
149 getServiceGroupDictionaryData : function(url){
150 console.log("url on the service js: " + url);
151 var url = url+'/ecomp/get_ServiceGroupData';
152 return $http.get(url)
153 .then(function(response) {
154 if (typeof response.data === 'object') {
155 return response.data;
157 return $q.reject(response.data);
160 }, function(response) {
161 // something went wrong
162 return $q.reject(response.data);
167 getServiceListDictionaryData : function(url){
168 console.log("url on the service js: " + url);
169 var url = url+'/ecomp/get_ServiceListData';
170 return $http.get(url)
171 .then(function(response) {
172 if (typeof response.data === 'object') {
173 return response.data;
175 return $q.reject(response.data);
178 }, function(response) {
179 // something went wrong
180 return $q.reject(response.data);
185 getTermListDictionaryData : function(url){
186 console.log("url on the service js: " + url);
187 var url = url+'/ecomp/get_TermListData';
188 return $http.get(url)
189 .then(function(response) {
190 if (typeof response.data === 'object') {
191 return response.data;
193 return $q.reject(response.data);
196 }, function(response) {
197 // something went wrong
198 return $q.reject(response.data);
203 getZoneDictionaryData : function(url){
204 console.log("url on the service js: " + url);
205 var url = url+'/ecomp/get_ZoneData';
206 return $http.get(url)
207 .then(function(response) {
208 if (typeof response.data === 'object') {
209 return response.data;
211 return $q.reject(response.data);
214 }, function(response) {
215 // something went wrong
216 return $q.reject(response.data);
220 getPrefixListDictionaryDataByName : function(url){
221 console.log("url on the service js: " + url);
222 var url = url+'/ecomp/get_PrefixListDataByName';
223 return $http.get(url)
224 .then(function(response) {
225 if (typeof response.data === 'object') {
226 return response.data;
228 return $q.reject(response.data);
231 }, function(response) {
232 // something went wrong
233 return $q.reject(response.data);
237 getProtocolListDictionaryDataByName : function(url){
238 console.log("url on the service js: " + url);
239 var url = url+'/ecomp/get_ProtocolListDataByName';
240 return $http.get(url)
241 .then(function(response) {
242 if (typeof response.data === 'object') {
243 return response.data;
245 return $q.reject(response.data);
248 }, function(response) {
249 // something went wrong
250 return $q.reject(response.data);
254 getZoneDictionaryDataByName : function(url){
255 console.log("url on the service js: " + url);
256 var url = url+'/ecomp/get_ZoneDictionaryDataByName';
257 return $http.get(url)
258 .then(function(response) {
259 if (typeof response.data === 'object') {
260 return response.data;
262 return $q.reject(response.data);
265 }, function(response) {
266 // something went wrong
267 return $q.reject(response.data);
271 getAddressGroupDictionaryDataByName : function(url){
272 console.log("url on the service js: " + url);
273 var url = url+'/ecomp/get_AddressGroupDictionaryDataByName';
274 return $http.get(url)
275 .then(function(response) {
276 if (typeof response.data === 'object') {
277 return response.data;
279 return $q.reject(response.data);
282 }, function(response) {
283 // something went wrong
284 return $q.reject(response.data);
288 getServiceListDictionaryDataByName : function(url){
289 console.log("url on the service js: " + url);
290 var url = url+'/ecomp/get_ServiceListDictionaryDataByName';
291 return $http.get(url)
292 .then(function(response) {
293 if (typeof response.data === 'object') {
294 return response.data;
296 return $q.reject(response.data);
299 }, function(response) {
300 // something went wrong
301 return $q.reject(response.data);
305 getServiceGroupDictionaryDataByName : function(url){
306 console.log("url on the service js: " + url);
307 var url = url+'/ecomp/get_ServiceGroupDictionaryDataByName';
308 return $http.get(url)
309 .then(function(response) {
310 if (typeof response.data === 'object') {
311 return response.data;
313 return $q.reject(response.data);
316 }, function(response) {
317 // something went wrong
318 return $q.reject(response.data);
322 getActionListDictionaryDataByName : function(url){
323 console.log("url on the service js: " + url);
324 var url = url+'/ecomp/get_ActionListDictionaryDataByName';
325 return $http.get(url)
326 .then(function(response) {
327 if (typeof response.data === 'object') {
328 return response.data;
330 return $q.reject(response.data);
333 }, function(response) {
334 // something went wrong
335 return $q.reject(response.data);