From 2b54fd243c7f028c881577a4b90735d5347b8f7f Mon Sep 17 00:00:00 2001 From: PravallikaEmani <97868699+emanipravallika@users.noreply.github.com> Date: Thu, 16 Nov 2023 18:37:38 +0530 Subject: [PATCH] OP 21132: Feature-multi spinnaker configuration - Adding cdNames param for platform and audit apis (#444) --- .../OpsmxPlatformController.groovy | 5 +++-- .../internal/OpsmxPlatformService.groovy | 3 ++- .../OpsmxAuditClientServiceController.groovy | 20 +++++++++++-------- .../services/OpsmxAuditClientService.groovy | 12 +++++++---- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy index 078bdd8d59..f5f25d7f4f 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxPlatformController.groovy @@ -80,8 +80,9 @@ class OpsmxPlatformController { @RequestParam(value = "applicationId", required = false) Integer applicationId, @RequestParam(value = "applicationName", required = false) String applicationName, @RequestParam(value = "noOfDays", required = false) Integer noOfDays, - @RequestParam(value = "filterBy", required = false) String filterBy) { - return opsmxPlatformService.getPlatformResponse1(version, type, datasourceType, accountName, source, permission, search, username, pageNo, pageLimit, sortBy, sortOrder, applicationId, applicationName, noOfDays, filterBy) + @RequestParam(value = "filterBy", required = false) String filterBy, + @RequestParam(value = "cdName", required = false) List cdNames) { + return opsmxPlatformService.getPlatformResponse1(version, type, datasourceType, accountName, source, permission, search, username, pageNo, pageLimit, sortBy, sortOrder, applicationId, applicationName, noOfDays, filterBy, cdNames) } @ApiOperation(value = "Endpoint for platform rest services") diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy index a9b6ea530e..633f9c4ac4 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxPlatformService.groovy @@ -38,7 +38,8 @@ interface OpsmxPlatformService { @Query("applicationId") Integer applicationId, @Query("applicationName") String applicationName, @Query("noOfDays") Integer noOfDays, - @Query("filterBy") String filterBy) + @Query("filterBy") String filterBy, + @Query("cdName") List cdNames) @GET("/platformservice/{version}/{type}/{source}") Object getPlatformResponse(@Path('version') String version, 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 8d4f2bdb38..894e19a639 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 @@ -89,8 +89,9 @@ class OpsmxAuditClientServiceController { @RequestParam(value = "sortOrder", required = false) String sortOrder, @RequestParam(value = "sortBy", required = false) String sortBy, @RequestParam(value = "startDate", required = false) Long startDate, - @RequestParam(value = "endDate", required = false) Long endDate) { - return opsmxAuditClientService.getAuditClientResponse3(version, type, source, source1, isTreeView, isLatest, pageNo, pageLimit, noOfDays, search, sortOrder, sortBy, startDate, endDate) + @RequestParam(value = "endDate", required = false) Long endDate, + @RequestParam(value = "cdName", required = false) List cdNames) { + return opsmxAuditClientService.getAuditClientResponse3(version, type, source, source1, isTreeView, isLatest, pageNo, pageLimit, noOfDays, search, sortOrder, sortBy, startDate, endDate, cdNames) } @ApiOperation(value = "Endpoint for audit-client rest services") @@ -104,9 +105,10 @@ class OpsmxAuditClientServiceController { @RequestParam(value = "updatedTimestamp", required = false) Long updatedTimestamp, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "startDate", required = false) Long startDate, - @RequestParam(value = "endDate", required = false) Long endDate) { + @RequestParam(value = "endDate", required = false) Long endDate, + @RequestParam(value = "cdName", required = false) List cdNames) { - return opsmxAuditClientService.getAuditClientResponse4(version, type, source, source1, source2, noOfDays, updatedTimestamp, size, startDate, endDate) + return opsmxAuditClientService.getAuditClientResponse4(version, type, source, source1, source2, noOfDays, updatedTimestamp, size, startDate, endDate, cdNames) } @ApiOperation(value = "Endpoint for audit-client rest services") @@ -119,8 +121,9 @@ class OpsmxAuditClientServiceController { @PathVariable("source3") String source3, @RequestParam(value = "noOfDays", required = false) String noOfDays, @RequestParam(value = "startDate", required = false) Long startDate, - @RequestParam(value = "endDate", required = false) Long endDate) { - return opsmxAuditClientService.getAuditClientResponse5(version, type, source, source1, source2, source3, noOfDays, startDate, endDate) + @RequestParam(value = "endDate", required = false) Long endDate, + @RequestParam(value = "cdName", required = false) List cdNames) { + return opsmxAuditClientService.getAuditClientResponse5(version, type, source, source1, source2, source3, noOfDays, startDate, endDate, cdNames) } @ApiOperation(value = "Endpoint for audit-client rest services") @@ -161,8 +164,9 @@ class OpsmxAuditClientServiceController { @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "noOfDays", required = false) String noOfDays, @RequestParam(value = "startDate", required = false) Long startDate, - @RequestParam(value = "endDate", required = false) Long endDate) { - Response response = opsmxAuditClientService.downloadCSVFile(version, username, source, isTreeView, isLatest, pageNo, size, noOfDays, startDate, endDate) + @RequestParam(value = "endDate", required = false) Long endDate, + @RequestParam(value = "cdName", required = false) List cdNames) { + Response response = opsmxAuditClientService.downloadCSVFile(version, username, source, isTreeView, isLatest, pageNo, size, noOfDays, startDate, endDate, cdNames) log.info("response for the insgiths 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 607847c973..0614e005e8 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 @@ -64,7 +64,8 @@ interface OpsmxAuditClientService { @Query("sortOrder") String sortOrder, @Query("sortBy") String sortBy, @Query("startDate") Long startDate, - @Query("endDate") Long endDate) + @Query("endDate") Long endDate, + @Query("cdNames") List cdNames) @GET("/auditclientservice/{version}/{type}/{source}/{source1}/{source2}") Object getAuditClientResponse4(@Path('version') String version, @@ -76,7 +77,8 @@ interface OpsmxAuditClientService { @Query("updatedTimestamp") Long updatedTimestamp, @Query("size") Integer size, @Query("startDate") Long startDate, - @Query("endDate") Long endDate) + @Query("endDate") Long endDate, + @Query("cdNames") List cdNames) @GET("/auditclientservice/{version}/{type}/{source}/{source1}/{source2}/{source3}") Object getAuditClientResponse5(@Path('version') String version, @@ -87,7 +89,8 @@ interface OpsmxAuditClientService { @Path('source3') String source3, @Query("noOfDays") String noOfDays, @Query("startDate") Long startDate, - @Query("endDate") Long endDate) + @Query("endDate") Long endDate, + @Query("cdNames") List cdNames) @GET("/auditclientservice/{version}/{type}/{source}/{source1}/{source2}/{source3}/{source4}") Object getAuditClientResponse6(@Path('version') String version, @@ -118,7 +121,8 @@ interface OpsmxAuditClientService { @Query("size") Integer size, @Query("noOfDays") String noOfDays, @Query("startDate") Long startDate, - @Query("endDate") Long endDate) + @Query("endDate") Long endDate, + @Query("cdNames") List cdNames) @GET("/auditclientservice/{version}/{type}/{source}/download") Response downloadDeliveryInsightsCSVFile(@Path('version') String version,