From 953b7ed06e483e013e4d406119999fd73dbbbdae Mon Sep 17 00:00:00 2001 From: sudhakaropsmx Date: Sun, 8 Nov 2020 10:35:15 +0530 Subject: [PATCH] Added the DELETE,UPDATE Method allow more resource --- .../controllers/OpsmxOesController.groovy | 46 +++++++++++++++++++ .../services/internal/OpsmxOesService.groovy | 28 +++++++++++ 2 files changed, 74 insertions(+) diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxOesController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxOesController.groovy index 3d4c186845..ad61f2cdc0 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxOesController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxOesController.groovy @@ -125,6 +125,27 @@ class OpsmxOesController { return opsmxOesService.deleteOesResponse4(type, source, source1) } + @ApiOperation(value = "Endpoint for Oes rest services") + @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.DELETE) + Object deleteOesResponse5(@PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2) { + + return opsmxOesService.deleteOesResponse5(type, source, source1, source2) + } + + @ApiOperation(value = "Endpoint for Oes rest services") + @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.DELETE) + Object deleteOesResponse6(@PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @PathVariable("source3") String source3) { + + return opsmxOesService.deleteOesResponse6(type, source, source1, source2, source3) + } + @ApiOperation(value = "Add or Update dynamic account configured in Spinnaker", response = String.class) @RequestMapping(value = "/addOrUpdateDynamicAccount", method = RequestMethod.POST) String addOrUpdateAccount(@RequestParam MultipartFile files, @RequestParam Map postData) { @@ -195,6 +216,31 @@ class OpsmxOesController { return opsmxOesService.updateOesResponse4(type, source, source1, data) } + @ApiOperation(value = "Endpoint for Oes rest services") + @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.PUT) + Object updateOesResponse5(@PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @RequestBody Object data) { + + return opsmxOesService.updateOesResponse5(type, source, source1, source2, data) + } + + @ApiOperation(value = "Endpoint for Oes rest services") + @RequestMapping(value = "/{type}/{source}/{source1}", method = RequestMethod.PUT) + Object updateOesResponse6(@PathVariable("type") String type, + @PathVariable("source") String source, + @PathVariable("source1") String source1, + @PathVariable("source2") String source2, + @PathVariable("source3") String source3, + @RequestBody Object data) { + + return opsmxOesService.updateOesResponse6(type, source, source1, source2, source3, data) + } + + + private String addOrUpdateDynamicAccount(byte[] bytes, String filename, String data) { AuthenticatedRequest.propagate { diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxOesService.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxOesService.groovy index e1b21e1828..d260ec2484 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxOesService.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxOesService.groovy @@ -60,6 +60,19 @@ interface OpsmxOesService { @Path('source') String source, @Path('source1') String source1) + @DELETE("/oes/{type}/{source}/{source1}/{source2}") + Object deleteOesResponse5(@Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2) + + @DELETE("/oes/{type}/{source}/{source1}/{source2}/{source3}") + Object deleteOesResponse6(@Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Path('source3') String source3) + @POST("/oes/{type}/{source}") Object postOesResponse(@Path('type') String type, @Path('source') String source, @@ -98,4 +111,19 @@ interface OpsmxOesService { @Path('source') String source, @Path('source1') String source1, @Body Object data) + + @PUT("/oes/{type}/{source}/{source1}/{source2}") + Object updateOesResponse5(@Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Body Object data) + + @PUT("/oes/{type}/{source}/{source1}/{source2}/{source3}") + Object updateOesResponse6(@Path('type') String type, + @Path('source') String source, + @Path('source1') String source1, + @Path('source2') String source2, + @Path('source3') String source3, + @Body Object data) }