From 2167902db5e3ad6d7f58f50c32dfda3176509cfc Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Tue, 25 Feb 2025 17:02:15 -0800 Subject: [PATCH] Fixed imports for 3.0-alpha1. Signed-off-by: AWSHurneyt --- .../src/main/kotlin/org/opensearch/alerting/AlertService.kt | 2 +- .../src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt | 2 +- .../org/opensearch/alerting/BucketLevelMonitorRunner.kt | 2 +- .../src/main/kotlin/org/opensearch/alerting/InputService.kt | 2 +- .../kotlin/org/opensearch/alerting/MonitorMetadataService.kt | 2 +- .../src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt | 2 +- .../org/opensearch/alerting/MonitorRunnerExecutionContext.kt | 2 +- .../kotlin/org/opensearch/alerting/MonitorRunnerService.kt | 2 +- .../kotlin/org/opensearch/alerting/WorkflowMetadataService.kt | 2 +- .../main/kotlin/org/opensearch/alerting/WorkflowService.kt | 2 +- .../kotlin/org/opensearch/alerting/alerts/AlertIndices.kt | 2 +- .../main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt | 2 +- .../org/opensearch/alerting/comments/CommentsIndices.kt | 2 +- .../org/opensearch/alerting/model/AlertingConfigAccessor.kt | 2 +- .../alerting/model/destination/DestinationContextFactory.kt | 2 +- .../org/opensearch/alerting/resthandler/AsyncActionHandler.kt | 2 +- .../alerting/resthandler/RestAcknowledgeAlertAction.kt | 2 +- .../resthandler/RestAcknowledgeChainedAlertsAction.kt | 2 +- .../alerting/resthandler/RestDeleteAlertingCommentAction.kt | 2 +- .../alerting/resthandler/RestDeleteMonitorAction.kt | 2 +- .../alerting/resthandler/RestDeleteWorkflowAction.kt | 2 +- .../alerting/resthandler/RestExecuteMonitorAction.kt | 2 +- .../alerting/resthandler/RestExecuteWorkflowAction.kt | 2 +- .../opensearch/alerting/resthandler/RestGetAlertsAction.kt | 2 +- .../alerting/resthandler/RestGetDestinationsAction.kt | 2 +- .../alerting/resthandler/RestGetEmailAccountAction.kt | 2 +- .../alerting/resthandler/RestGetEmailGroupAction.kt | 2 +- .../opensearch/alerting/resthandler/RestGetFindingsAction.kt | 2 +- .../opensearch/alerting/resthandler/RestGetMonitorAction.kt | 2 +- .../alerting/resthandler/RestGetRemoteIndexesAction.kt | 2 +- .../opensearch/alerting/resthandler/RestGetWorkflowAction.kt | 2 +- .../alerting/resthandler/RestGetWorkflowAlertsAction.kt | 2 +- .../alerting/resthandler/RestIndexAlertingCommentAction.kt | 2 +- .../opensearch/alerting/resthandler/RestIndexMonitorAction.kt | 2 +- .../alerting/resthandler/RestIndexWorkflowAction.kt | 2 +- .../alerting/resthandler/RestSearchAlertingCommentAction.kt | 2 +- .../alerting/resthandler/RestSearchEmailAccountAction.kt | 2 +- .../alerting/resthandler/RestSearchEmailGroupAction.kt | 2 +- .../alerting/resthandler/RestSearchMonitorAction.kt | 2 +- .../org/opensearch/alerting/service/DeleteMonitorService.kt | 2 +- .../opensearch/alerting/transport/SecureTransportAction.kt | 2 +- .../alerting/transport/TransportAcknowledgeAlertAction.kt | 2 +- .../transport/TransportAcknowledgeChainedAlertAction.kt | 2 +- .../transport/TransportDeleteAlertingCommentAction.kt | 2 +- .../alerting/transport/TransportDeleteMonitorAction.kt | 2 +- .../alerting/transport/TransportDeleteWorkflowAction.kt | 2 +- .../transport/TransportDocLevelMonitorFanOutAction.kt | 4 ++-- .../alerting/transport/TransportExecuteMonitorAction.kt | 2 +- .../alerting/transport/TransportExecuteWorkflowAction.kt | 2 +- .../opensearch/alerting/transport/TransportGetAlertsAction.kt | 2 +- .../alerting/transport/TransportGetDestinationsAction.kt | 2 +- .../alerting/transport/TransportGetEmailAccountAction.kt | 2 +- .../alerting/transport/TransportGetEmailGroupAction.kt | 2 +- .../alerting/transport/TransportGetFindingsAction.kt | 2 +- .../alerting/transport/TransportGetMonitorAction.kt | 2 +- .../alerting/transport/TransportGetRemoteIndexesAction.kt | 2 +- .../alerting/transport/TransportGetWorkflowAction.kt | 2 +- .../alerting/transport/TransportGetWorkflowAlertsAction.kt | 2 +- .../alerting/transport/TransportIndexAlertingCommentAction.kt | 2 +- .../alerting/transport/TransportIndexMonitorAction.kt | 2 +- .../alerting/transport/TransportIndexWorkflowAction.kt | 2 +- .../transport/TransportSearchAlertingCommentAction.kt | 2 +- .../alerting/transport/TransportSearchEmailAccountAction.kt | 2 +- .../alerting/transport/TransportSearchEmailGroupAction.kt | 2 +- .../alerting/transport/TransportSearchMonitorAction.kt | 2 +- .../main/kotlin/org/opensearch/alerting/util/CommentsUtils.kt | 2 +- .../org/opensearch/alerting/util/CrossClusterMonitorUtils.kt | 4 ++-- .../org/opensearch/alerting/util/DocLevelMonitorQueries.kt | 2 +- .../SupportedClusterMetricsSettingsExtensions.kt | 2 +- .../destinationmigration/DestinationMigrationCoordinator.kt | 4 ++-- .../destinationmigration/DestinationMigrationUtilService.kt | 2 +- .../util/destinationmigration/NotificationApiUtils.kt | 4 ++-- .../kotlin/org/opensearch/alerting/workflow/WorkflowRunner.kt | 2 +- .../test/kotlin/org/opensearch/alerting/AlertServiceTests.kt | 2 +- .../main/kotlin/org/opensearch/alerting/core/JobSweeper.kt | 2 +- .../org/opensearch/alerting/core/ScheduledJobIndices.kt | 2 +- .../kotlin/org/opensearch/alerting/core/lock/LockService.kt | 2 +- .../alerting/core/resthandler/RestScheduledJobStatsHandler.kt | 2 +- .../opensearch/alerting/opensearchapi/OpenSearchExtensions.kt | 2 +- .../org/opensearch/alerting/SampleRemoteMonitorPlugin.java | 2 +- .../opensearch/alerting/SampleRemoteMonitorRestHandler.java | 2 +- .../fanouts/TransportRemoteDocLevelMonitorFanOutAction.java | 2 +- .../alerting/monitor/runners/SampleRemoteMonitorRunner1.java | 2 +- .../alerting/monitor/runners/SampleRemoteMonitorRunner2.java | 2 +- 84 files changed, 88 insertions(+), 88 deletions(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt index 84eb5aae5..2e013740a 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt @@ -28,7 +28,6 @@ import org.opensearch.alerting.util.CommentsUtils import org.opensearch.alerting.util.IndexUtils import org.opensearch.alerting.util.MAX_SEARCH_SIZE import org.opensearch.alerting.util.getBucketKeysHash -import org.opensearch.client.Client import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory @@ -63,6 +62,7 @@ import org.opensearch.index.reindex.DeleteByQueryAction import org.opensearch.index.reindex.DeleteByQueryRequestBuilder import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortOrder +import org.opensearch.transport.client.Client import java.time.Instant import java.util.UUID import java.util.concurrent.TimeUnit diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt b/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt index 1f8a4d514..23d03f08e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt @@ -85,7 +85,6 @@ import org.opensearch.alerting.transport.TransportSearchEmailGroupAction import org.opensearch.alerting.transport.TransportSearchMonitorAction import org.opensearch.alerting.util.DocLevelMonitorQueries import org.opensearch.alerting.util.destinationmigration.DestinationMigrationCoordinator -import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.node.DiscoveryNodes import org.opensearch.cluster.service.ClusterService @@ -135,6 +134,7 @@ import org.opensearch.rest.RestHandler import org.opensearch.script.ScriptContext import org.opensearch.script.ScriptService import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import org.opensearch.watcher.ResourceWatcherService import java.util.function.Supplier diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt index cc9e6508c..fea37e0af 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt @@ -27,7 +27,6 @@ import org.opensearch.alerting.util.getBucketKeysHash import org.opensearch.alerting.util.getCancelAfterTimeInterval import org.opensearch.alerting.util.getCombinedTriggerRunResult import org.opensearch.alerting.util.printsSampleDocData -import org.opensearch.client.Client import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentType @@ -60,6 +59,7 @@ import org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortOrder import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Instant import java.util.UUID diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt index c7eeac833..c77878bd4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt @@ -21,7 +21,6 @@ import org.opensearch.alerting.util.clusterMetricsMonitorHelpers.executeTranspor import org.opensearch.alerting.util.clusterMetricsMonitorHelpers.toMap import org.opensearch.alerting.util.getRoleFilterEnabled import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.routing.Preference import org.opensearch.cluster.service.ClusterService @@ -49,6 +48,7 @@ import org.opensearch.script.ScriptService import org.opensearch.script.ScriptType import org.opensearch.script.TemplateScript import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.Client import java.time.Duration import java.time.Instant diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt index b3826479a..abd2bc1c2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt @@ -28,7 +28,6 @@ import org.opensearch.action.support.WriteRequest import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.IndexUtils -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue @@ -49,6 +48,7 @@ import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.transport.RemoteTransportException +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(MonitorMetadataService::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt index ec599aba8..4e6cdbc02 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunner.kt @@ -23,7 +23,6 @@ import org.opensearch.alerting.util.destinationmigration.sendNotification import org.opensearch.alerting.util.isAllowed import org.opensearch.alerting.util.isTestAction import org.opensearch.alerting.util.use -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.model.ActionRunResult import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.MonitorRunResult @@ -33,6 +32,7 @@ import org.opensearch.commons.alerting.model.action.Action import org.opensearch.commons.notifications.model.NotificationConfigInfo import org.opensearch.core.common.Strings import org.opensearch.transport.TransportService +import org.opensearch.transport.client.node.NodeClient import java.time.Instant abstract class MonitorRunner { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerExecutionContext.kt b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerExecutionContext.kt index 523c2be3a..c3f1f28c7 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerExecutionContext.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerExecutionContext.kt @@ -14,7 +14,6 @@ import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.settings.DestinationSettings import org.opensearch.alerting.settings.LegacyOpenDistroDestinationSettings import org.opensearch.alerting.util.DocLevelMonitorQueries -import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings @@ -24,6 +23,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.monitor.jvm.JvmStats import org.opensearch.script.ScriptService import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client data class MonitorRunnerExecutionContext( diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerService.kt index ec8d57736..7731a7d7f 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerService.kt @@ -52,7 +52,6 @@ import org.opensearch.alerting.util.DocLevelMonitorQueries import org.opensearch.alerting.util.IndexUtils import org.opensearch.alerting.util.isDocLevelMonitor import org.opensearch.alerting.workflow.CompositeWorkflowRunner -import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.service.ClusterService import org.opensearch.common.lifecycle.AbstractLifecycleComponent @@ -77,6 +76,7 @@ import org.opensearch.script.ScriptService import org.opensearch.script.TemplateScript import org.opensearch.threadpool.ThreadPool import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Instant import java.time.LocalDateTime import java.time.ZoneOffset diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt index f56dd5fd7..6b35fd917 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt @@ -20,7 +20,6 @@ import org.opensearch.action.index.IndexResponse import org.opensearch.action.support.WriteRequest import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue @@ -38,6 +37,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils +import org.opensearch.transport.client.Client import java.time.Instant import java.time.LocalDateTime import java.time.ZoneOffset diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowService.kt index 1379a1fe3..15f1e192e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowService.kt @@ -12,7 +12,6 @@ import org.opensearch.action.admin.indices.exists.indices.IndicesExistsResponse import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.alerting.opensearchapi.suspendUntil -import org.opensearch.client.Client import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Finding @@ -24,6 +23,7 @@ import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(WorkflowService::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt index 64c62f926..7749d0ec8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt @@ -43,7 +43,6 @@ import org.opensearch.alerting.settings.AlertingSettings.Companion.FINDING_HISTO import org.opensearch.alerting.settings.AlertingSettings.Companion.REQUEST_TIMEOUT import org.opensearch.alerting.util.CommentsUtils import org.opensearch.alerting.util.IndexUtils -import org.opensearch.client.Client import org.opensearch.cluster.ClusterChangedEvent import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.metadata.IndexMetadata @@ -64,6 +63,7 @@ import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.threadpool.Scheduler.Cancellable import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import java.time.Instant private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt index 07b1a3a91..08d1e884f 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt @@ -19,7 +19,6 @@ import org.opensearch.alerting.alerts.AlertIndices.Companion.ALERT_HISTORY_WRITE import org.opensearch.alerting.alerts.AlertIndices.Companion.ALERT_INDEX import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.util.ScheduledJobUtils -import org.opensearch.client.Client import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper @@ -38,6 +37,7 @@ import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.VersionType import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(AlertMover::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/comments/CommentsIndices.kt b/alerting/src/main/kotlin/org/opensearch/alerting/comments/CommentsIndices.kt index 6bbeee933..f65199ebe 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/comments/CommentsIndices.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/comments/CommentsIndices.kt @@ -25,7 +25,6 @@ import org.opensearch.alerting.alerts.AlertIndices import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.IndexUtils -import org.opensearch.client.Client import org.opensearch.cluster.ClusterChangedEvent import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.metadata.IndexMetadata @@ -36,6 +35,7 @@ import org.opensearch.common.xcontent.XContentType import org.opensearch.core.action.ActionListener import org.opensearch.threadpool.Scheduler import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import java.time.Instant /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/AlertingConfigAccessor.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/AlertingConfigAccessor.kt index 2e2b24b19..89430b9d1 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/AlertingConfigAccessor.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/AlertingConfigAccessor.kt @@ -12,13 +12,13 @@ import org.opensearch.action.get.GetResponse import org.opensearch.alerting.model.destination.email.EmailAccount import org.opensearch.alerting.model.destination.email.EmailGroup import org.opensearch.alerting.opensearchapi.suspendUntil -import org.opensearch.client.Client import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.core.common.bytes.BytesReference import org.opensearch.core.xcontent.NamedXContentRegistry +import org.opensearch.transport.client.Client /** * This is an accessor class to retrieve documents/information from the Alerting config index. diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/DestinationContextFactory.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/DestinationContextFactory.kt index 263962ac7..b72711606 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/DestinationContextFactory.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/DestinationContextFactory.kt @@ -11,9 +11,9 @@ import org.opensearch.alerting.model.destination.email.EmailAccount import org.opensearch.alerting.model.destination.email.Recipient import org.opensearch.alerting.settings.DestinationSettings.Companion.SecureDestinationSettings import org.opensearch.alerting.util.DestinationType -import org.opensearch.client.Client import org.opensearch.core.common.settings.SecureString import org.opensearch.core.xcontent.NamedXContentRegistry +import org.opensearch.transport.client.Client /** * This class is responsible for generating [DestinationContext]. diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/AsyncActionHandler.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/AsyncActionHandler.kt index ae837d8d9..8f14b0c69 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/AsyncActionHandler.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/AsyncActionHandler.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.rest.BytesRestResponse import org.opensearch.rest.RestChannel +import org.opensearch.transport.client.node.NodeClient abstract class AsyncActionHandler(protected val client: NodeClient, protected val channel: RestChannel) { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeAlertAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeAlertAction.kt index f953876a4..1b2ee4521 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeAlertAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeAlertAction.kt @@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger import org.opensearch.action.support.WriteRequest.RefreshPolicy import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.REFRESH -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AcknowledgeAlertRequest import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.core.xcontent.XContentParser @@ -22,6 +21,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log: Logger = LogManager.getLogger(RestAcknowledgeAlertAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeChainedAlertsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeChainedAlertsAction.kt index 968856a48..34b663cf4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeChainedAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeChainedAlertsAction.kt @@ -8,7 +8,6 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger import org.opensearch.alerting.AlertingPlugin -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AcknowledgeChainedAlertRequest import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.core.xcontent.XContentParser @@ -19,6 +18,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log: Logger = LogManager.getLogger(RestAcknowledgeAlertAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteAlertingCommentAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteAlertingCommentAction.kt index 024b79970..0c5f956db 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteAlertingCommentAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteAlertingCommentAction.kt @@ -8,13 +8,13 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger import org.opensearch.alerting.AlertingPlugin -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.DeleteCommentRequest import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log: Logger = LogManager.getLogger(RestDeleteMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteMonitorAction.kt index bf6e63f68..bebad4bd1 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteMonitorAction.kt @@ -9,7 +9,6 @@ import org.apache.logging.log4j.Logger import org.opensearch.action.support.WriteRequest.RefreshPolicy import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.REFRESH -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.DeleteMonitorRequest import org.opensearch.rest.BaseRestHandler @@ -19,6 +18,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.DELETE import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log: Logger = LogManager.getLogger(RestDeleteMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt index a61a9b51c..db64181ef 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt @@ -9,13 +9,13 @@ import org.apache.logging.log4j.LogManager import org.opensearch.action.support.WriteRequest import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.REFRESH -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.DeleteWorkflowRequest import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteMonitorAction.kt index 86e93bd65..4dd4f588b 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteMonitorAction.kt @@ -9,7 +9,6 @@ import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.ExecuteMonitorAction import org.opensearch.alerting.action.ExecuteMonitorRequest -import org.opensearch.client.node.NodeClient import org.opensearch.common.unit.TimeValue import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.util.AlertingException @@ -22,6 +21,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.time.Instant private val log = LogManager.getLogger(RestExecuteMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteWorkflowAction.kt index de8da1bac..096f03010 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteWorkflowAction.kt @@ -9,7 +9,6 @@ import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.ExecuteWorkflowAction import org.opensearch.alerting.action.ExecuteWorkflowRequest -import org.opensearch.client.node.NodeClient import org.opensearch.common.unit.TimeValue import org.opensearch.commons.alerting.model.Workflow import org.opensearch.core.xcontent.XContentParser @@ -18,6 +17,7 @@ import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient import java.time.Instant private val log = LogManager.getLogger(RestExecuteWorkflowAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetAlertsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetAlertsAction.kt index aabcf8d6c..d147aa299 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetAlertsAction.kt @@ -7,7 +7,6 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetAlertsRequest import org.opensearch.commons.alerting.model.Table @@ -18,6 +17,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient /** * This class consists of the REST handler to retrieve alerts . diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetDestinationsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetDestinationsAction.kt index 7e5e1530f..2323aa80f 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetDestinationsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetDestinationsAction.kt @@ -10,7 +10,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.GetDestinationsAction import org.opensearch.alerting.action.GetDestinationsRequest import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.model.Table import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer @@ -20,6 +19,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestActions import org.opensearch.rest.action.RestToXContentListener import org.opensearch.search.fetch.subphase.FetchSourceContext +import org.opensearch.transport.client.node.NodeClient /** * This class consists of the REST handler to retrieve destinations . diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailAccountAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailAccountAction.kt index ba5dbdb8a..0190cc490 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailAccountAction.kt @@ -9,7 +9,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.GetEmailAccountAction import org.opensearch.alerting.action.GetEmailAccountRequest import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler.ReplacedRoute import org.opensearch.rest.RestHandler.Route @@ -17,6 +16,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestActions import org.opensearch.rest.action.RestToXContentListener import org.opensearch.search.fetch.subphase.FetchSourceContext +import org.opensearch.transport.client.node.NodeClient import java.lang.IllegalArgumentException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailGroupAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailGroupAction.kt index 7fe37c17c..8b654bdb7 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetEmailGroupAction.kt @@ -9,7 +9,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.GetEmailGroupAction import org.opensearch.alerting.action.GetEmailGroupRequest import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler.ReplacedRoute import org.opensearch.rest.RestHandler.Route @@ -17,6 +16,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestActions import org.opensearch.rest.action.RestToXContentListener import org.opensearch.search.fetch.subphase.FetchSourceContext +import org.opensearch.transport.client.node.NodeClient import java.lang.IllegalArgumentException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetFindingsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetFindingsAction.kt index 75607a701..ebcb447c3 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetFindingsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetFindingsAction.kt @@ -7,7 +7,6 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetFindingsRequest import org.opensearch.commons.alerting.model.Table @@ -17,6 +16,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient /** * This class consists of the REST handler to search findings . diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetMonitorAction.kt index 54270b717..888038883 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetMonitorAction.kt @@ -7,7 +7,6 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetMonitorRequest import org.opensearch.rest.BaseRestHandler @@ -20,6 +19,7 @@ import org.opensearch.rest.RestRequest.Method.HEAD import org.opensearch.rest.action.RestActions import org.opensearch.rest.action.RestToXContentListener import org.opensearch.search.fetch.subphase.FetchSourceContext +import org.opensearch.transport.client.node.NodeClient private val log = LogManager.getLogger(RestGetMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetRemoteIndexesAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetRemoteIndexesAction.kt index 5d91767bd..5187e2a05 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetRemoteIndexesAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetRemoteIndexesAction.kt @@ -9,12 +9,12 @@ import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.GetRemoteIndexesAction import org.opensearch.alerting.action.GetRemoteIndexesRequest -import org.opensearch.client.node.NodeClient import org.opensearch.core.common.Strings import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient private val log = LogManager.getLogger(RestGetRemoteIndexesAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt index 1a2ca4426..6af0b4604 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt @@ -8,7 +8,6 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetWorkflowRequest import org.opensearch.rest.BaseRestHandler @@ -16,6 +15,7 @@ import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.action.RestToXContentListener import org.opensearch.search.fetch.subphase.FetchSourceContext +import org.opensearch.transport.client.node.NodeClient /** * This class consists of the REST handler to retrieve a workflow . diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAlertsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAlertsAction.kt index 474c32d4a..5356ba730 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAlertsAction.kt @@ -7,7 +7,6 @@ package org.opensearch.alerting.resthandler import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetWorkflowAlertsRequest import org.opensearch.commons.alerting.model.Table @@ -18,6 +17,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient /** * This class consists of the REST handler to retrieve chained alerts by workflow id. diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexAlertingCommentAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexAlertingCommentAction.kt index 9dc2cb756..0b9905ebb 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexAlertingCommentAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexAlertingCommentAction.kt @@ -9,7 +9,6 @@ import org.apache.logging.log4j.LogManager import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.IF_PRIMARY_TERM import org.opensearch.alerting.util.IF_SEQ_NO -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.IndexCommentRequest import org.opensearch.commons.alerting.action.IndexCommentResponse @@ -26,6 +25,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log = LogManager.getLogger(RestIndexMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt index e9b973c9c..5f753edd1 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt @@ -11,7 +11,6 @@ import org.opensearch.alerting.alerts.AlertIndices import org.opensearch.alerting.util.IF_PRIMARY_TERM import org.opensearch.alerting.util.IF_SEQ_NO import org.opensearch.alerting.util.REFRESH -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.IndexMonitorRequest import org.opensearch.commons.alerting.action.IndexMonitorResponse @@ -41,6 +40,7 @@ import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.RestRequest.Method.PUT import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException import java.time.Instant import java.util.* diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt index e8837c3f4..032c7921b 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt @@ -9,7 +9,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.util.IF_PRIMARY_TERM import org.opensearch.alerting.util.IF_SEQ_NO import org.opensearch.alerting.util.REFRESH -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.IndexWorkflowRequest import org.opensearch.commons.alerting.action.IndexWorkflowResponse @@ -28,6 +27,7 @@ import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener +import org.opensearch.transport.client.node.NodeClient import java.io.IOException import java.time.Instant diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchAlertingCommentAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchAlertingCommentAction.kt index 821d6639e..f2afd0195 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchAlertingCommentAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchAlertingCommentAction.kt @@ -11,7 +11,6 @@ import org.opensearch.action.search.SearchResponse import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.comments.CommentsIndices.Companion.ALL_COMMENTS_INDEX_PATTERN import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory.jsonBuilder import org.opensearch.common.xcontent.XContentType @@ -29,6 +28,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log = LogManager.getLogger(RestIndexMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailAccountAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailAccountAction.kt index 66281942a..0777a9aa8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailAccountAction.kt @@ -11,7 +11,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.SearchEmailAccountAction import org.opensearch.alerting.model.destination.email.EmailAccount import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory.jsonBuilder import org.opensearch.common.xcontent.XContentType @@ -29,6 +28,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.node.NodeClient import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailGroupAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailGroupAction.kt index 4550bb4a9..1dcd44e66 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailGroupAction.kt @@ -11,7 +11,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.action.SearchEmailGroupAction import org.opensearch.alerting.model.destination.email.EmailGroup import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentType @@ -30,6 +29,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.node.NodeClient import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchMonitorAction.kt index 6df5641e9..6a38cb85c 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchMonitorAction.kt @@ -12,7 +12,6 @@ import org.opensearch.alerting.AlertingPlugin import org.opensearch.alerting.alerts.AlertIndices.Companion.ALL_ALERT_INDEX_PATTERN import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.context -import org.opensearch.client.node.NodeClient import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler @@ -37,6 +36,7 @@ import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.RestResponse import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.node.NodeClient import java.io.IOException private val log = LogManager.getLogger(RestSearchMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt index a0bccec0a..f2cc34f58 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt @@ -28,7 +28,6 @@ import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.util.ScheduledJobUtils.Companion.WORKFLOW_DELEGATE_PATH import org.opensearch.alerting.util.ScheduledJobUtils.Companion.WORKFLOW_MONITOR_PATH import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.commons.alerting.action.DeleteMonitorResponse import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob @@ -39,6 +38,7 @@ import org.opensearch.index.reindex.BulkByScrollResponse import org.opensearch.index.reindex.DeleteByQueryAction import org.opensearch.index.reindex.DeleteByQueryRequestBuilder import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.Client import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException import kotlin.coroutines.suspendCoroutine diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt index 5f19ecc6f..54667e125 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt @@ -8,13 +8,13 @@ package org.opensearch.alerting.transport import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException import org.opensearch.alerting.settings.AlertingSettings -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.commons.ConfigConstants import org.opensearch.commons.alerting.util.AlertingException import org.opensearch.commons.authuser.User import org.opensearch.core.action.ActionListener import org.opensearch.core.rest.RestStatus +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(SecureTransportAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeAlertAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeAlertAction.kt index 927a976ab..6cc60732a 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeAlertAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeAlertAction.kt @@ -23,7 +23,6 @@ import org.opensearch.action.update.UpdateRequest import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -51,6 +50,7 @@ import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Instant import java.util.Locale diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeChainedAlertAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeChainedAlertAction.kt index 5f5974163..1d94cc2f8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeChainedAlertAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeChainedAlertAction.kt @@ -28,7 +28,6 @@ import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.ScheduledJobUtils import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -56,6 +55,7 @@ import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Instant import java.util.Locale diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteAlertingCommentAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteAlertingCommentAction.kt index f31510d52..09f8d2e00 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteAlertingCommentAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteAlertingCommentAction.kt @@ -19,7 +19,6 @@ import org.opensearch.action.support.HandledTransportAction import org.opensearch.alerting.comments.CommentsIndices.Companion.ALL_COMMENTS_INDEX_PATTERN import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -42,6 +41,7 @@ import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) private val log = LogManager.getLogger(TransportDeleteAlertingCommentAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt index 1b4187b91..b28311bd0 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt @@ -19,7 +19,6 @@ import org.opensearch.action.support.WriteRequest.RefreshPolicy import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.service.DeleteMonitorService import org.opensearch.alerting.settings.AlertingSettings -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -39,6 +38,7 @@ import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) private val log = LogManager.getLogger(TransportDeleteMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt index 5a965689a..bf0d44eab 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt @@ -31,7 +31,6 @@ import org.opensearch.alerting.service.DeleteMonitorService import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.ScheduledJobUtils.Companion.WORKFLOW_DELEGATE_PATH import org.opensearch.alerting.util.ScheduledJobUtils.Companion.WORKFLOW_MONITOR_PATH -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -62,6 +61,7 @@ import org.opensearch.index.reindex.DeleteByQueryRequestBuilder import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDocLevelMonitorFanOutAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDocLevelMonitorFanOutAction.kt index 7e6f2ed1d..1e5990a40 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDocLevelMonitorFanOutAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDocLevelMonitorFanOutAction.kt @@ -63,8 +63,6 @@ import org.opensearch.alerting.util.isTestAction import org.opensearch.alerting.util.parseSampleDocTags import org.opensearch.alerting.util.printsSampleDocData import org.opensearch.alerting.util.use -import org.opensearch.client.Client -import org.opensearch.client.node.NodeClient import org.opensearch.cluster.routing.Preference import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject @@ -122,6 +120,8 @@ import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.search.sort.SortOrder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client +import org.opensearch.transport.client.node.NodeClient import java.io.IOException import java.time.Instant import java.util.UUID diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt index d10ba5d8d..f2769ad70 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt @@ -24,7 +24,6 @@ import org.opensearch.alerting.action.ExecuteMonitorResponse import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.DocLevelMonitorQueries import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -42,6 +41,7 @@ import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Instant import java.util.Locale diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteWorkflowAction.kt index da48d1da8..8b3272e74 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteWorkflowAction.kt @@ -19,7 +19,6 @@ import org.opensearch.alerting.action.ExecuteWorkflowAction import org.opensearch.alerting.action.ExecuteWorkflowRequest import org.opensearch.alerting.action.ExecuteWorkflowResponse import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper @@ -34,6 +33,7 @@ import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Instant private val log = LogManager.getLogger(TransportExecuteWorkflowAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt index 0c307227f..1fc3ef83a 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt @@ -21,7 +21,6 @@ import org.opensearch.alerting.opensearchapi.addFilter import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -50,6 +49,7 @@ import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.io.IOException private val log = LogManager.getLogger(TransportGetAlertsAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt index e73395cae..60e5edb9d 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt @@ -17,7 +17,6 @@ import org.opensearch.alerting.model.destination.Destination import org.opensearch.alerting.opensearchapi.addFilter import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -40,6 +39,7 @@ import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.io.IOException private val log = LogManager.getLogger(TransportGetDestinationsAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailAccountAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailAccountAction.kt index 1f2a2704a..bbcf02cfb 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailAccountAction.kt @@ -18,7 +18,6 @@ import org.opensearch.alerting.model.destination.email.EmailAccount import org.opensearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST import org.opensearch.alerting.util.DestinationType import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -32,6 +31,7 @@ import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(TransportGetEmailAccountAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailGroupAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailGroupAction.kt index 509821b27..88becd6ba 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailGroupAction.kt @@ -18,7 +18,6 @@ import org.opensearch.alerting.model.destination.email.EmailGroup import org.opensearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST import org.opensearch.alerting.util.DestinationType import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -32,6 +31,7 @@ import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(TransportGetEmailGroupAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt index 9c4187bce..c4a1f2dbb 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt @@ -22,7 +22,6 @@ import org.opensearch.alerting.alerts.AlertIndices.Companion.ALL_FINDING_INDEX_P import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -53,6 +52,7 @@ import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(TransportGetFindingsSearchAction::class.java) private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetMonitorAction.kt index 6e3d08507..ce42e6157 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetMonitorAction.kt @@ -23,7 +23,6 @@ import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.ScheduledJobUtils.Companion.WORKFLOW_DELEGATE_PATH import org.opensearch.alerting.util.ScheduledJobUtils.Companion.WORKFLOW_MONITOR_PATH import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -46,6 +45,7 @@ import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(TransportGetMonitorAction::class.java) private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetRemoteIndexesAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetRemoteIndexesAction.kt index 7253162fa..b106903a8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetRemoteIndexesAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetRemoteIndexesAction.kt @@ -29,7 +29,6 @@ import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.settings.AlertingSettings.Companion.CROSS_CLUSTER_MONITORING_ENABLED import org.opensearch.alerting.util.CrossClusterMonitorUtils -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -39,6 +38,7 @@ import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.time.Duration import java.time.Instant diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAction.kt index 2671049b7..d0d3e45f7 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAction.kt @@ -13,7 +13,6 @@ import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -32,6 +31,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.IndexNotFoundException import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client class TransportGetWorkflowAction @Inject constructor( transportService: TransportService, diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAlertsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAlertsAction.kt index cf8244b8c..dd26bf032 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAlertsAction.kt @@ -19,7 +19,6 @@ import org.opensearch.alerting.opensearchapi.addFilter import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -46,6 +45,7 @@ import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.io.IOException private val log = LogManager.getLogger(TransportGetAlertsAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexAlertingCommentAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexAlertingCommentAction.kt index 43a3ed147..8592c505c 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexAlertingCommentAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexAlertingCommentAction.kt @@ -28,7 +28,6 @@ import org.opensearch.alerting.settings.AlertingSettings.Companion.COMMENTS_MAX_ import org.opensearch.alerting.settings.AlertingSettings.Companion.INDEX_TIMEOUT import org.opensearch.alerting.settings.AlertingSettings.Companion.MAX_COMMENTS_PER_ALERT import org.opensearch.alerting.util.CommentsUtils -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -55,6 +54,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.lang.IllegalArgumentException import java.time.Instant diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt index f7c050290..ae87c101d 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt @@ -45,7 +45,6 @@ import org.opensearch.alerting.util.addUserBackendRolesFilter import org.opensearch.alerting.util.getRoleFilterEnabled import org.opensearch.alerting.util.isADMonitor import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -83,6 +82,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.io.IOException import java.time.Duration import java.util.Locale diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt index b1df87032..91a9f66e6 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt @@ -46,7 +46,6 @@ import org.opensearch.alerting.util.isADMonitor import org.opensearch.alerting.util.isQueryLevelMonitor import org.opensearch.alerting.util.use import org.opensearch.alerting.workflow.CompositeWorkflowRunner -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -80,6 +79,7 @@ import org.opensearch.rest.RestRequest import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.util.Locale import java.util.UUID import java.util.stream.Collectors diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchAlertingCommentAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchAlertingCommentAction.kt index e15a5759f..9e8c3d153 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchAlertingCommentAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchAlertingCommentAction.kt @@ -19,7 +19,6 @@ import org.opensearch.alerting.alerts.AlertIndices.Companion.ALL_ALERT_INDEX_PAT import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -44,6 +43,7 @@ import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.io.IOException private val log = LogManager.getLogger(TransportSearchAlertingCommentAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailAccountAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailAccountAction.kt index e8c190c1c..b63d9a488 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailAccountAction.kt @@ -14,7 +14,6 @@ import org.opensearch.alerting.action.SearchEmailAccountAction import org.opensearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST import org.opensearch.alerting.util.DestinationType import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -23,6 +22,7 @@ import org.opensearch.core.action.ActionListener import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client class TransportSearchEmailAccountAction @Inject constructor( transportService: TransportService, diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailGroupAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailGroupAction.kt index fdb7fb956..f6b3b92d1 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailGroupAction.kt @@ -14,7 +14,6 @@ import org.opensearch.alerting.action.SearchEmailGroupAction import org.opensearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST import org.opensearch.alerting.util.DestinationType import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -23,6 +22,7 @@ import org.opensearch.core.action.ActionListener import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client class TransportSearchEmailGroupAction @Inject constructor( transportService: TransportService, diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt index 59007d15b..73a883de4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchMonitorAction.kt @@ -14,7 +14,6 @@ import org.opensearch.action.support.HandledTransportAction import org.opensearch.alerting.opensearchapi.addFilter import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.use -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -34,6 +33,7 @@ import org.opensearch.index.query.MatchQueryBuilder import org.opensearch.index.query.QueryBuilders import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client private val log = LogManager.getLogger(TransportSearchMonitorAction::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/CommentsUtils.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/CommentsUtils.kt index 15cc50c27..d24959452 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/CommentsUtils.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/CommentsUtils.kt @@ -10,7 +10,6 @@ import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.alerting.comments.CommentsIndices.Companion.ALL_COMMENTS_INDEX_PATTERN import org.opensearch.alerting.opensearchapi.suspendUntil -import org.opensearch.client.Client import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper import org.opensearch.common.xcontent.XContentType @@ -24,6 +23,7 @@ import org.opensearch.index.reindex.BulkByScrollResponse import org.opensearch.index.reindex.DeleteByQueryAction import org.opensearch.index.reindex.DeleteByQueryRequestBuilder import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.Client import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException import kotlin.coroutines.suspendCoroutine diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/CrossClusterMonitorUtils.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/CrossClusterMonitorUtils.kt index b9ddaf187..ade8494f0 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/CrossClusterMonitorUtils.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/CrossClusterMonitorUtils.kt @@ -6,13 +6,13 @@ package org.opensearch.alerting.util import org.opensearch.action.search.SearchRequest -import org.opensearch.client.Client -import org.opensearch.client.node.NodeClient import org.opensearch.cluster.service.ClusterService import org.opensearch.commons.alerting.model.ClusterMetricsInput import org.opensearch.commons.alerting.model.DocLevelMonitorInput import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.SearchInput +import org.opensearch.transport.client.Client +import org.opensearch.transport.client.node.NodeClient class CrossClusterMonitorUtils { companion object { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt index 1d7d768f9..55c8e682c 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt @@ -29,7 +29,6 @@ import org.opensearch.action.support.WriteRequest.RefreshPolicy import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.alerting.MonitorRunnerService.monitorCtx import org.opensearch.alerting.opensearchapi.suspendUntil -import org.opensearch.client.Client import org.opensearch.cluster.ClusterState import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.cluster.service.ClusterService @@ -50,6 +49,7 @@ import org.opensearch.index.query.QueryBuilders import org.opensearch.index.reindex.BulkByScrollResponse import org.opensearch.index.reindex.DeleteByQueryAction import org.opensearch.index.reindex.DeleteByQueryRequestBuilder +import org.opensearch.transport.client.Client import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException import kotlin.coroutines.suspendCoroutine diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/SupportedClusterMetricsSettingsExtensions.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/SupportedClusterMetricsSettingsExtensions.kt index a1c86d2f5..18afc6cc4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/SupportedClusterMetricsSettingsExtensions.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/SupportedClusterMetricsSettingsExtensions.kt @@ -28,12 +28,12 @@ import org.opensearch.alerting.opensearchapi.convertToMap import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.settings.SupportedClusterMetricsSettings import org.opensearch.alerting.settings.SupportedClusterMetricsSettings.Companion.resolveToActionRequest -import org.opensearch.client.Client import org.opensearch.cluster.metadata.Metadata import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.support.XContentMapValues import org.opensearch.commons.alerting.model.ClusterMetricsInput import org.opensearch.core.action.ActionResponse +import org.opensearch.transport.client.Client /** * Calls the appropriate transport action for the API requested in the [clusterMetricsInput]. diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt index fbb3b1527..9ef0aea37 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt @@ -11,8 +11,6 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager import org.opensearch.alerting.core.ScheduledJobIndices -import org.opensearch.client.Client -import org.opensearch.client.node.NodeClient import org.opensearch.cluster.ClusterChangedEvent import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.service.ClusterService @@ -20,6 +18,8 @@ import org.opensearch.common.lifecycle.LifecycleListener import org.opensearch.common.unit.TimeValue import org.opensearch.threadpool.Scheduler import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client +import org.opensearch.transport.client.node.NodeClient import kotlin.coroutines.CoroutineContext class DestinationMigrationCoordinator( diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilService.kt index 508118dc0..0acfb66a2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilService.kt @@ -21,7 +21,6 @@ import org.opensearch.alerting.util.destinationmigration.DestinationConversionUt import org.opensearch.alerting.util.destinationmigration.DestinationConversionUtils.Companion.convertEmailGroupToNotificationConfig import org.opensearch.alerting.util.destinationmigration.NotificationApiUtils.Companion.createNotificationConfig import org.opensearch.alerting.util.use -import org.opensearch.client.node.NodeClient import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.ConfigConstants @@ -37,6 +36,7 @@ import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.fetch.subphase.FetchSourceContext +import org.opensearch.transport.client.node.NodeClient import java.time.Instant class DestinationMigrationUtilService { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt index 4278907d3..1698de794 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/NotificationApiUtils.kt @@ -13,8 +13,6 @@ import org.opensearch.alerting.model.destination.Destination import org.opensearch.alerting.opensearchapi.retryForNotification import org.opensearch.alerting.opensearchapi.suspendUntil import org.opensearch.alerting.util.use -import org.opensearch.client.Client -import org.opensearch.client.node.NodeClient import org.opensearch.common.unit.TimeValue import org.opensearch.commons.ConfigConstants import org.opensearch.commons.destination.message.LegacyBaseMessage @@ -31,6 +29,8 @@ import org.opensearch.commons.notifications.model.EventSource import org.opensearch.commons.notifications.model.NotificationConfigInfo import org.opensearch.commons.notifications.model.SeverityType import org.opensearch.core.rest.RestStatus +import org.opensearch.transport.client.Client +import org.opensearch.transport.client.node.NodeClient class NotificationApiUtils { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/workflow/WorkflowRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/workflow/WorkflowRunner.kt index 6c90a64be..ea24da3a6 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/workflow/WorkflowRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/workflow/WorkflowRunner.kt @@ -24,7 +24,6 @@ import org.opensearch.alerting.util.destinationmigration.sendNotification import org.opensearch.alerting.util.isAllowed import org.opensearch.alerting.util.isTestAction import org.opensearch.alerting.util.use -import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.model.ActionRunResult import org.opensearch.commons.alerting.model.Table import org.opensearch.commons.alerting.model.Workflow @@ -35,6 +34,7 @@ import org.opensearch.core.common.Strings import org.opensearch.script.Script import org.opensearch.script.TemplateScript import org.opensearch.transport.TransportService +import org.opensearch.transport.client.node.NodeClient import java.time.Instant abstract class WorkflowRunner { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/AlertServiceTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/AlertServiceTests.kt index 2da1c5830..aacfa58a8 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/AlertServiceTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/AlertServiceTests.kt @@ -11,7 +11,6 @@ import org.opensearch.Version import org.opensearch.alerting.alerts.AlertIndices import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.util.getBucketKeysHash -import org.opensearch.client.Client import org.opensearch.cluster.node.DiscoveryNode import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.ClusterSettings @@ -26,6 +25,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.test.ClusterServiceUtils import org.opensearch.test.OpenSearchTestCase import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt b/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt index b67f278b2..e08b1360f 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt @@ -17,7 +17,6 @@ import org.opensearch.alerting.core.settings.ScheduledJobSettings.Companion.SWEE import org.opensearch.alerting.core.settings.ScheduledJobSettings.Companion.SWEEP_PERIOD import org.opensearch.alerting.opensearchapi.firstFailureOrNull import org.opensearch.alerting.opensearchapi.retry -import org.opensearch.client.Client import org.opensearch.cluster.ClusterChangedEvent import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.routing.IndexShardRoutingTable @@ -48,6 +47,7 @@ import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.FieldSortBuilder import org.opensearch.threadpool.Scheduler import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import java.util.TreeMap import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.Executors diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/ScheduledJobIndices.kt b/core/src/main/kotlin/org/opensearch/alerting/core/ScheduledJobIndices.kt index a71a7e64f..87c8d362e 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/ScheduledJobIndices.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/ScheduledJobIndices.kt @@ -7,12 +7,12 @@ package org.opensearch.alerting.core import org.opensearch.action.admin.indices.create.CreateIndexRequest import org.opensearch.action.admin.indices.create.CreateIndexResponse -import org.opensearch.client.AdminClient import org.opensearch.cluster.health.ClusterIndexHealth import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.core.action.ActionListener +import org.opensearch.transport.client.AdminClient /** * Initialize the OpenSearch components required to run [ScheduledJobs]. diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/lock/LockService.kt b/core/src/main/kotlin/org/opensearch/alerting/core/lock/LockService.kt index 0c558038d..fd88fc56f 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/lock/LockService.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/lock/LockService.kt @@ -13,7 +13,6 @@ import org.opensearch.action.index.IndexRequest import org.opensearch.action.index.IndexResponse import org.opensearch.action.update.UpdateRequest import org.opensearch.action.update.UpdateResponse -import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue @@ -28,6 +27,7 @@ import org.opensearch.index.IndexNotFoundException import org.opensearch.index.engine.DocumentMissingException import org.opensearch.index.engine.VersionConflictEngineException import org.opensearch.index.seqno.SequenceNumbers +import org.opensearch.transport.client.Client import java.io.IOException import java.time.Instant import java.util.concurrent.TimeUnit diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/resthandler/RestScheduledJobStatsHandler.kt b/core/src/main/kotlin/org/opensearch/alerting/core/resthandler/RestScheduledJobStatsHandler.kt index c79c260b9..fbe57ab19 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/resthandler/RestScheduledJobStatsHandler.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/resthandler/RestScheduledJobStatsHandler.kt @@ -7,7 +7,6 @@ package org.opensearch.alerting.core.resthandler import org.opensearch.alerting.core.action.node.ScheduledJobsStatsAction import org.opensearch.alerting.core.action.node.ScheduledJobsStatsRequest -import org.opensearch.client.node.NodeClient import org.opensearch.core.common.Strings import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer @@ -16,6 +15,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.action.RestActions +import org.opensearch.transport.client.node.NodeClient import java.util.Locale import java.util.TreeSet diff --git a/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt b/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt index 3e87f207f..582d13fbe 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt @@ -14,7 +14,6 @@ import org.opensearch.OpenSearchException import org.opensearch.action.bulk.BackoffPolicy import org.opensearch.action.search.SearchResponse import org.opensearch.action.search.ShardSearchFailure -import org.opensearch.client.OpenSearchClient import org.opensearch.common.settings.Settings import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.common.xcontent.XContentHelper @@ -31,6 +30,7 @@ import org.opensearch.core.xcontent.ToXContent import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.transport.client.OpenSearchClient import kotlin.coroutines.CoroutineContext import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException diff --git a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorPlugin.java b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorPlugin.java index b73d440f6..7e1ce8992 100644 --- a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorPlugin.java +++ b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorPlugin.java @@ -14,7 +14,6 @@ import org.opensearch.alerting.monitor.runners.SampleRemoteMonitorRunner2; import org.opensearch.alerting.spi.RemoteMonitorRunner; import org.opensearch.alerting.spi.RemoteMonitorRunnerExtension; -import org.opensearch.client.Client; import org.opensearch.cluster.metadata.IndexNameExpressionResolver; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; @@ -34,6 +33,7 @@ import org.opensearch.rest.RestHandler; import org.opensearch.script.ScriptService; import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.client.Client; import org.opensearch.watcher.ResourceWatcherService; import reactor.util.annotation.NonNull; diff --git a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorRestHandler.java b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorRestHandler.java index 91c97a636..17a29cf54 100644 --- a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorRestHandler.java +++ b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/SampleRemoteMonitorRestHandler.java @@ -10,7 +10,6 @@ import org.opensearch.alerting.monitor.inputs.SampleRemoteMonitorInput1; import org.opensearch.alerting.monitor.inputs.SampleRemoteMonitorInput2; import org.opensearch.alerting.monitor.triggers.SampleRemoteMonitorTrigger1; -import org.opensearch.client.node.NodeClient; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.commons.alerting.action.AlertingActions; @@ -37,6 +36,7 @@ import org.opensearch.rest.RestResponse; import org.opensearch.script.Script; import org.opensearch.script.ScriptType; +import org.opensearch.transport.client.node.NodeClient; import java.io.IOException; import java.time.Instant; diff --git a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/fanouts/TransportRemoteDocLevelMonitorFanOutAction.java b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/fanouts/TransportRemoteDocLevelMonitorFanOutAction.java index 1be9255fe..a70df47ee 100644 --- a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/fanouts/TransportRemoteDocLevelMonitorFanOutAction.java +++ b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/fanouts/TransportRemoteDocLevelMonitorFanOutAction.java @@ -13,7 +13,6 @@ import org.opensearch.alerting.monitor.inputs.SampleRemoteDocLevelMonitorInput; import org.opensearch.alerting.monitor.runners.SampleRemoteDocLevelMonitorRunner; import org.opensearch.alerting.monitor.triggers.SampleRemoteMonitorTrigger1; -import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; import org.opensearch.common.settings.Settings; @@ -31,6 +30,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; +import org.opensearch.transport.client.Client; import java.util.HashMap; import java.util.Map; diff --git a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner1.java b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner1.java index f2e67f460..1227b9fa1 100644 --- a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner1.java +++ b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner1.java @@ -13,7 +13,6 @@ import org.opensearch.alerting.monitor.trigger.results.SampleRemoteMonitorTriggerRunResult; import org.opensearch.alerting.monitor.triggers.SampleRemoteMonitorTrigger1; import org.opensearch.alerting.spi.RemoteMonitorRunner; -import org.opensearch.client.Client; import org.opensearch.commons.alerting.model.Input; import org.opensearch.commons.alerting.model.InputRunResults; import org.opensearch.commons.alerting.model.Monitor; @@ -25,6 +24,7 @@ import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.transport.TransportService; +import org.opensearch.transport.client.Client; import java.time.Instant; import java.util.Map; diff --git a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner2.java b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner2.java index 31f732b51..db06d8f70 100644 --- a/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner2.java +++ b/sample-remote-monitor-plugin/src/main/java/org/opensearch/alerting/monitor/runners/SampleRemoteMonitorRunner2.java @@ -12,7 +12,6 @@ import org.opensearch.alerting.monitor.inputs.SampleRemoteMonitorInput2; import org.opensearch.alerting.monitor.trigger.results.SampleRemoteMonitorTriggerRunResult; import org.opensearch.alerting.spi.RemoteMonitorRunner; -import org.opensearch.client.Client; import org.opensearch.commons.alerting.model.Input; import org.opensearch.commons.alerting.model.InputRunResults; import org.opensearch.commons.alerting.model.Monitor; @@ -22,6 +21,7 @@ import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.transport.TransportService; +import org.opensearch.transport.client.Client; import java.time.Instant; import java.util.Map;