From 4c8e7e8e165b9876a6cb837874dbabf0f426aa33 Mon Sep 17 00:00:00 2001 From: Rahul Chekuri <89373036+rahul-chekuri@users.noreply.github.com> Date: Wed, 9 Mar 2022 11:58:04 +0530 Subject: [PATCH] OP-12054: Added days parameter (#160) * OP-12054: Fushion-Charts: New API to support fushion charts. * OP-12054: Fushion-Charts: Removed old apis to resolve ambiguity. * OP-12054: Fushion-Charts: Removed old apis to resolve ambiguity. * OP-12054: Fushion-Charts: Renamed to meet standards * OP-12054: Fushion-Charts: Modified exiting urls to support all versions * OP-12054: Removed commented parts of code. --- .../OpsmxAuditClientServiceController.groovy | 12 +++++++----- .../gate/services/OpsmxAuditClientService.groovy | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/controllers/OpsmxAuditClientServiceController.groovy b/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/controllers/OpsmxAuditClientServiceController.groovy index 6601ff4c57..154d02a379 100644 --- a/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/controllers/OpsmxAuditClientServiceController.groovy +++ b/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/controllers/OpsmxAuditClientServiceController.groovy @@ -51,13 +51,14 @@ class OpsmxAuditClientServiceController { @ApiOperation(value = "Endpoint for audit-client rest services") @RequestMapping(value = "/{version}/{type}/{source}", method = RequestMethod.GET) - Object getAuditClientResponse2(@PathVariable("version") String version, + Object getDeliveryInsightCharts(@PathVariable("version") String version, @PathVariable("type") String type, @PathVariable("source") String source, @RequestParam(value = "chartId", required = false) Integer chartId, @RequestParam(value = "startTime", required = false) Long startTime, - @RequestParam(value = "endTime", required = false) Long endTime) { - return opsmxAuditClientService.getAuditClientResponse2(version, type, source, chartId, startTime, endTime) + @RequestParam(value = "endTime", required = false) Long endTime, + @RequestParam(value = "days", required = false) Integer days) { + return opsmxAuditClientService.getDeliveryInsightCharts(version, type, source, chartId, startTime, endTime, days) } @ApiOperation(value = "Endpoint for audit-client rest services") @@ -160,8 +161,9 @@ class OpsmxAuditClientServiceController { @PathVariable("source") String source, @RequestParam(value = "chartId", required = false) Integer chartId, @RequestParam(value = "startTime", required = false) Long startTime, - @RequestParam(value = "endTime", required = false) Long endTime) { - Response response = opsmxAuditClientService.downloadDeliveryInsightsCSVFile(version, type, source, chartId, startTime, endTime) + @RequestParam(value = "endTime", required = false) Long endTime, + @RequestParam(value = "days", required = false) Integer days) { + Response response = opsmxAuditClientService.downloadDeliveryInsightsCSVFile(version, type, source, chartId, startTime, endTime, days) log.info("response for the delivery insights endpoint:" + response.getHeaders()) if (response.getBody()!=null) { InputStream inputStream = response.getBody().in() diff --git a/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/services/OpsmxAuditClientService.groovy b/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/services/OpsmxAuditClientService.groovy index 90924ebbbe..93cda3ecd2 100644 --- a/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/services/OpsmxAuditClientService.groovy +++ b/gate-web/src/main/groovy/com/opsmx/spinnaker/gate/services/OpsmxAuditClientService.groovy @@ -29,12 +29,13 @@ interface OpsmxAuditClientService { @Path('type') String type) @GET("/auditclientservice/{version}/{type}/{source}") - Object getAuditClientResponse2(@Path('version') String version, + Object getDeliveryInsightCharts(@Path('version') String version, @Path('type') String type, @Path('source') String source, @Query('chartId') Integer chartId, @Query('startTime') Long startTime, - @Query('endTime') Long endTime) + @Query('endTime') Long endTime, + @Query('days') Integer days) @GET("/auditclientservice/{version}/{type}/{source}/{source1}") Object getAuditClientResponse3(@Path('version') String version, @@ -98,6 +99,6 @@ interface OpsmxAuditClientService { @Path('source') String source, @Query('chartId') Integer chartId, @Query('startTime') Long startTime, - @Query('endTime') Long endTime) - + @Query('endTime') Long endTime, + @Query('days') Integer days) }