1 package com.onap.sdnc.vnfreportsservice.controller;
6 import org.apache.logging.log4j.LogManager;
7 import org.apache.logging.log4j.Logger;
8 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.format.annotation.DateTimeFormat;
10 import org.springframework.web.bind.annotation.PathVariable;
11 import org.springframework.web.bind.annotation.RequestMapping;
12 import org.springframework.web.bind.annotation.RequestMethod;
13 import org.springframework.web.bind.annotation.RestController;
15 import com.onap.sdnc.vnfreportsservice.model.VnfConfigDetailsDB;
16 import com.onap.sdnc.vnfreportsservice.service.VnfReportsServiceImpl;
19 public class VnfReportsServiceController {
21 private static final Logger logger = LogManager.getLogger(VnfReportsServiceController.class);
24 VnfReportsServiceImpl Vnfreportsservice;
26 @RequestMapping(value = "/getVnfDetBetDates/{startDate}/{endDate}", method = RequestMethod.GET, produces = "application/json")
28 public List<VnfConfigDetailsDB> getVnfConfigDetailsBetweenDates(
29 @PathVariable("startDate") @DateTimeFormat(pattern = "dd-MM-yyyy") Date startDate,
30 @PathVariable("endDate") @DateTimeFormat(pattern = "dd-MM-yyyy") Date endDate) {
31 logger.info("Get VNF Configuration Details Inbetween 2 Dates ");
32 return Vnfreportsservice.getVnfConfigDetailsBetweenDates(startDate, endDate);
35 @RequestMapping(value = "/getVnfDetByVnfidBetDates/{vnfid}/{startDate}/{endDate}", method = RequestMethod.GET, produces = "application/json")
37 public List<VnfConfigDetailsDB> getVnfConfigDetailsByVnfIdBetweenDates(@PathVariable("vnfid") String vnfId,
38 @PathVariable("startDate") @DateTimeFormat(pattern = "dd-MM-yyyy") Date startDate,
39 @PathVariable("endDate") @DateTimeFormat(pattern = "dd-MM-yyyy") Date endDate) {
40 logger.info("Get VNF Configuration Details Of a VnfID Inbetween 2 Dates ");
41 return Vnfreportsservice.getVnfIdDetailsBetweenDates(vnfId, startDate, endDate);