use of org.opensearch.ad.transport.ValidateAnomalyDetectorResponse in project anomaly-detection by opensearch-project.
the class RestValidateAnomalyDetectorAction method sendAnomalyDetectorValidationParseResponse.
protected void sendAnomalyDetectorValidationParseResponse(DetectorValidationIssue issue, RestChannel channel) throws IOException {
try {
BytesRestResponse restResponse = new BytesRestResponse(RestStatus.OK, new ValidateAnomalyDetectorResponse(issue).toXContent(channel.newBuilder()));
channel.sendResponse(restResponse);
} catch (Exception e) {
channel.sendResponse(new BytesRestResponse(RestStatus.INTERNAL_SERVER_ERROR, e.getMessage()));
}
}
Aggregations