Search in sources :

Example 1 with ValidateAnomalyDetectorResponse

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()));
    }
}
Also used : BytesRestResponse(org.opensearch.rest.BytesRestResponse) ValidateAnomalyDetectorResponse(org.opensearch.ad.transport.ValidateAnomalyDetectorResponse) ADValidationException(org.opensearch.ad.common.exception.ADValidationException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ADValidationException (org.opensearch.ad.common.exception.ADValidationException)1 ValidateAnomalyDetectorResponse (org.opensearch.ad.transport.ValidateAnomalyDetectorResponse)1 BytesRestResponse (org.opensearch.rest.BytesRestResponse)1