jihaozh commented on a change in pull request #5962:
URL: https://github.com/apache/incubator-pinot/pull/5962#discussion_r485111503



##########
File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionResource.java
##########
@@ -570,4 +574,19 @@ public Response getDetectionHealth(@PathParam("id") 
@ApiParam("detection config
     }
     return Response.ok(health).build();
   }
+
+  @POST
+  @Path(value = "/re-notify")
+  @ApiOperation("Resend the notification for the anomalies to the subscribed 
notification groups, if the subscription group supports re-notify")
+  public Response alert(@QueryParam("id") List<Long> anomalyIds) {
+    List<MergedAnomalyResultDTO> anomalies = 
this.anomalyDAO.findByIds(anomalyIds);
+    for (MergedAnomalyResultDTO anomaly : anomalies) {
+      AnomalySubscriptionGroupNotificationDTO 
anomalySubscriptionGroupNotificationDTO =
+          new AnomalySubscriptionGroupNotificationDTO();
+      anomalySubscriptionGroupNotificationDTO.setAnomalyId(anomaly.getId());
+      
anomalySubscriptionGroupNotificationDTO.setDetectionConfigId(anomaly.getDetectionConfigId());
+      
anomalySubscriptionGroupNotificationManager.save(anomalySubscriptionGroupNotificationDTO);

Review comment:
       good catch. updated!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to