Epic-231:versioning, and backup the configuration
[sdnc/oam.git] / configbackuprestore / vnfconfigbackupservice / src / main / webapp / js / sdnc-services / sdnc-viewReport-service.js
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : SDNC-FEATURES
4 * ================================================================================
5 * Copyright 2018 TechMahindra
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 myApp.service('viewReportService', ['$http', function($http) {
22     
23 this.getAllVNF = function() {
24         var testlist = {};
25         return $http.get('/getAllBackupVnfIds')
26             .then(function(response) {
27                     console.log("---validationTestService::getAllVNF::TestResponse---" + JSON.stringify(response));
28                     vnflist = response.data;
29                     return vnflist;
30                 },
31                 function(response) {
32                     console.log("validationTestService::getAllVNF::Status Code", response.status);
33                     return response;
34                 });
35
36     };
37
38         this.getData = function(startDate, endDate) {
39                 
40                 var data = {};
41                 if (startDate != null && endDate != null) {
42
43             data.startdate = startDate;
44             data.enddate = endDate;
45
46         }
47                 var request = {
48                             method: 'GET',
49                             url: '/getVnfDetBetDates/'+startDate+'/'+endDate+'/',
50                            
51                              headers: {
52                                 'Content-Type': 'application/json',
53                             }
54                         };
55                  
56                  return $http(request)
57              .then(function(response) {
58                      console.log("---deviceConfigService::getVersions::Response---" + JSON.stringify(response));
59                      return response;
60                  },
61                  function(response) {
62                      console.log("--deviceConfigService::getVersions::Status Code--", response.status);
63                      return response;
64                  });
65
66                 }
67         
68         
69         this.getDataById = function(selectedValueVnf,startDate, endDate) {
70                 
71                 var data = {};
72                 if (startDate != null && endDate != null) {
73
74             data.startdate = startDate;
75             data.enddate = endDate;
76
77         }
78                 var request = {
79                             method: 'GET',
80                             url: '/getVnfDetByVnfidBetDates/'+selectedValueVnf+'/'+startDate+'/'+endDate+'/',
81                            
82                              headers: {
83                                 'Content-Type': 'application/json',
84                             }
85                         };
86                  
87                  return $http(request)
88              .then(function(response) {
89                      console.log("---deviceConfigService::getVersions::Response---" + JSON.stringify(response));
90                      return response;
91                  },
92                  function(response) {
93                      console.log("--deviceConfigService::getVersions::Status Code--", response.status);
94                      return response;
95                  });
96
97                 }
98         
99         
100         
101 }]);