Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / app / policyApp / service / Dictionary / FWDictionaryService.js
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP Policy Engine
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 /**
22  */
23 app.factory('FWDictionaryService', function ($http, $q) {
24     return {
25
26         getActionListDictionaryData : function(url){
27                         console.log("url on the service js: " + url);
28                         var url = url+'/ecomp/get_ActionListData';
29             return $http.get(url)
30                 .then(function(response) {
31                     if (typeof response.data === 'object') {
32                         return response.data;
33                     } else {
34                         return $q.reject(response.data);
35                     }
36
37                 }, function(response) {
38                     // something went wrong
39                     return $q.reject(response.data);
40                 });
41         },
42
43         getAddressGroupDictionaryData: function(url) {
44                         console.log("url on the service js: " + url);
45                         var url = url+'/ecomp/get_AddressGroupData';
46             return $http.get(url)
47                 .then(function(response) {
48                     if (typeof response.data === 'object') {
49                         return response.data;
50                     } else {
51                         return $q.reject(response.data);
52                     }
53
54                 }, function(response) {
55                     // something went wrong
56                     return $q.reject(response.data);
57                 });
58         },
59
60         getParentListDictionaryData : function(url){
61                         console.log("url on the service js: " + url);
62                         var url = url+'/ecomp/get_FWDictionaryListData';
63             return $http.get(url)
64                 .then(function(response) {
65                     if (typeof response.data === 'object') {
66                         return response.data;
67                     } else {
68                         return $q.reject(response.data);
69                     }
70
71                 }, function(response) {
72                     // something went wrong
73                     return $q.reject(response.data);
74                 });
75         },
76
77         getPortListDictionaryData : function(url){
78                         console.log("url on the service js: " + url);
79                         var url = url+'/ecomp/get_PortListData';
80             return $http.get(url)
81                 .then(function(response) {
82                     if (typeof response.data === 'object') {
83                         return response.data;
84                     } else {
85                         return $q.reject(response.data);
86                     }
87
88                 }, function(response) {
89                     // something went wrong
90                     return $q.reject(response.data);
91                 });
92         },
93
94
95         getPrefixListDictionaryData : function(url){
96                         console.log("url on the service js: " + url);
97                         var url = url+'/ecomp/get_PrefixListData';
98             return $http.get(url)
99                 .then(function(response) {
100                     if (typeof response.data === 'object') {
101                         return response.data;
102                     } else {
103                         return $q.reject(response.data);
104                     }
105
106                 }, function(response) {
107                     // something went wrong
108                     return $q.reject(response.data);
109                 });
110         },
111
112
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;
120                     } else {
121                         return $q.reject(response.data);
122                     }
123
124                 }, function(response) {
125                     // something went wrong
126                     return $q.reject(response.data);
127                 });
128         },
129
130
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;
138                     } else {
139                         return $q.reject(response.data);
140                     }
141
142                 }, function(response) {
143                     // something went wrong
144                     return $q.reject(response.data);
145                 });
146         },
147
148
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;
156                     } else {
157                         return $q.reject(response.data);
158                     }
159
160                 }, function(response) {
161                     // something went wrong
162                     return $q.reject(response.data);
163                 });
164         },
165
166
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;
174                     } else {
175                         return $q.reject(response.data);
176                     }
177
178                 }, function(response) {
179                     // something went wrong
180                     return $q.reject(response.data);
181                 });
182         },
183
184
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;
192                     } else {
193                         return $q.reject(response.data);
194                     }
195
196                 }, function(response) {
197                     // something went wrong
198                     return $q.reject(response.data);
199                 });
200         },
201
202
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;
210                     } else {
211                         return $q.reject(response.data);
212                     }
213
214                 }, function(response) {
215                     // something went wrong
216                     return $q.reject(response.data);
217                 });
218         },
219         
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;
227                     } else {
228                         return $q.reject(response.data);
229                     }
230
231                 }, function(response) {
232                     // something went wrong
233                     return $q.reject(response.data);
234                 });
235         },
236         
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;
244                     } else {
245                         return $q.reject(response.data);
246                     }
247
248                 }, function(response) {
249                     // something went wrong
250                     return $q.reject(response.data);
251                 });
252         },
253         
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;
261                     } else {
262                         return $q.reject(response.data);
263                     }
264
265                 }, function(response) {
266                     // something went wrong
267                     return $q.reject(response.data);
268                 });
269         },
270         
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;
278                     } else {
279                         return $q.reject(response.data);
280                     }
281
282                 }, function(response) {
283                     // something went wrong
284                     return $q.reject(response.data);
285                 });
286         },
287         
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;
295                     } else {
296                         return $q.reject(response.data);
297                     }
298
299                 }, function(response) {
300                     // something went wrong
301                     return $q.reject(response.data);
302                 });
303         },
304         
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;
312                     } else {
313                         return $q.reject(response.data);
314                     }
315
316                 }, function(response) {
317                     // something went wrong
318                     return $q.reject(response.data);
319                 });
320         },
321         
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;
329                     } else {
330                         return $q.reject(response.data);
331                     }
332
333                 }, function(response) {
334                     // something went wrong
335                     return $q.reject(response.data);
336                 });
337         }
338     };
339 });