@Test public void testGetFlowStats() throws Exception { try { mockMvc.perform( get("/api/stats/flowid/{flowId}/{startDate}/{endDate}/{downsample}/{metric}", TestMockStats.FLOW_ID, TestMockStats.START_DATE, TestMockStats.END_DATE, TestMockStats.DOWNSAMPLE, TestMockStats.METRIC_BITS, TestMockStats.DIRECTION_FORWARD) .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()); assertTrue(true); } catch (Exception ex) { assertTrue(false); } }
@RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody public String getFlowStats(@PathVariable String flowid, @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric) throws Exception { LOGGER.info("Get stat for flow"); return statsService.getFlowStats(startDate, endDate, downsample, flowid, metric); }
StatsController { @RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody public String getFlowStats(@PathVariable String flowid, @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric) throws Exception { LOGGER.info("Get stat for flow"); return statsService.getFlowStats(startDate, endDate, downsample, flowid, metric); } }
StatsController { @RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody public String getFlowStats(@PathVariable String flowid, @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric) throws Exception { LOGGER.info("Get stat for flow"); return statsService.getFlowStats(startDate, endDate, downsample, flowid, metric); }  }
StatsController { @RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody public String getFlowStats(@PathVariable String flowid, @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric) throws Exception { LOGGER.info("Get stat for flow"); return statsService.getFlowStats(startDate, endDate, downsample, flowid, metric); }  @RequestMapping(value = "/metrics") @ResponseStatus(HttpStatus.OK) @ResponseBody List<String> getMetricDetail(); @RequestMapping(value = "isl/{srcSwitch}/{srcPort}/{dstSwitch}/{dstPort}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_ISL }) @ResponseBody String getIslStats(@PathVariable String srcSwitch, @PathVariable String srcPort,
            @PathVariable String dstSwitch, @PathVariable String dstPort, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric); @RequestMapping(value = "switchid/{switchid}/port/{port}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody String getPortStats(@PathVariable String switchid, @PathVariable String port,
            @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample,
            @PathVariable String metric); @RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getFlowStats(@PathVariable String flowid, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric); @RequestMapping(value = "isl/losspackets/{srcSwitch}/{srcPort}/{dstSwitch}/{dstPort}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_ISL }) @ResponseBody String getIslLossPacketStats(@PathVariable String srcSwitch, @PathVariable String srcPort,
            @PathVariable String dstSwitch, @PathVariable String dstPort, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric); @RequestMapping(value = "flow/losspackets/{flowid}/{startDate}/{endDate}/{downsample}/{direction}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getFlowLossPacketStats(@PathVariable String flowid, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String direction); @RequestMapping(value = "flowpath", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getFlowPathStat(@RequestBody FlowPathStats flowPathStats); @RequestMapping(value = "switchports/{switchid}/{startDate}/{endDate}/{downsample}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody List<PortInfo> getSwitchPortsStats(@PathVariable String switchid,
            @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample); @RequestMapping(value = "meter/{flowid}/{startDate}/{endDate}/{downsample}/{metric}/{direction}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getMeterStats(@PathVariable String flowid, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, 
            @PathVariable String metric, @PathVariable String direction); }
StatsController { @RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody public String getFlowStats(@PathVariable String flowid, @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric) throws Exception { LOGGER.info("Get stat for flow"); return statsService.getFlowStats(startDate, endDate, downsample, flowid, metric); }  @RequestMapping(value = "/metrics") @ResponseStatus(HttpStatus.OK) @ResponseBody List<String> getMetricDetail(); @RequestMapping(value = "isl/{srcSwitch}/{srcPort}/{dstSwitch}/{dstPort}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_ISL }) @ResponseBody String getIslStats(@PathVariable String srcSwitch, @PathVariable String srcPort,
            @PathVariable String dstSwitch, @PathVariable String dstPort, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric); @RequestMapping(value = "switchid/{switchid}/port/{port}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody String getPortStats(@PathVariable String switchid, @PathVariable String port,
            @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample,
            @PathVariable String metric); @RequestMapping(value = "flowid/{flowid}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getFlowStats(@PathVariable String flowid, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric); @RequestMapping(value = "isl/losspackets/{srcSwitch}/{srcPort}/{dstSwitch}/{dstPort}/{startDate}/{endDate}/{downsample}/{metric}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_ISL }) @ResponseBody String getIslLossPacketStats(@PathVariable String srcSwitch, @PathVariable String srcPort,
            @PathVariable String dstSwitch, @PathVariable String dstPort, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String metric); @RequestMapping(value = "flow/losspackets/{flowid}/{startDate}/{endDate}/{downsample}/{direction}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getFlowLossPacketStats(@PathVariable String flowid, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, @PathVariable String direction); @RequestMapping(value = "flowpath", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getFlowPathStat(@RequestBody FlowPathStats flowPathStats); @RequestMapping(value = "switchports/{switchid}/{startDate}/{endDate}/{downsample}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_SWITCHES }) @ResponseBody List<PortInfo> getSwitchPortsStats(@PathVariable String switchid,
            @PathVariable String startDate, @PathVariable String endDate, @PathVariable String downsample); @RequestMapping(value = "meter/{flowid}/{startDate}/{endDate}/{downsample}/{metric}/{direction}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) @Permissions(values = { IConstants.Permission.MENU_FLOWS }) @ResponseBody String getMeterStats(@PathVariable String flowid, @PathVariable String startDate,
            @PathVariable String endDate, @PathVariable String downsample, 
            @PathVariable String metric, @PathVariable String direction);  }