-
Notifications
You must be signed in to change notification settings - Fork 105
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
API to enable/disable a monitor #1771
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: vikhy-aws <[email protected]>
Signed-off-by: vikhy-aws <[email protected]>
Signed-off-by: vikhy-aws <[email protected]>
Signed-off-by: vikhy-aws <[email protected]>
Signed-off-by: vikhy-aws <[email protected]>
return mutableListOf( | ||
ReplacedRoute( | ||
PUT, | ||
"${AlertingPlugin.MONITOR_BASE_URI}/{monitorID}/_enable", |
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.
What security level perms are we giving to these APIs, we need to make changes in Security plugin for that, check this -> https://github.com/opensearch-project/security/blob/a1ccbd56621609d1ae0b0f7b4780b968ed06024b/config/roles.yml#L32
alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestToggleMonitorAction.kt
Outdated
Show resolved
Hide resolved
alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestToggleMonitorAction.kt
Outdated
Show resolved
Hide resolved
alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestToggleMonitorAction.kt
Show resolved
Hide resolved
try { | ||
if (getMonitorResponse.monitor == null) { | ||
actionListener.onFailure( | ||
OpenSearchStatusException("Monitor $monitorId not found", RestStatus.NOT_FOUND) |
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.
Small observation. As a best practice, we should end error messages with periods (.
).
…ding to comments on PR Signed-off-by: vikhy-aws <[email protected]>
Description
This PR adds request and response classes to common-utils to create an API that enables or disables the monitor using the following:
Related Issues
Resolves #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.