Skip to content

Commit

Permalink
Update Rest API
Browse files Browse the repository at this point in the history
  • Loading branch information
yunha-inno committed Sep 10, 2024
1 parent caeb03c commit 3c606da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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";
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@RestController
@RequiredArgsConstructor
@RequestMapping(TriggerConstants.TRIGGER_URI + "/policy")
@RequestMapping(TriggerConstants.TRIGGER_URI)
public class TriggerPolicyController {

private final TriggerPolicyService triggerPolicyService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

@RestController
@RequiredArgsConstructor
@RequestMapping(TriggerConstants.TRIGGER_URI + "/target")
@RequestMapping(TriggerConstants.TRIGGER_URI)
public class TriggerTargetController {

private final TriggerTargetService triggerTargetService;


@ApiOperation(value = "Get Trigger Target all list")
@TriggerBase64Encode
@GetMapping
@GetMapping("/target")
public TriggerResBody<List<TriggerTargetInfo>> list(@RequestParam("policySeq") Long policySeq) {
TriggerResBody<List<TriggerTargetInfo>> res = new TriggerResBody<>();
res.setData(triggerTargetService.getList(policySeq));
Expand All @@ -31,13 +31,13 @@ public TriggerResBody<List<TriggerTargetInfo>> list(@RequestParam("policySeq") L

@ApiOperation(value = "Get Trigger Target detail", hidden = true)
@TriggerBase64Encode
@GetMapping("/{targetSeq}")
@GetMapping("/target/{targetSeq}")
public TriggerResBody<TriggerTargetInfo> detail(@PathVariable("targetSeq") Long seq) {
return triggerTargetService.getDetail(new TriggerResBody<>(), seq);
}

@ApiOperation(value = "Set trigger target")
@PutMapping("/{policySeq}")
@PutMapping("/{policySeq}/target")
public TriggerResBody<Void> setTargets(@PathVariable("policySeq") Long policySeq,
@RequestBody List<ManageTriggerTargetDto> targets) {
return triggerTargetService.setTargets(policySeq, targets);
Expand Down

0 comments on commit 3c606da

Please sign in to comment.