Github user justinleet commented on a diff in the pull request:
https://github.com/apache/metron/pull/824#discussion_r150239607
--- Diff:
metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/MetaAlertController.java
---
@@ -60,5 +63,37 @@
) throws RestException {
return new ResponseEntity<>(metaAlertService.create(createRequest),
HttpStatus.OK);
}
+
+ @ApiOperation(value = "Create a meta alert")
+ @ApiResponse(message = "Created meta alert", code = 200)
+ @RequestMapping(value = "/add/alert", method = RequestMethod.POST)
+ ResponseEntity<Boolean> addAlertsToMetaAlert(
+ @ApiParam(name = "request", value = "Meta Alert Create Request",
required = true)
+ @RequestBody final MetaAlertAddRemoveRequest
metaAlertAddRemoveRequest
+ ) throws RestException {
+ return new
ResponseEntity<>(metaAlertService.addAlertsToMetaAlert(metaAlertAddRemoveRequest),
HttpStatus.OK);
+ }
+
+ @ApiOperation(value = "Create a meta alert")
+ @ApiResponse(message = "Created meta alert", code = 200)
+ @RequestMapping(value = "/remove/alert", method = RequestMethod.POST)
+ ResponseEntity<Boolean> removeAlertsFromMetaAlert(
+ @ApiParam(name = "request", value = "Meta Alert Create Request",
required = true)
+ @RequestBody final MetaAlertAddRemoveRequest
metaAlertAddRemoveRequest
+ ) throws RestException {
+ return new
ResponseEntity<>(metaAlertService.removeAlertsFromMetaAlert(metaAlertAddRemoveRequest),
HttpStatus.OK);
+ }
+
+ @ApiOperation(value = "Create a meta alert")
+ @ApiResponse(message = "Created meta alert", code = 200)
+ @RequestMapping(value = "/update/status/{guid}/{status}", method =
RequestMethod.POST)
+ ResponseEntity<Boolean> updateMetaAlertStatus(
+ final @ApiParam(name = "guid", value = "Kafka topic name", required
= true)
+ @PathVariable String guid,
+ final @ApiParam(name = "status", value = "Kafka topic name",
required = true)
+ @PathVariable String status) throws RestException {
+ return new
ResponseEntity<>(metaAlertService.updateMetaAlertStatus(guid,
+ MetaAlertStatus.valueOf(status.toUpperCase())), HttpStatus.OK);
+ }
--- End diff --
I think we'll also need to be able to add comments and a name to the
metaalert as a whole, to support work in
https://github.com/apache/metron/pull/803/
@iraghumitra Is there anything else needed in terms of updates on meta
alerts themselves (underlying alerts aren't affected by this stuff)?
---