Skip to content

Commit

Permalink
feat: add request and response classes to implement toggle monitor st…
Browse files Browse the repository at this point in the history
…ate api in alerting

Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com>
  • Loading branch information
vikhy-aws committed Jan 16, 2025
1 parent 5307c44 commit 32c7c84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object AlertingActions {
const val INDEX_COMMENT_ACTION_NAME = "cluster:admin/opensearch/alerting/comments/write"
const val SEARCH_COMMENTS_ACTION_NAME = "cluster:admin/opensearch/alerting/comments/search"
const val DELETE_COMMENT_ACTION_NAME = "cluster:admin/opensearch/alerting/comments/delete"
const val UPDATE_MONITOR_STATE_ACTION_NAME = "cluster:admin/opensearch/alerting/monitor/toggle"
const val TOGGLE_MONITOR_ACTION_NAME = "cluster:admin/opensearch/alerting/monitor/toggle"

@JvmField
val INDEX_MONITOR_ACTION_TYPE =
Expand Down Expand Up @@ -91,6 +91,6 @@ object AlertingActions {
ActionType(DELETE_COMMENT_ACTION_NAME, ::DeleteCommentResponse)

@JvmField
val UPDATE_MONITOR_STATE_ACTION_TYPE =
ActionType(UPDATE_MONITOR_STATE_ACTION_NAME, ::UpdateMonitorStateResponse)
val TOGGLE_MONITOR_ACTION_TYPE =
ActionType(TOGGLE_MONITOR_ACTION_NAME, ::ToggleMonitorResponse)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.opensearch.core.common.io.stream.StreamOutput
import org.opensearch.rest.RestRequest
import java.io.IOException

class UpdateMonitorStateRequest : ActionRequest {
class ToggleMonitorRequest : ActionRequest {
val monitorId: String
val enabled: Boolean
val seqNo: Long
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.opensearch.core.xcontent.ToXContent.Params
import org.opensearch.core.xcontent.XContentBuilder
import java.io.IOException

class UpdateMonitorStateResponse : BaseResponse {
class ToggleMonitorResponse : BaseResponse {
var id: String
var version: Long
var seqNo: Long
Expand Down

0 comments on commit 32c7c84

Please sign in to comment.