API to enable/disable a monitor#770
API to enable/disable a monitor#770vikhy-aws wants to merge 3 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
…ate api in alerting Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
3053c64 to
32c7c84
Compare
| } | ||
|
|
||
| override fun validate(): ActionRequestValidationException? { | ||
| return null |
There was a problem hiding this comment.
what's this function about?
There was a problem hiding this comment.
It's an abstract method defined in the ActionRequest class, so need to provide an implementation here. Based on it's usage in other classes, it is used to validate the data members, which is not required in this case.
Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
4128a1f to
e3805a1
Compare
AWSHurneyt
left a comment
There was a problem hiding this comment.
Are any changes needed in the alerting plugin interface? It may be necessary for the security analytics plugin to enable/disable monitors.
https://github.com/opensearch-project/common-utils/blob/main/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt
| this.version = version | ||
| this.seqNo = seqNo | ||
| this.primaryTerm = primaryTerm | ||
| this.monitor = monitor |
There was a problem hiding this comment.
We may want to consider excluding the monitor from the response. Security analytics creates per document monitors that can have thousands of queries (a.k.a., rules) in them. That can make the response size pretty big, which may be extraneous for this kind of API. Perhaps we can instead just return the updated enabled value, instead of the entire monitor? We can discuss with the team.
Description
This PR adds request and response classes to common-utils to create an API that enables or disables the monitor using the following:
PUT _plugins/_alerting/monitors/{monitor_id}/enablePUT _plugins/_alerting/monitors/{monitor_id}/disableRelated Issues
Resolves opensearch-project/alerting#1058
Check List
--signoff.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.