apucher commented on a change in pull request #3609: [TE] yaml - create alert
endpoint
URL: https://github.com/apache/incubator-pinot/pull/3609#discussion_r240843497
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/detection/yaml/YamlResource.java
##########
@@ -95,6 +98,110 @@ public YamlResource() {
this.provider = new DefaultDataProvider(metricDAO, datasetDAO, eventDAO,
anomalyDAO, timeseriesLoader, aggregationLoader, loader);
}
+ @POST
+ @Path("/create-alert")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
+ @ApiOperation("Use yaml to create both notification and detection yaml. ")
+ public Response createYamlAlert(@ApiParam(value = "a json contains both
notification and detection yaml as string") String payload,
+ @ApiParam("tuning window start time for tunable components")
@QueryParam("startTime") long startTime,
+ @ApiParam("tuning window end time for tunable components")
@QueryParam("endTime") long endTime) throws Exception{
+ Map<String, String> yamls = OBJECT_MAPPER.readValue(payload,
HashMap.class);
Review comment:
**Map.class** should do the job
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]