-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature/extensions] Add Action for Validate detector API call #732
[Feature/extensions] Add Action for Validate detector API call #732
Conversation
Signed-off-by: Frank Lou <[email protected]>
|
||
@Override | ||
public List<Route> routes() { | ||
return List.of(new Route(POST, "/detectors")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need the new routes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbwiddis Do you means we need add new route HEAD
here for checking configuration, since Validate detector is used to return the detector configuration has any issue that prevent Opensearch from creating the detector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer https://opensearch.org/docs/latest/monitoring-plugins/ad/api/#validate-detector for the route @mloufra.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbwiddis @owaiskazi19 Thank you for your comments. For my understand, Validate detector having two option of validation. First one is focus on the detector configuration to find any issues which will block detector creation. Second one is focus on the source data to check the probability of complete model training. So we need two routes , one for detector POST _plugins/_anomaly_detection/detectors/_validate/detector
, and one for model POST _plugins/_anomaly_detection/detectors/_validate/model
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the issue we will need 2 routes:
POST /detectors/_validate
POST /detectors/_validate/{type}
We are not covering the below route as a part of this issue
POST _plugins/_anomaly_detection/detectors/_validate/model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not covering the below route as a part of this issue
POST _plugins/_anomaly_detection/detectors/_validate/model
Actually, the {type}
will include either detector
or model
that we'll extract with a param.get("type")
as part of the logic later.
We could have listed the routes separately (_validate/detector
and _validate/model
) but using {type}
parallels the existing plugin usage.
b7dbd48
to
4c7886b
Compare
Signed-off-by: Frank Lou <[email protected]>
src/main/java/org/opensearch/ad/rest/RestValidateDetectorAction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
Signed-off-by: Frank Lou <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@mloufra @owaiskazi19 build is failing due to changes in (merged) SDK PR #253 that have not yet been merged here in #725. Hopefully when #725 is merged this will pass. |
Codecov Report
@@ Coverage Diff @@
## feature/extensions #732 +/- ##
========================================================
- Coverage 53.36% 53.33% -0.04%
Complexity 2659 2659
========================================================
Files 290 291 +1
Lines 16058 16068 +10
Branches 1686 1687 +1
========================================================
Hits 8570 8570
- Misses 6871 6881 +10
Partials 617 617
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Frank Lou [email protected]
Description
Create an action implementing
ExtensionRestHandler
with routes for the Post detector API calls.Issues Resolved
Fixes opensearch-project/opensearch-sdk-java#221
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.