From 3c606da785d608b61b26abc55660570ce5ca4f95 Mon Sep 17 00:00:00 2001 From: JeongYunha Date: Tue, 10 Sep 2024 15:32:05 +0900 Subject: [PATCH] Update Rest API --- .../mco11yagent/trigger/common/TriggerConstants.java | 3 +-- .../trigger/controller/TriggerPolicyController.java | 2 +- .../trigger/controller/TriggerTargetController.java | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/common/TriggerConstants.java b/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/common/TriggerConstants.java index 54eed2a8..c7c0b420 100644 --- a/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/common/TriggerConstants.java +++ b/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/common/TriggerConstants.java @@ -1,6 +1,5 @@ package mcmp.mc.observability.mco11yagent.trigger.common; public class TriggerConstants { - public static final String TRIGGER_URI = "/api/o11y/trigger"; - public static final String ALERT_URI = "/api/o11y/alert"; + public static final String TRIGGER_URI = "/api/o11y/trigger/policy"; } \ No newline at end of file diff --git a/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerPolicyController.java b/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerPolicyController.java index bf0ff34d..7ebb232a 100644 --- a/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerPolicyController.java +++ b/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerPolicyController.java @@ -16,7 +16,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping(TriggerConstants.TRIGGER_URI + "/policy") +@RequestMapping(TriggerConstants.TRIGGER_URI) public class TriggerPolicyController { private final TriggerPolicyService triggerPolicyService; diff --git a/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerTargetController.java b/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerTargetController.java index 94b733b2..66c5882c 100644 --- a/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerTargetController.java +++ b/java-module/mc-o11y-agent/src/main/java/mcmp/mc/observability/mco11yagent/trigger/controller/TriggerTargetController.java @@ -14,7 +14,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping(TriggerConstants.TRIGGER_URI + "/target") +@RequestMapping(TriggerConstants.TRIGGER_URI) public class TriggerTargetController { private final TriggerTargetService triggerTargetService; @@ -22,7 +22,7 @@ public class TriggerTargetController { @ApiOperation(value = "Get Trigger Target all list") @TriggerBase64Encode - @GetMapping + @GetMapping("/target") public TriggerResBody> list(@RequestParam("policySeq") Long policySeq) { TriggerResBody> res = new TriggerResBody<>(); res.setData(triggerTargetService.getList(policySeq)); @@ -31,13 +31,13 @@ public TriggerResBody> list(@RequestParam("policySeq") L @ApiOperation(value = "Get Trigger Target detail", hidden = true) @TriggerBase64Encode - @GetMapping("/{targetSeq}") + @GetMapping("/target/{targetSeq}") public TriggerResBody detail(@PathVariable("targetSeq") Long seq) { return triggerTargetService.getDetail(new TriggerResBody<>(), seq); } @ApiOperation(value = "Set trigger target") - @PutMapping("/{policySeq}") + @PutMapping("/{policySeq}/target") public TriggerResBody setTargets(@PathVariable("policySeq") Long policySeq, @RequestBody List targets) { return triggerTargetService.setTargets(policySeq, targets);