@@ -14,17 +14,8 @@ import org.opensearch.alerting.action.GetEmailGroupAction
1414import org.opensearch.alerting.action.GetRemoteIndexesAction
1515import org.opensearch.alerting.action.SearchEmailAccountAction
1616import org.opensearch.alerting.action.SearchEmailGroupAction
17- import org.opensearch.alerting.actionv2.DeleteMonitorV2Action
18- import org.opensearch.alerting.actionv2.ExecuteMonitorV2Action
19- import org.opensearch.alerting.actionv2.GetAlertsV2Action
20- import org.opensearch.alerting.actionv2.GetMonitorV2Action
21- import org.opensearch.alerting.actionv2.IndexMonitorV2Action
22- import org.opensearch.alerting.actionv2.SearchMonitorV2Action
2317import org.opensearch.alerting.alerts.AlertIndices
2418import org.opensearch.alerting.alerts.AlertIndices.Companion.ALL_ALERT_INDEX_PATTERN
25- import org.opensearch.alerting.alertsv2.AlertV2Indices
26- import org.opensearch.alerting.alertsv2.AlertV2Indices.Companion.ALL_ALERT_V2_INDEX_PATTERN
27- import org.opensearch.alerting.alertsv2.AlertV2Mover
2819import org.opensearch.alerting.comments.CommentsIndices
2920import org.opensearch.alerting.comments.CommentsIndices.Companion.ALL_COMMENTS_INDEX_PATTERN
3021import org.opensearch.alerting.core.JobSweeper
@@ -34,10 +25,8 @@ import org.opensearch.alerting.core.action.node.ScheduledJobsStatsTransportActio
3425import org.opensearch.alerting.core.lock.LockService
3526import org.opensearch.alerting.core.resthandler.RestScheduledJobStatsHandler
3627import org.opensearch.alerting.core.schedule.JobScheduler
37- import org.opensearch.alerting.core.settings.AlertingV2Settings
3828import org.opensearch.alerting.core.settings.LegacyOpenDistroScheduledJobSettings
3929import org.opensearch.alerting.core.settings.ScheduledJobSettings
40- import org.opensearch.alerting.modelv2.MonitorV2
4130import org.opensearch.alerting.remote.monitors.RemoteMonitorRegistry
4231import org.opensearch.alerting.resthandler.RestAcknowledgeAlertAction
4332import org.opensearch.alerting.resthandler.RestAcknowledgeChainedAlertAction
@@ -62,12 +51,6 @@ import org.opensearch.alerting.resthandler.RestSearchAlertingCommentAction
6251import org.opensearch.alerting.resthandler.RestSearchEmailAccountAction
6352import org.opensearch.alerting.resthandler.RestSearchEmailGroupAction
6453import org.opensearch.alerting.resthandler.RestSearchMonitorAction
65- import org.opensearch.alerting.resthandlerv2.RestDeleteMonitorV2Action
66- import org.opensearch.alerting.resthandlerv2.RestExecuteMonitorV2Action
67- import org.opensearch.alerting.resthandlerv2.RestGetAlertsV2Action
68- import org.opensearch.alerting.resthandlerv2.RestGetMonitorV2Action
69- import org.opensearch.alerting.resthandlerv2.RestIndexMonitorV2Action
70- import org.opensearch.alerting.resthandlerv2.RestSearchMonitorV2Action
7154import org.opensearch.alerting.script.TriggerScript
7255import org.opensearch.alerting.service.DeleteMonitorService
7356import org.opensearch.alerting.settings.AlertingSettings
@@ -100,12 +83,6 @@ import org.opensearch.alerting.transport.TransportSearchAlertingCommentAction
10083import org.opensearch.alerting.transport.TransportSearchEmailAccountAction
10184import org.opensearch.alerting.transport.TransportSearchEmailGroupAction
10285import org.opensearch.alerting.transport.TransportSearchMonitorAction
103- import org.opensearch.alerting.transportv2.TransportDeleteMonitorV2Action
104- import org.opensearch.alerting.transportv2.TransportExecuteMonitorV2Action
105- import org.opensearch.alerting.transportv2.TransportGetAlertsV2Action
106- import org.opensearch.alerting.transportv2.TransportGetMonitorV2Action
107- import org.opensearch.alerting.transportv2.TransportIndexMonitorV2Action
108- import org.opensearch.alerting.transportv2.TransportSearchMonitorV2Action
10986import org.opensearch.alerting.util.DocLevelMonitorQueries
11087import org.opensearch.alerting.util.destinationmigration.DestinationMigrationCoordinator
11188import org.opensearch.cluster.metadata.IndexNameExpressionResolver
@@ -180,7 +157,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
180157 @JvmField val OPEN_SEARCH_DASHBOARDS_USER_AGENT = " OpenSearch-Dashboards"
181158 @JvmField val UI_METADATA_EXCLUDE = arrayOf(" monitor.${Monitor .UI_METADATA_FIELD } " )
182159 @JvmField val MONITOR_BASE_URI = " /_plugins/_alerting/monitors"
183- @JvmField val MONITOR_V2_BASE_URI = " /_plugins/_alerting/v2/monitors"
184160 @JvmField val WORKFLOW_BASE_URI = " /_plugins/_alerting/workflows"
185161 @JvmField val REMOTE_BASE_URI = " /_plugins/_alerting/remote"
186162 @JvmField val DESTINATION_BASE_URI = " /_plugins/_alerting/destinations"
@@ -193,7 +169,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
193169 @JvmField val FINDING_BASE_URI = " /_plugins/_alerting/findings"
194170 @JvmField val COMMENTS_BASE_URI = " /_plugins/_alerting/comments"
195171
196- @JvmField val ALERTING_JOB_TYPES = listOf (" monitor" , " workflow" , " monitor_v2 " )
172+ @JvmField val ALERTING_JOB_TYPES = listOf (" monitor" , " workflow" )
197173 }
198174
199175 lateinit var runner: MonitorRunnerService
@@ -204,10 +180,8 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
204180 lateinit var docLevelMonitorQueries: DocLevelMonitorQueries
205181 lateinit var threadPool: ThreadPool
206182 lateinit var alertIndices: AlertIndices
207- lateinit var alertV2Indices: AlertV2Indices
208183 lateinit var clusterService: ClusterService
209184 lateinit var destinationMigrationCoordinator: DestinationMigrationCoordinator
210- lateinit var alertV2Mover: AlertV2Mover
211185 var monitorTypeToMonitorRunners: MutableMap <String , RemoteMonitorRegistry > = mutableMapOf ()
212186
213187 override fun getRestHandlers (
@@ -220,7 +194,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
220194 nodesInCluster : Supplier <DiscoveryNodes >
221195 ): List <RestHandler > {
222196 return listOf (
223- // Alerting V1
224197 RestGetMonitorAction (),
225198 RestDeleteMonitorAction (),
226199 RestIndexMonitorAction (),
@@ -245,20 +218,11 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
245218 RestIndexAlertingCommentAction (),
246219 RestSearchAlertingCommentAction (),
247220 RestDeleteAlertingCommentAction (),
248-
249- // Alerting V2
250- RestIndexMonitorV2Action (),
251- RestExecuteMonitorV2Action (),
252- RestDeleteMonitorV2Action (),
253- RestGetMonitorV2Action (),
254- RestSearchMonitorV2Action (settings, clusterService),
255- RestGetAlertsV2Action ()
256221 )
257222 }
258223
259224 override fun getActions (): List <ActionPlugin .ActionHandler <out ActionRequest , out ActionResponse >> {
260225 return listOf (
261- // Alerting V1
262226 ActionPlugin .ActionHandler (ScheduledJobsStatsAction .INSTANCE , ScheduledJobsStatsTransportAction ::class .java),
263227 ActionPlugin .ActionHandler (AlertingActions .INDEX_MONITOR_ACTION_TYPE , TransportIndexMonitorAction ::class .java),
264228 ActionPlugin .ActionHandler (AlertingActions .GET_MONITOR_ACTION_TYPE , TransportGetMonitorAction ::class .java),
@@ -285,22 +249,13 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
285249 ActionPlugin .ActionHandler (AlertingActions .DELETE_COMMENT_ACTION_TYPE , TransportDeleteAlertingCommentAction ::class .java),
286250 ActionPlugin .ActionHandler (ExecuteWorkflowAction .INSTANCE , TransportExecuteWorkflowAction ::class .java),
287251 ActionPlugin .ActionHandler (GetRemoteIndexesAction .INSTANCE , TransportGetRemoteIndexesAction ::class .java),
288- ActionPlugin .ActionHandler (DocLevelMonitorFanOutAction .INSTANCE , TransportDocLevelMonitorFanOutAction ::class .java),
289-
290- // Alerting V2
291- ActionPlugin .ActionHandler (IndexMonitorV2Action .INSTANCE , TransportIndexMonitorV2Action ::class .java),
292- ActionPlugin .ActionHandler (GetMonitorV2Action .INSTANCE , TransportGetMonitorV2Action ::class .java),
293- ActionPlugin .ActionHandler (SearchMonitorV2Action .INSTANCE , TransportSearchMonitorV2Action ::class .java),
294- ActionPlugin .ActionHandler (DeleteMonitorV2Action .INSTANCE , TransportDeleteMonitorV2Action ::class .java),
295- ActionPlugin .ActionHandler (ExecuteMonitorV2Action .INSTANCE , TransportExecuteMonitorV2Action ::class .java),
296- ActionPlugin .ActionHandler (GetAlertsV2Action .INSTANCE , TransportGetAlertsV2Action ::class .java)
252+ ActionPlugin .ActionHandler (DocLevelMonitorFanOutAction .INSTANCE , TransportDocLevelMonitorFanOutAction ::class .java)
297253 )
298254 }
299255
300256 override fun getNamedXContent (): List <NamedXContentRegistry .Entry > {
301257 return listOf (
302258 Monitor .XCONTENT_REGISTRY ,
303- MonitorV2 .XCONTENT_REGISTRY ,
304259 SearchInput .XCONTENT_REGISTRY ,
305260 DocLevelMonitorInput .XCONTENT_REGISTRY ,
306261 QueryLevelTrigger .XCONTENT_REGISTRY ,
@@ -330,7 +285,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
330285 val settings = environment.settings()
331286 val lockService = LockService (client, clusterService)
332287 alertIndices = AlertIndices (settings, client, threadPool, clusterService)
333- alertV2Indices = AlertV2Indices (settings, client, threadPool, clusterService)
334288 val alertService = AlertService (client, xContentRegistry, alertIndices)
335289 val triggerService = TriggerService (scriptService)
336290 runner = MonitorRunnerService
@@ -342,7 +296,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
342296 .registerSettings(settings)
343297 .registerThreadPool(threadPool)
344298 .registerAlertIndices(alertIndices)
345- .registerAlertV2Indices(alertV2Indices)
346299 .registerInputService(
347300 InputService (
348301 client,
@@ -369,7 +322,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
369322 scheduler = JobScheduler (threadPool, runner)
370323 sweeper = JobSweeper (environment.settings(), client, clusterService, threadPool, xContentRegistry, scheduler, ALERTING_JOB_TYPES )
371324 destinationMigrationCoordinator = DestinationMigrationCoordinator (client, clusterService, threadPool, scheduledJobIndices)
372- alertV2Mover = AlertV2Mover (environment.settings(), client, threadPool, clusterService, xContentRegistry)
373325 this .threadPool = threadPool
374326 this .clusterService = clusterService
375327
@@ -397,7 +349,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
397349 commentsIndices,
398350 docLevelMonitorQueries,
399351 destinationMigrationCoordinator,
400- alertV2Mover,
401352 lockService,
402353 alertService,
403354 triggerService
@@ -481,23 +432,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
481432 AlertingSettings .COMMENTS_MAX_CONTENT_SIZE ,
482433 AlertingSettings .MAX_COMMENTS_PER_ALERT ,
483434 AlertingSettings .MAX_COMMENTS_PER_NOTIFICATION ,
484- AlertingSettings .ALERT_V2_HISTORY_ENABLED ,
485- AlertingSettings .ALERT_V2_HISTORY_ROLLOVER_PERIOD ,
486- AlertingSettings .ALERT_V2_HISTORY_INDEX_MAX_AGE ,
487- AlertingSettings .ALERT_V2_HISTORY_MAX_DOCS ,
488- AlertingSettings .ALERT_V2_HISTORY_RETENTION_PERIOD ,
489- AlertingSettings .ALERT_V2_MONITOR_EXECUTION_MAX_DURATION ,
490- AlertingSettings .ALERTING_V2_MAX_MONITORS ,
491- AlertingSettings .ALERTING_V2_MAX_THROTTLE_DURATION ,
492- AlertingSettings .ALERTING_V2_MAX_EXPIRE_DURATION ,
493- AlertingSettings .ALERTING_V2_MAX_LOOK_BACK_WINDOW ,
494- AlertingSettings .ALERTING_V2_MAX_QUERY_LENGTH ,
495- AlertingSettings .ALERTING_V2_QUERY_RESULTS_MAX_DATAROWS ,
496- AlertingSettings .ALERT_V2_QUERY_RESULTS_MAX_SIZE ,
497- AlertingSettings .ALERT_V2_PER_RESULT_TRIGGER_MAX_ALERTS ,
498- AlertingSettings .NOTIFICATION_SUBJECT_SOURCE_MAX_LENGTH ,
499- AlertingSettings .NOTIFICATION_MESSAGE_SOURCE_MAX_LENGTH ,
500- AlertingV2Settings .ALERTING_V2_ENABLED ,
501435 AlertingSettings .NOTIFICATION_CONTEXT_RESULTS_ALLOWED_ROLES
502436 )
503437 }
@@ -516,8 +450,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
516450 return listOf (
517451 SystemIndexDescriptor (ALL_ALERT_INDEX_PATTERN , " Alerting Plugin system index pattern" ),
518452 SystemIndexDescriptor (SCHEDULED_JOBS_INDEX , " Alerting Plugin Configuration index" ),
519- SystemIndexDescriptor (ALL_COMMENTS_INDEX_PATTERN , " Alerting Comments system index pattern" ),
520- SystemIndexDescriptor (ALL_ALERT_V2_INDEX_PATTERN , " Alerting V2 Alerts index pattern" )
453+ SystemIndexDescriptor (ALL_COMMENTS_INDEX_PATTERN , " Alerting Comments system index pattern" )
521454 )
522455 }
523456
0 commit comments