[ 
https://issues.apache.org/jira/browse/METRON-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16250036#comment-16250036
 ] 

ASF GitHub Bot commented on METRON-1289:
----------------------------------------

Github user cestella commented on a diff in the pull request:

    https://github.com/apache/metron/pull/824#discussion_r150628792
  
    --- 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 --
    
    We will need to add sections for these in 
`metron-interface/metron-rest/README.md`


> Alert fields are lost when a MetaAlert is created
> -------------------------------------------------
>
>                 Key: METRON-1289
>                 URL: https://issues.apache.org/jira/browse/METRON-1289
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Ryan Merriman
>            Assignee: Ryan Merriman
>
> When a MetaAlert is created, the included results are being updated 
> incorrectly with only the "metaalert" field.  This causes subsequent findOne 
> operations to only return the "metaalert field for that alert.  All fields 
> should continue to be present.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to