Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplateController / PolicyDictionaryService.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 angular.module("abs").factory('PolicyDictionaryService', function ($http, $q) {
24     return {
25                         
26         getActionPolicyDictionaryData : function(url){
27                         console.log("url on the service js: " + url);
28                         var url = url+'/ecomp/get_ActionPolicyDictDataByName';
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         getFunctionDefinitionData : function(){
44             return $http.get('get_FunctionDefinitionDataByName')
45                 .then(function(response) {
46                     if (typeof response.data === 'object') {
47                         return response.data;
48                     } else {
49                         return $q.reject(response.data);
50                     }
51
52                 }, function(response) {
53                     // something went wrong
54                     return $q.reject(response.data);
55                 });
56         },
57
58         getAttributeDictionaryData: function(url) {
59                         console.log("url on the service js: " + url);
60                         var url = url+'/ecomp/get_AttributeDatabyAttributeName';
61             return $http.get(url)
62                 .then(function(response) {
63                     if (typeof response.data === 'object') {
64                         return response.data;
65                     } else {
66                         return $q.reject(response.data);
67                     }
68
69                 }, function(response) {
70                     // something went wrong
71                     return $q.reject(response.data);
72                 });
73         },
74
75
76         getEcompDictionaryData : function(url){
77                         console.log("url on the service js: " + url);
78                         var url = url+'/ecomp/get_EcompNameDataByName';
79             return $http.get(url)
80                 .then(function(response) {
81                     if (typeof response.data === 'object') {
82                         return response.data;
83                     } else {
84                         return $q.reject(response.data);
85                     }
86                 }, function(response) {
87                     // something went wrong
88                     return $q.reject(response.data);
89                 });
90         },
91
92
93         getBRMSParamDictionaryData : function(url){
94                         console.log("url on the service js: " + url);
95                         var url = url+'/ecomp/get_BRMSParamDataByName';
96             return $http.get(url)
97                 .then(function(response) {
98                     if (typeof response.data === 'object') {
99                         return response.data;
100                     } else {
101                         return $q.reject(response.data);
102                     }
103
104                 }, function(response) {
105                     // something went wrong
106                     return $q.reject(response.data);
107                 });
108         },
109
110
111         getDecisionSettingsDictionaryData : function(url){
112                         console.log("url on the service js: " + url);
113                         var url = url+'/ecomp/get_SettingsDictionaryDataByName';
114             return $http.get(url)
115                 .then(function(response) {
116                     if (typeof response.data === 'object') {
117                         return response.data;
118                     } else {
119                         return $q.reject(response.data);
120                     }
121
122                 }, function(response) {
123                     // something went wrong
124                     return $q.reject(response.data);
125                 });
126         },
127       
128         getDescriptiveDictionaryData : function(url){
129                         console.log("url on the service js: " + url);
130                         var url = url+'/ecomp/get_DescriptiveScopeByName';
131             return $http.get(url)
132                 .then(function(response) {
133                     if (typeof response.data === 'object') {
134                         return response.data;
135                     } else {
136                         return $q.reject(response.data);
137                     }
138
139                 }, function(response) {
140                     // something went wrong
141                     return $q.reject(response.data);
142                 });
143         },
144  
145             getPepOptionsDictionaryData : function(url){
146                         console.log("url on the service js: " + url);
147                         var url = url+'/ecomp/get_PEPOptionsDataByName';
148                 return $http.get(url)
149                     .then(function(response) {
150                         if (typeof response.data === 'object') {
151                             return response.data;
152                         } else {
153                             return $q.reject(response.data);
154                         }
155         
156                     }, function(response) {
157                         // something went wrong
158                         return $q.reject(response.data);
159                     });
160             },
161         
162             getVSCLActionDictionaryData: function(url) {
163                         console.log("url on the service js: " + url);
164                         var url = url+'/ecomp/get_VSCLActionDataByName';
165                 return $http.get(url)
166                     .then(function(response) {
167                         if (typeof response.data === 'object') {
168                             return response.data;
169                         } else {
170                             return $q.reject(response.data);
171                         }
172         
173                     }, function(response) {
174                         // something went wrong
175                         return $q.reject(response.data);
176                     });
177             },
178             
179             getVnfTypeDictionaryData : function(url){
180                         console.log("url on the service js: " + url);
181                         var url = url+'/ecomp/get_VNFTypeDataByName';
182                 return $http.get(url)
183                     .then(function(response) {
184                         if (typeof response.data === 'object') {
185                             return response.data;
186                         } else {
187                             return $q.reject(response.data);
188                         }
189         
190                     }, function(response) {
191                         // something went wrong
192                         return $q.reject(response.data);
193                     });
194             },
195         
196             getServiceDictionaryData : function(url){
197                         console.log("url on the service js: " + url);
198                         var url = url+'/ecomp/get_ClosedLoopServicesDataByName';
199                 return $http.get(url)
200                     .then(function(response) {
201                         if (typeof response.data === 'object') {
202                             return response.data;
203                         } else {
204                             return $q.reject(response.data);
205                         }
206         
207                     }, function(response) {
208                         // something went wrong
209                         return $q.reject(response.data);
210                     });
211             },
212         
213         
214             getSiteDictionaryData : function(url){
215                         console.log("url on the service js: " + url);
216                         var url = url+'/ecomp/get_ClosedLoopSiteDataByName';
217                 return $http.get(url)
218                     .then(function(response) {
219                         if (typeof response.data === 'object') {
220                             return response.data;
221                         } else {
222                             return $q.reject(response.data);
223                         }
224         
225                     }, function(response) {
226                         // something went wrong
227                         return $q.reject(response.data);
228                     });
229             },
230         
231         
232             getVarbindDictionaryData : function(url){
233                         console.log("url on the service js: " + url);
234                         var url = url+'/ecomp/get_VarbindDictionaryDataByName';
235                 return $http.get(url)
236                 .then(function(response) {
237                         if (typeof response.data === 'object') {
238                                 return response.data;
239                         } else {
240                                 return $q.reject(response.data);
241                         }
242         
243                 }, function(response) {
244                         // something went wrong
245                         return $q.reject(response.data);
246                 });
247             },
248             
249             getSecurityZoneDictionaryData : function(url){
250                         console.log("url on the service js: " + url);
251                         var url = url+'/ecomp/get_SecurityZoneDataByName';
252                 return $http.get(url)
253                     .then(function(response) {
254                         if (typeof response.data === 'object') {
255                             return response.data;
256                         } else {
257                             return $q.reject(response.data);
258                         }
259         
260                     }, function(response) {
261                         // something went wrong
262                         return $q.reject(response.data);
263                     });
264             },
265             
266             getTermListDictionaryData : function(url){
267                         console.log("url on the service js: " + url);
268                         var url = url+'/ecomp/get_TermListDataByName';
269                 return $http.get(url)
270                     .then(function(response) {
271                         if (typeof response.data === 'object') {
272                             return response.data;
273                         } else {
274                             return $q.reject(response.data);
275                         }
276         
277                     }, function(response) {
278                         // something went wrong
279                         return $q.reject(response.data);
280                     });
281             },
282         
283             getPepOptionsDictionaryDataEntity : function(url){
284                         console.log("url on the service js: " + url);
285                         var url = url+'/ecomp/get_PEPOptionsData';
286                 return $http.get(url)
287                     .then(function(response) {
288                         if (typeof response.data === 'object') {
289                             return response.data;
290                         } else {
291                             return $q.reject(response.data);
292                         }
293         
294                     }, function(response) {
295                         // something went wrong
296                         return $q.reject(response.data);
297                     });
298             },
299
300     getFWDictionaryListDictionaryData : function(url){
301         var url = url+'/ecomp/get_FWDictionaryListDataByName';
302         return $http.get(url)
303             .then(function(response) {
304                 if (typeof response.data === 'object') {
305                     return response.data;
306                 } else {
307                     return $q.reject(response.data);
308                 }
309
310             }, function(response) {
311                 // something went wrong
312                 return $q.reject(response.data);
313             });
314     },
315     
316     getFWParentListDictionaryData : function(){
317         return $http.get('get_FWParentListDataByName')
318             .then(function(response) {
319                 if (typeof response.data === 'object') {
320                     return response.data;
321                 } else {
322                     return $q.reject(response.data);
323                 }
324
325             }, function(response) {
326                 // something went wrong
327                 return $q.reject(response.data);
328             });
329     },
330     
331         getMSConfigDataByName : function(url){
332                         console.log("url on the service js: " + url);
333                         var url = url+'/ecomp/get_MicroServiceConfigNameDataByName';
334             return $http.get(url)
335                 .then(function(response) {
336                     if (typeof response.data === 'object') {
337                         return response.data;
338                     } else {
339                         return $q.reject(response.data);
340                     }
341
342                 }, function(response) {
343                     // something went wrong
344                     return $q.reject(response.data);
345                 });
346         },
347
348         getMSLocationDataByName : function(url){
349                         console.log("url on the service js: " + url);
350                         var url = url+'/ecomp/get_MicroServiceLocationDataByName';
351             return $http.get(url)
352                 .then(function(response) {
353                     if (typeof response.data === 'object') {
354                         return response.data;
355                     } else {
356                         return $q.reject(response.data);
357                     }
358
359                 }, function(response) {
360                     // something went wrong
361                     return $q.reject(response.data);
362                 });
363         },
364
365         getMSServiceModelsDataByName : function(url){
366                         console.log("url on the service js: " + url);
367                         var url = url+'/ecomp/get_MicroServiceModelsDataByName';
368             return $http.get(url)
369                 .then(function(response) {
370                     if (typeof response.data === 'object') {
371                         return response.data;
372                     } else {
373                         return $q.reject(response.data);
374                     }
375
376                 }, function(response) {
377                     // something went wrong
378                     return $q.reject(response.data);
379                 });
380         },
381
382         getDCAEuuidDataByName : function(url){
383                         console.log("url on the service js: " + url);
384                         var url = url+'/ecomp/get_DCAEUUIDDataByName';
385             return $http.get(url)
386                 .then(function(response) {
387                     if (typeof response.data === 'object') {
388                         return response.data;
389                     } else {
390                         return $q.reject(response.data);
391                     }
392
393                 }, function(response) {
394                     // something went wrong
395                     return $q.reject(response.data);
396                 });
397         },
398
399         getPriorityValueData : function(){
400             return $http.get('get_DCAEPriorityValues')
401                 .then(function(response) {
402                     if (typeof response.data === 'object') {
403                         return response.data;
404                     } else {
405                         return $q.reject(response.data);
406                     }
407
408                 }, function(response) {
409                     // something went wrong
410                     return $q.reject(response.data);
411                 });
412         },
413
414         getPolicyScopeData : function(url){
415                         console.log("url on the service js: " + url);
416                         var url = url+'/ecomp/get_GroupPolicyScopeDataByName';
417             return $http.get(url)
418                 .then(function(response) {
419                     if (typeof response.data === 'object') {
420                         return response.data;
421                     } else {
422                         return $q.reject(response.data);
423                     }
424
425                 }, function(response) {
426                     // something went wrong
427                     return $q.reject(response.data);
428                 });
429         },
430         
431         getRiskTypeDictionaryData : function(url){
432                         console.log("url on the service js: " + url);
433                         var url = url+'/ecomp/get_RiskTypeDataByName';
434             return $http.get(url)
435                 .then(function(response) {
436                     if (typeof response.data === 'object') {
437                         return response.data;
438                     } else {
439                         return $q.reject(response.data);
440                     }
441                 }, function(response) {
442                     // something went wrong
443                     return $q.reject(response.data);
444                 });
445         },
446         getRiskLevelValueData : function(){
447             return $http.get('get_RiskLevelValues')
448                 .then(function(response) {
449                     if (typeof response.data === 'object') {
450                         return response.data;
451                     } else {
452                         return $q.reject(response.data);
453                     }
454
455                 }, function(response) {
456                     // something went wrong
457                     return $q.reject(response.data);
458                 });
459         },
460         getGuardValueData : function(){
461             return $http.get('get_GuardlValues')
462                 .then(function(response) {
463                     if (typeof response.data === 'object') {
464                         return response.data;
465                     } else {
466                         return $q.reject(response.data);
467                     }
468
469                 }, function(response) {
470                     // something went wrong
471                     return $q.reject(response.data);
472                 });
473         },
474         getSafePolicyWarningDictionaryData : function(url){
475                         console.log("url on the service js: " + url);
476                         var url = url+'/ecomp/get_SafePolicyWarningDataByName';
477             return $http.get(url)
478                 .then(function(response) {
479                     if (typeof response.data === 'object') {
480                         return response.data;
481                     } else {
482                         return $q.reject(response.data);
483                     }
484                 }, function(response) {
485                     // something went wrong
486                     return $q.reject(response.data);
487                 });
488         },
489         getRCAlarmDictionaryData : function(url){
490                         console.log("url on the service js: " + url);
491                         var url = url+'/ecomp/get_RCAlarmDataByName';
492             return $http.get(url)
493                 .then(function(response) {
494                     if (typeof response.data === 'object') {
495                         return response.data;
496                     } else {
497                         return $q.reject(response.data);
498                     }
499                 }, function(response) {
500                     // something went wrong
501                     return $q.reject(response.data);
502                 });
503         },
504         getServerScopeDictionaryData : function(url){
505                         console.log("url on the service js: " + url);
506                         var url = url+'/ecomp/get_ServerScopeDataByName';
507             return $http.get(url)
508                 .then(function(response) {
509                     if (typeof response.data === 'object') {
510                         return response.data;
511                     } else {
512                         return $q.reject(response.data);
513                     }
514
515                 }, function(response) {
516                     // something went wrong
517                     return $q.reject(response.data);
518                 });
519         }
520     };
521
522 });