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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<AlertRuleResponse> createRule(@Valid AlertRuleRequest request) org.springframework.http.ResponseEntity<Void> deleteRule(Long id) org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<AlertEventResponse>> org.springframework.http.ResponseEntity<List<AlertRuleResponse>>
-
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
-
getEvents
@GetMapping("/events") public org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<AlertEventResponse>> getEvents(@RequestParam Long serviceId, org.springframework.data.domain.Pageable pageable)
-