Class AlertController

java.lang.Object
com.nmontytskyi.monitoring.server.controller.AlertController

@Validated @RestController @RequestMapping("/api/alerts") public class AlertController extends Object
REST controller for managing alert rules and querying alert events.

Exposes endpoints to create, list, and delete alert rules, and to retrieve the paginated log of fired alert events.

Author:
Nazar Montytskyi
See Also:
  • Constructor Details

    • AlertController

      public AlertController()
  • Method Details

    • createRule

      @PostMapping("/rules") public org.springframework.http.ResponseEntity<AlertRuleResponse> createRule(@Valid @RequestBody @Valid AlertRuleRequest request)
    • getRules

      @GetMapping("/rules") public org.springframework.http.ResponseEntity<List<AlertRuleResponse>> getRules(@RequestParam(required=false) Long serviceId)
    • deleteRule

      @DeleteMapping("/rules/{id}") public org.springframework.http.ResponseEntity<Void> deleteRule(@PathVariable Long id)
    • getEvents

      @GetMapping("/events") public org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<AlertEventResponse>> getEvents(@RequestParam Long serviceId, org.springframework.data.domain.Pageable pageable)