-
Notifications
You must be signed in to change notification settings - Fork 36
Adding RestActions support for AD Search Rest API's #234
Conversation
Codecov Report
@@ Coverage Diff @@
## master #234 +/- ##
============================================
- Coverage 72.25% 71.97% -0.29%
- Complexity 1278 1284 +6
============================================
Files 139 143 +4
Lines 6045 5980 -65
Branches 469 469
============================================
- Hits 4368 4304 -64
+ Misses 1465 1462 -3
- Partials 212 214 +2
Flags with carried forward coverage won't be shown. Click here to find out 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.
Plans to add UTs?
|
||
public class SearchAnomalyDetectorAction extends ActionType<SearchResponse> { | ||
public static final SearchAnomalyDetectorAction INSTANCE = new SearchAnomalyDetectorAction(); | ||
public static final String NAME = "cluster:admin/ad/search/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.
Lets use opendistro
in the action name. For example: cluster:admin/opendistro/alerting/destinations/write
Also you might want to end with verb like: cluster:admin/opendistro/ad/detectors/search
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.
Sure that makes sense.
Will make changes.
import org.elasticsearch.transport.TransportService; | ||
|
||
|
||
public class SearchAnomalyResultTransportAction extends HandledTransportAction<SearchRequest, SearchResponse> { |
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.
NP: your rest handler is called : RestSearchAnomalyDetectorAction
, Would it be better to call transport handler as TransportSearchAnomalyDetectorAction
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.
Thats a good point. Existing Transport Actions were named that way, so I just followed them to be consistent.
Here are some examples:https://github.com/opendistro-for-elasticsearch/anomaly-detection/tree/master/src/main/java/com/amazon/opendistroforelasticsearch/ad/transport
Looks good overall. Will wait for your tests. |
Thanks for taking a look. Yup will send them out today. |
Cool, thanks for taking a look. Yup I'll send out the tests today. |
Adding RestActions support for Search Rest API's.
*Issue Anomaly Detection integration with Security : FGAC Support #195 *
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.