From 5fb8b21136966aaba657783269ec8abb868bfa17 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Thu, 13 Jul 2023 09:08:52 -0700 Subject: [PATCH 1/4] Update imports for files refactored in core PR #8157 Signed-off-by: Ashish Agrawal --- .../percolator/PercolateQueryBuilderExt.java | 12 ++++++------ .../percolator/PercolatorFieldMapperExt.java | 6 +++--- .../kotlin/org/opensearch/alerting/AlertService.kt | 8 ++++---- .../kotlin/org/opensearch/alerting/AlertingPlugin.kt | 4 ++-- .../opensearch/alerting/BucketLevelMonitorRunner.kt | 2 +- .../alerting/DocumentLevelMonitorRunner.kt | 4 ++-- .../kotlin/org/opensearch/alerting/InputService.kt | 4 ++-- .../opensearch/alerting/MonitorMetadataService.kt | 4 ++-- .../opensearch/alerting/WorkflowMetadataService.kt | 4 ++-- .../org/opensearch/alerting/WorkflowService.kt | 2 +- .../alerting/action/ExecuteMonitorRequest.kt | 4 ++-- .../alerting/action/ExecuteMonitorResponse.kt | 4 ++-- .../alerting/action/ExecuteWorkflowRequest.kt | 4 ++-- .../alerting/action/ExecuteWorkflowResponse.kt | 4 ++-- .../alerting/action/GetDestinationsRequest.kt | 4 ++-- .../alerting/action/GetDestinationsResponse.kt | 6 +++--- .../alerting/action/GetEmailAccountRequest.kt | 4 ++-- .../alerting/action/GetEmailAccountResponse.kt | 6 +++--- .../alerting/action/GetEmailGroupRequest.kt | 4 ++-- .../alerting/action/GetEmailGroupResponse.kt | 6 +++--- .../opensearch/alerting/action/GetMonitorRequest.kt | 4 ++-- .../opensearch/alerting/action/GetMonitorResponse.kt | 6 +++--- .../alerting/action/SearchMonitorRequest.kt | 4 ++-- .../org/opensearch/alerting/alerts/AlertMover.kt | 6 +++--- .../alerting/model/AlertingConfigAccessor.kt | 2 +- .../alerting/model/BucketLevelTriggerRunResult.kt | 4 ++-- .../alerting/model/ChainedAlertTriggerRunResult.kt | 4 ++-- .../alerting/model/DocumentLevelTriggerRunResult.kt | 4 ++-- .../org/opensearch/alerting/model/MonitorMetadata.kt | 8 ++++---- .../opensearch/alerting/model/MonitorRunResult.kt | 6 +++--- .../alerting/model/QueryLevelTriggerRunResult.kt | 4 ++-- .../opensearch/alerting/model/TriggerRunResult.kt | 4 ++-- .../opensearch/alerting/model/WorkflowMetadata.kt | 8 ++++---- .../opensearch/alerting/model/WorkflowRunResult.kt | 6 +++--- .../opensearch/alerting/model/destination/Chime.kt | 6 +++--- .../alerting/model/destination/CustomWebhook.kt | 6 +++--- .../alerting/model/destination/Destination.kt | 6 +++--- .../model/destination/DestinationContextFactory.kt | 2 +- .../org/opensearch/alerting/model/destination/SNS.kt | 2 +- .../opensearch/alerting/model/destination/Slack.kt | 6 +++--- .../alerting/model/destination/email/Email.kt | 8 ++++---- .../alerting/model/destination/email/EmailAccount.kt | 10 +++++----- .../alerting/model/destination/email/EmailGroup.kt | 8 ++++---- .../resthandler/RestAcknowledgeAlertAction.kt | 2 +- .../RestAcknowledgeChainedAlertsAction.kt | 2 +- .../alerting/resthandler/RestExecuteMonitorAction.kt | 2 +- .../resthandler/RestExecuteWorkflowAction.kt | 2 +- .../alerting/resthandler/RestIndexMonitorAction.kt | 11 +++++++++-- .../alerting/resthandler/RestIndexWorkflowAction.kt | 4 ++-- .../resthandler/RestSearchEmailAccountAction.kt | 4 ++-- .../resthandler/RestSearchEmailGroupAction.kt | 5 +++-- .../alerting/resthandler/RestSearchMonitorAction.kt | 4 ++-- .../alerting/settings/DestinationSettings.kt | 2 +- .../settings/LegacyOpenDistroDestinationSettings.kt | 2 +- .../alerting/transport/SecureTransportAction.kt | 2 +- .../transport/TransportAcknowledgeAlertAction.kt | 4 ++-- .../TransportAcknowledgeChainedAlertAction.kt | 4 ++-- .../transport/TransportDeleteMonitorAction.kt | 2 +- .../transport/TransportDeleteWorkflowAction.kt | 2 +- .../transport/TransportExecuteMonitorAction.kt | 2 +- .../transport/TransportExecuteWorkflowAction.kt | 2 +- .../alerting/transport/TransportGetAlertsAction.kt | 2 +- .../transport/TransportGetDestinationsAction.kt | 4 ++-- .../transport/TransportGetEmailAccountAction.kt | 2 +- .../transport/TransportGetEmailGroupAction.kt | 2 +- .../alerting/transport/TransportGetFindingsAction.kt | 2 +- .../alerting/transport/TransportGetMonitorAction.kt | 2 +- .../alerting/transport/TransportGetWorkflowAction.kt | 2 +- .../transport/TransportGetWorkflowAlertsAction.kt | 4 ++-- .../transport/TransportIndexMonitorAction.kt | 4 ++-- .../transport/TransportIndexWorkflowAction.kt | 4 ++-- .../transport/TransportSearchEmailAccountAction.kt | 2 +- .../transport/TransportSearchEmailGroupAction.kt | 2 +- .../opensearch/alerting/util/AlertingException.kt | 2 +- .../alerting/util/DocLevelMonitorQueries.kt | 2 +- .../opensearch/alerting/util/ScheduledJobUtils.kt | 2 +- .../CatIndicesHelpers.kt | 4 ++-- .../clusterMetricsMonitorHelpers/CatShardsHelpers.kt | 4 ++-- .../DestinationMigrationUtilService.kt | 4 ++-- .../destinationmigration/NotificationApiUtils.kt | 2 +- .../alerting/workflow/CompositeWorkflowRunner.kt | 2 +- .../org/opensearch/alerting/AlertingRestTestCase.kt | 4 ++-- .../org/opensearch/alerting/MonitorDataSourcesIT.kt | 4 ++-- .../opensearch/alerting/MonitorRunnerServiceIT.kt | 2 +- .../kotlin/org/opensearch/alerting/TestHelpers.kt | 2 +- .../alerting/action/ExecuteMonitorRequestTests.kt | 2 +- .../alerting/action/ExecuteMonitorResponseTests.kt | 2 +- .../alerting/action/GetDestinationsRequestTests.kt | 2 +- .../alerting/action/GetDestinationsResponseTests.kt | 4 ++-- .../alerting/action/GetEmailAccountRequestTests.kt | 2 +- .../alerting/action/GetEmailAccountResponseTests.kt | 4 ++-- .../alerting/action/GetEmailGroupRequestTests.kt | 2 +- .../alerting/action/GetEmailGroupResponseTests.kt | 4 ++-- .../alerting/action/GetFindingsRequestTests.kt | 2 +- .../alerting/action/GetMonitorRequestTests.kt | 2 +- .../alerting/action/GetMonitorResponseTests.kt | 4 ++-- .../alerting/action/SearchMonitorRequestTests.kt | 2 +- .../org/opensearch/alerting/alerts/AlertIndicesIT.kt | 2 +- .../alerting/bwc/AlertingBackwardsCompatibilityIT.kt | 2 +- .../opensearch/alerting/model/DestinationTests.kt | 2 +- .../org/opensearch/alerting/model/WriteableTests.kt | 2 +- .../alerting/resthandler/EmailAccountRestApiIT.kt | 2 +- .../alerting/resthandler/EmailGroupRestApiIT.kt | 2 +- .../alerting/resthandler/MonitorRestApiIT.kt | 4 ++-- .../resthandler/SecureDestinationRestApiIT.kt | 2 +- .../resthandler/SecureEmailAccountRestApiIT.kt | 2 +- .../resthandler/SecureEmailGroupsRestApiIT.kt | 2 +- .../alerting/resthandler/SecureMonitorRestApiIT.kt | 2 +- .../alerting/resthandler/SecureWorkflowRestApiIT.kt | 2 +- .../alerting/resthandler/WorkflowRestApiIT.kt | 2 +- .../alerting/util/AnomalyDetectionUtilsTests.kt | 2 +- .../DestinationMigrationUtilServiceIT.kt | 2 +- build.gradle | 2 +- .../org/opensearch/alerting/core/JobSweeper.kt | 8 ++++---- .../opensearch/alerting/core/JobSweeperMetrics.kt | 6 +++--- .../alerting/core/action/node/ScheduledJobStats.kt | 4 ++-- .../core/action/node/ScheduledJobsStatsAction.kt | 2 +- .../core/action/node/ScheduledJobsStatsRequest.kt | 4 ++-- .../core/action/node/ScheduledJobsStatsResponse.kt | 4 ++-- .../action/node/ScheduledJobsStatsTransportAction.kt | 4 ++-- .../alerting/core/schedule/JobSchedulerMetrics.kt | 6 +++--- .../alerting/opensearchapi/OpenSearchExtensions.kt | 8 ++++---- .../org/opensearch/alerting/core/WriteableTests.kt | 2 +- .../alerting/core/model/MockScheduledJob.kt | 2 +- 124 files changed, 234 insertions(+), 226 deletions(-) diff --git a/alerting/src/main/java/org/opensearch/percolator/PercolateQueryBuilderExt.java b/alerting/src/main/java/org/opensearch/percolator/PercolateQueryBuilderExt.java index 02a0d2692..6b8634d4f 100644 --- a/alerting/src/main/java/org/opensearch/percolator/PercolateQueryBuilderExt.java +++ b/alerting/src/main/java/org/opensearch/percolator/PercolateQueryBuilderExt.java @@ -61,12 +61,12 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.get.GetRequest; import org.opensearch.core.ParseField; -import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.opensearch.common.io.stream.NamedWriteableRegistry; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.InputStreamStreamInput; +import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ConstructingObjectParser; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.core.xcontent.NamedXContentRegistry; diff --git a/alerting/src/main/java/org/opensearch/percolator/PercolatorFieldMapperExt.java b/alerting/src/main/java/org/opensearch/percolator/PercolatorFieldMapperExt.java index e9e0e013f..8ed81e12b 100644 --- a/alerting/src/main/java/org/opensearch/percolator/PercolatorFieldMapperExt.java +++ b/alerting/src/main/java/org/opensearch/percolator/PercolatorFieldMapperExt.java @@ -56,14 +56,14 @@ import org.apache.lucene.util.BytesRefBuilder; import org.opensearch.Version; import org.opensearch.action.support.PlainActionFuture; -import org.opensearch.common.ParsingException; -import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.collect.Tuple; import org.opensearch.common.hash.MurmurHash3; -import org.opensearch.common.io.stream.OutputStreamStreamOutput; import org.opensearch.common.lucene.search.Queries; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.ParsingException; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput; import org.opensearch.core.xcontent.XContentLocation; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.mapper.BinaryFieldMapper; diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt index 3345691df..5fac12ac8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt @@ -32,12 +32,10 @@ import org.opensearch.alerting.util.MAX_SEARCH_SIZE import org.opensearch.alerting.util.getBucketKeysHash import org.opensearch.alerting.workflow.WorkflowRunContext import org.opensearch.client.Client -import org.opensearch.common.bytes.BytesReference import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.alerts.AlertError import org.opensearch.commons.alerting.model.ActionExecutionResult @@ -50,14 +48,16 @@ import org.opensearch.commons.alerting.model.NoOpTrigger import org.opensearch.commons.alerting.model.Trigger import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.alerting.model.action.AlertCategory +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.VersionType 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.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortOrder import java.time.Instant @@ -248,7 +248,7 @@ class AlertService( } return Alert( id = id, monitor = monitor, trigger = NoOpTrigger(), startTime = currentTime, - lastNotificationTime = currentTime, state = alertState, errorMessage = alertError?.message, + lastNotificationTime = currentTime, state = alertState, errorMessage = alertError.message, schemaVersion = IndexUtils.alertIndexSchemaVersion, executionId = executionId, workflowId = workflowRunContext?.workflowId ?: "" ) } diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt b/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt index 08d446080..cd1a5fbd8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt @@ -75,8 +75,6 @@ import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.node.DiscoveryNodes import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.io.stream.NamedWriteableRegistry -import org.opensearch.common.io.stream.StreamInput import org.opensearch.common.settings.ClusterSettings import org.opensearch.common.settings.IndexScopedSettings import org.opensearch.common.settings.Setting @@ -94,6 +92,8 @@ import org.opensearch.commons.alerting.model.QueryLevelTrigger import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.common.io.stream.NamedWriteableRegistry +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser import org.opensearch.env.Environment diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt index 9a2583701..e960b9da5 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt @@ -37,11 +37,11 @@ import org.opensearch.commons.alerting.model.action.AlertCategory import org.opensearch.commons.alerting.model.action.PerAlertActionScope import org.opensearch.commons.alerting.model.action.PerExecutionActionScope import org.opensearch.commons.alerting.util.string +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.script.ScriptType import org.opensearch.script.TemplateScript diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt index 0aee39b5a..a72671f02 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt @@ -33,7 +33,6 @@ import org.opensearch.client.node.NodeClient import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.cluster.routing.ShardRouting import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.bytes.BytesReference import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.AlertingPluginInterface @@ -48,13 +47,14 @@ import org.opensearch.commons.alerting.model.Finding import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.action.PerAlertActionScope import org.opensearch.commons.alerting.util.string +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.Operator import org.opensearch.index.query.QueryBuilders import org.opensearch.percolator.PercolateQueryBuilderExt -import org.opensearch.rest.RestStatus import org.opensearch.search.SearchHits import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortOrder diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt index 656affc84..39d6b0e48 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/InputService.kt @@ -22,14 +22,14 @@ import org.opensearch.alerting.workflow.WorkflowRunContext import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput -import org.opensearch.common.io.stream.NamedWriteableRegistry import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ClusterMetricsInput import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.SearchInput +import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput +import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.MatchQueryBuilder diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt index ba3f740c4..31721f9a3 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt @@ -35,16 +35,16 @@ import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.DocLevelMonitorInput import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob +import org.opensearch.core.rest.RestStatus 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.index.seqno.SequenceNumbers -import org.opensearch.rest.RestStatus import org.opensearch.transport.RemoteTransportException private val log = LogManager.getLogger(MonitorMetadataService::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt index 7020732fd..9dc4fbcdd 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowMetadataService.kt @@ -29,15 +29,15 @@ import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.CompositeInput import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentParser -import org.opensearch.rest.RestStatus +import org.opensearch.core.xcontent.XContentParserUtils 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 a2c60ce74..b03ee28d2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowService.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/WorkflowService.kt @@ -16,13 +16,13 @@ import org.opensearch.alerting.util.AlertingException import org.opensearch.client.Client import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Finding import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequest.kt index f82994fe6..ecc504677 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequest.kt @@ -7,10 +7,10 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.common.unit.TimeValue import org.opensearch.commons.alerting.model.Monitor +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import java.io.IOException class ExecuteMonitorRequest : ActionRequest { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponse.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponse.kt index a3660b7ef..3bfa2b542 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponse.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponse.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionResponse import org.opensearch.alerting.model.MonitorRunResult -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowRequest.kt index 2d97bbdcc..3b3d48ed2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowRequest.kt @@ -8,10 +8,10 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.common.unit.TimeValue import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowResponse.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowResponse.kt index 300f15f75..5025f2f15 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowResponse.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/ExecuteWorkflowResponse.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionResponse import org.opensearch.alerting.model.WorkflowRunResult -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsRequest.kt index 73b30c535..92fae8247 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsRequest.kt @@ -7,9 +7,9 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.model.Table +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsResponse.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsResponse.kt index bc9d19ee0..744c30142 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsResponse.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetDestinationsResponse.kt @@ -7,12 +7,12 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionResponse import org.opensearch.alerting.model.destination.Destination -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder -import org.opensearch.rest.RestStatus import java.io.IOException class GetDestinationsResponse : ActionResponse, ToXContentObject { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountRequest.kt index 877855a01..94b79726e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.rest.RestRequest import org.opensearch.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountResponse.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountResponse.kt index 8f3713136..fa16f74f4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountResponse.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailAccountResponse.kt @@ -7,16 +7,16 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionResponse import org.opensearch.alerting.model.destination.email.EmailAccount -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.util.IndexUtils.Companion._ID import org.opensearch.commons.alerting.util.IndexUtils.Companion._PRIMARY_TERM import org.opensearch.commons.alerting.util.IndexUtils.Companion._SEQ_NO import org.opensearch.commons.alerting.util.IndexUtils.Companion._VERSION +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder -import org.opensearch.rest.RestStatus import java.io.IOException class GetEmailAccountResponse : ActionResponse, ToXContentObject { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupRequest.kt index 9708b0336..bb245b075 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.rest.RestRequest import org.opensearch.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupResponse.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupResponse.kt index 1240b0c8a..a25804efd 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupResponse.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetEmailGroupResponse.kt @@ -7,16 +7,16 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionResponse import org.opensearch.alerting.model.destination.email.EmailGroup -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.util.IndexUtils.Companion._ID import org.opensearch.commons.alerting.util.IndexUtils.Companion._PRIMARY_TERM import org.opensearch.commons.alerting.util.IndexUtils.Companion._SEQ_NO import org.opensearch.commons.alerting.util.IndexUtils.Companion._VERSION +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder -import org.opensearch.rest.RestStatus import java.io.IOException class GetEmailGroupResponse : ActionResponse, ToXContentObject { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorRequest.kt index 31cc68fc5..365a31f8f 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.rest.RestRequest import org.opensearch.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorResponse.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorResponse.kt index 085c05d1f..2a10f723f 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorResponse.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/GetMonitorResponse.kt @@ -6,18 +6,18 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionResponse -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.util.IndexUtils.Companion._ID import org.opensearch.commons.alerting.util.IndexUtils.Companion._PRIMARY_TERM import org.opensearch.commons.alerting.util.IndexUtils.Companion._SEQ_NO import org.opensearch.commons.alerting.util.IndexUtils.Companion._VERSION +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder -import org.opensearch.rest.RestStatus import java.io.IOException class GetMonitorResponse : ActionResponse, ToXContentObject { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/action/SearchMonitorRequest.kt b/alerting/src/main/kotlin/org/opensearch/alerting/action/SearchMonitorRequest.kt index 9068e7b2b..069b1ed4e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/action/SearchMonitorRequest.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/action/SearchMonitorRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.alerting.action import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.search.SearchRequest -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import java.io.IOException class SearchMonitorRequest : ActionRequest { 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 dfe3be6f0..07b1a3a91 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertMover.kt @@ -20,11 +20,9 @@ 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.bytes.BytesReference import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Alert import org.opensearch.commons.alerting.model.CompositeInput @@ -32,11 +30,13 @@ import org.opensearch.commons.alerting.model.DataSources import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.VersionType import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder private val log = LogManager.getLogger(AlertMover::class.java) 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 19abaa724..2e2b24b19 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/AlertingConfigAccessor.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/AlertingConfigAccessor.kt @@ -13,11 +13,11 @@ 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.bytes.BytesReference 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 /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/BucketLevelTriggerRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/BucketLevelTriggerRunResult.kt index 5ec95d91d..ffc302d98 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/BucketLevelTriggerRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/BucketLevelTriggerRunResult.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.model.AggregationResultBucket +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/ChainedAlertTriggerRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/ChainedAlertTriggerRunResult.kt index 960338531..b95e533e9 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/ChainedAlertTriggerRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/ChainedAlertTriggerRunResult.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.alerts.AlertError +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.script.ScriptException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt index eca95dafb..9d98aab42 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt @@ -5,8 +5,8 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.script.ScriptException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt index ace38be6a..17534a30e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt @@ -6,15 +6,15 @@ package org.opensearch.alerting.model import org.opensearch.alerting.model.destination.Destination.Companion.NO_ID -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.util.instant +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.seqno.SequenceNumbers import java.io.IOException import java.time.Instant diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorRunResult.kt index 839bfdc5d..18a433848 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorRunResult.kt @@ -7,12 +7,12 @@ package org.opensearch.alerting.model import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchException -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable import org.opensearch.commons.alerting.alerts.AlertError import org.opensearch.commons.alerting.model.Trigger import org.opensearch.commons.alerting.util.optionalTimeField +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.script.ScriptException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/QueryLevelTriggerRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/QueryLevelTriggerRunResult.kt index e243146fa..d123dbae4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/QueryLevelTriggerRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/QueryLevelTriggerRunResult.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.alerts.AlertError +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.script.ScriptException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/TriggerRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/TriggerRunResult.kt index de372d55c..c3aec89f2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/TriggerRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/TriggerRunResult.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable import org.opensearch.commons.alerting.alerts.AlertError +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt index ba4cf1201..9ab7b43f8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt @@ -5,15 +5,15 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.commons.alerting.util.instant import org.opensearch.commons.alerting.util.optionalTimeField +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import java.io.IOException import java.time.Instant diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowRunResult.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowRunResult.kt index ee8885173..cabdc6330 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowRunResult.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowRunResult.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Chime.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Chime.kt index 8ef48742a..06d066ded 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Chime.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Chime.kt @@ -5,13 +5,13 @@ package org.opensearch.alerting.model.destination -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.core.common.Strings +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/CustomWebhook.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/CustomWebhook.kt index 7adbf7526..5758576d8 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/CustomWebhook.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/CustomWebhook.kt @@ -5,13 +5,13 @@ package org.opensearch.alerting.model.destination -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.core.common.Strings +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Destination.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Destination.kt index 5de7c1d5a..a5043b3cf 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Destination.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Destination.kt @@ -10,9 +10,6 @@ import org.opensearch.alerting.model.destination.email.Email import org.opensearch.alerting.opensearchapi.convertToMap import org.opensearch.alerting.util.DestinationType import org.opensearch.alerting.util.destinationmigration.DestinationConversionUtils.Companion.convertAlertingToNotificationMethodType -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.util.IndexUtils.Companion.NO_SCHEMA_VERSION import org.opensearch.commons.alerting.util.instant import org.opensearch.commons.alerting.util.optionalTimeField @@ -23,9 +20,12 @@ import org.opensearch.commons.destination.message.LegacyChimeMessage import org.opensearch.commons.destination.message.LegacyCustomWebhookMessage import org.opensearch.commons.destination.message.LegacyEmailMessage import org.opensearch.commons.destination.message.LegacySlackMessage +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException import java.time.Instant import java.util.Locale 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 1e91c3dba..263962ac7 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 @@ -12,7 +12,7 @@ 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.common.settings.SecureString +import org.opensearch.core.common.settings.SecureString import org.opensearch.core.xcontent.NamedXContentRegistry /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/SNS.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/SNS.kt index 538833010..f9c6ec59f 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/SNS.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/SNS.kt @@ -5,10 +5,10 @@ package org.opensearch.alerting.model.destination -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import java.io.IOException import java.lang.IllegalStateException import java.util.regex.Pattern diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Slack.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Slack.kt index aecd61a73..14f623616 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Slack.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/Slack.kt @@ -5,13 +5,13 @@ package org.opensearch.alerting.model.destination -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.core.common.Strings +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/Email.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/Email.kt index bcbca39b8..75635ab38 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/Email.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/Email.kt @@ -6,14 +6,14 @@ package org.opensearch.alerting.model.destination.email import org.opensearch.alerting.util.isValidEmail -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException import java.lang.IllegalStateException import java.util.Locale diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailAccount.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailAccount.kt index 969827896..9d0bb7f00 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailAccount.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailAccount.kt @@ -6,16 +6,16 @@ package org.opensearch.alerting.model.destination.email import org.opensearch.alerting.util.isValidEmail -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.settings.SecureString -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.util.IndexUtils.Companion.NO_SCHEMA_VERSION +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable +import org.opensearch.core.common.settings.SecureString import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailGroup.kt b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailGroup.kt index fc7b16767..a960da5f5 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailGroup.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/model/destination/email/EmailGroup.kt @@ -6,16 +6,16 @@ package org.opensearch.alerting.model.destination.email import org.opensearch.alerting.util.isValidEmail -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.util.IndexUtils.Companion.NO_SCHEMA_VERSION import org.opensearch.core.common.Strings +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** 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 bdc2e92b3..f953876a4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeAlertAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeAlertAction.kt @@ -11,10 +11,10 @@ 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.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.action.AcknowledgeAlertRequest import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer import org.opensearch.rest.RestHandler.ReplacedRoute 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 4402ca455..968856a48 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeChainedAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestAcknowledgeChainedAlertsAction.kt @@ -9,10 +9,10 @@ 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.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.action.AcknowledgeChainedAlertRequest import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer import org.opensearch.rest.RestHandler.Route 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 c9f8a07c0..740dcb2d6 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteMonitorAction.kt @@ -11,9 +11,9 @@ 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.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.model.Monitor import org.opensearch.core.xcontent.XContentParser.Token.START_OBJECT +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer import org.opensearch.rest.RestHandler.ReplacedRoute 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 4787fdbdb..de8da1bac 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestExecuteWorkflowAction.kt @@ -11,9 +11,9 @@ 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.common.xcontent.XContentParserUtils import org.opensearch.commons.alerting.model.Workflow import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest 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 b0e89abe2..5e4a8c155 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt @@ -12,7 +12,6 @@ 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.common.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.IndexMonitorRequest import org.opensearch.commons.alerting.action.IndexMonitorResponse @@ -21,8 +20,10 @@ import org.opensearch.commons.alerting.model.DocumentLevelTrigger import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.QueryLevelTrigger import org.opensearch.commons.alerting.model.ScheduledJob +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentParser.Token +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer @@ -34,7 +35,6 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.RestRequest.Method.PUT import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import java.io.IOException import java.time.Instant @@ -104,6 +104,13 @@ class RestIndexMonitorAction : BaseRestHandler() { } } } + Monitor.MonitorType.CLUSTER_METRICS_MONITOR -> { + triggers.forEach { + if (it !is QueryLevelTrigger) { + throw IllegalArgumentException("Illegal trigger type, ${it.javaClass.name}, for cluster metrics monitor") + } + } + } Monitor.MonitorType.DOC_LEVEL_MONITOR -> { triggers.forEach { if (it !is DocumentLevelTrigger) { 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 faa0ae065..d631ed710 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt @@ -11,13 +11,14 @@ 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.common.xcontent.XContentParserUtils import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.IndexWorkflowRequest import org.opensearch.commons.alerting.action.IndexWorkflowResponse import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer @@ -26,7 +27,6 @@ import org.opensearch.rest.RestChannel import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import java.io.IOException import java.time.Instant 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 95a5d7f57..66281942a 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailAccountAction.kt @@ -12,11 +12,12 @@ 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.bytes.BytesReference import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory.jsonBuilder import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ScheduledJob.Companion.SCHEDULED_JOBS_INDEX +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS import org.opensearch.index.query.QueryBuilders import org.opensearch.rest.BaseRestHandler @@ -26,7 +27,6 @@ import org.opensearch.rest.RestHandler.ReplacedRoute import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder 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 7dc1700ee..4550bb4a9 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchEmailGroupAction.kt @@ -12,21 +12,22 @@ 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.bytes.BytesReference import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ScheduledJob.Companion.SCHEDULED_JOBS_INDEX +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.index.query.QueryBuilders import org.opensearch.rest.BaseRestHandler +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer import org.opensearch.rest.BytesRestResponse import org.opensearch.rest.RestChannel import org.opensearch.rest.RestHandler.ReplacedRoute import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder 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 5731502d5..e912c8313 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestSearchMonitorAction.kt @@ -16,13 +16,14 @@ 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.bytes.BytesReference import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory.jsonBuilder import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.ScheduledJob.Companion.SCHEDULED_JOBS_INDEX +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BaseRestHandler.RestChannelConsumer @@ -34,7 +35,6 @@ import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import org.opensearch.search.builder.SearchSourceBuilder import java.io.IOException diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt b/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt index 2829f4df8..14086ce68 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt @@ -6,10 +6,10 @@ package org.opensearch.alerting.settings import org.opensearch.common.settings.SecureSetting -import org.opensearch.common.settings.SecureString import org.opensearch.common.settings.Setting import org.opensearch.common.settings.Setting.AffixSetting import org.opensearch.common.settings.Settings +import org.opensearch.core.common.settings.SecureString import java.util.function.Function /** diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt b/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt index 7b3283561..73bae6463 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt @@ -7,9 +7,9 @@ package org.opensearch.alerting.settings import org.opensearch.alerting.util.DestinationType import org.opensearch.common.settings.SecureSetting -import org.opensearch.common.settings.SecureString import org.opensearch.common.settings.Setting import org.opensearch.common.settings.Settings +import org.opensearch.core.common.settings.SecureString import java.util.function.Function /** 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 4b3a403c7..2b2c134fd 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/SecureTransportAction.kt @@ -14,7 +14,7 @@ import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus 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 42189d729..784ebab70 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeAlertAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeAlertAction.kt @@ -35,7 +35,6 @@ import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.action.AcknowledgeAlertRequest import org.opensearch.commons.alerting.action.AcknowledgeAlertResponse @@ -46,6 +45,7 @@ import org.opensearch.commons.alerting.util.optionalTimeField import org.opensearch.commons.utils.recreateObject import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders import org.opensearch.rest.RestRequest import org.opensearch.search.builder.SearchSourceBuilder @@ -53,7 +53,7 @@ import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Instant -import java.util.* +import java.util.Locale private val log = LogManager.getLogger(TransportAcknowledgeAlertAction::class.java) private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) 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 2fae5b33e..a83fbad27 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeChainedAlertAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportAcknowledgeChainedAlertAction.kt @@ -37,7 +37,6 @@ import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.action.AcknowledgeAlertResponse import org.opensearch.commons.alerting.action.AcknowledgeChainedAlertRequest @@ -49,10 +48,11 @@ import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.alerting.util.optionalTimeField import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 b72a77cfc..d4ed29107 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt @@ -35,8 +35,8 @@ import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 b43ec3c3f..04ce27f56 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt @@ -49,6 +49,7 @@ import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser import org.opensearch.index.IndexNotFoundException @@ -56,7 +57,6 @@ 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.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 a12a03d09..10b49d830 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteMonitorAction.kt @@ -37,8 +37,8 @@ import org.opensearch.commons.ConfigConstants import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.authuser.User +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Instant 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 d550c2002..682691af9 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportExecuteWorkflowAction.kt @@ -30,8 +30,8 @@ import org.opensearch.commons.ConfigConstants import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.authuser.User +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Instant 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 0e169bac7..668f8986c 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetAlertsAction.kt @@ -29,7 +29,6 @@ import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetAlertsRequest @@ -41,6 +40,7 @@ import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.recreateObject import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.Operator import org.opensearch.index.query.QueryBuilders import org.opensearch.search.builder.SearchSourceBuilder 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 d1541819c..a1d1dcad4 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetDestinationsAction.kt @@ -26,15 +26,15 @@ import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.authuser.User +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.Operator import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.search.sort.SortBuilders 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 1a174ae36..45647d65e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailAccountAction.kt @@ -28,8 +28,8 @@ 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.Companion.SCHEDULED_JOBS_INDEX +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 84391e978..1f07bb949 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetEmailGroupAction.kt @@ -28,8 +28,8 @@ 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.Companion.SCHEDULED_JOBS_INDEX +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 85e18e5d5..386f5433a 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt @@ -34,7 +34,6 @@ import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetFindingsRequest @@ -45,6 +44,7 @@ import org.opensearch.commons.alerting.model.FindingWithDocs import org.opensearch.commons.utils.recreateObject import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.Operator import org.opensearch.index.query.QueryBuilders import org.opensearch.rest.RestRequest 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 fdeb06b2a..b7067f3b0 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetMonitorAction.kt @@ -35,9 +35,9 @@ import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 95ce6be65..09efef790 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAction.kt @@ -27,9 +27,9 @@ import org.opensearch.commons.alerting.action.GetWorkflowRequest import org.opensearch.commons.alerting.action.GetWorkflowResponse import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.IndexNotFoundException -import org.opensearch.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.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 5276acfca..d469acc84 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAlertsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetWorkflowAlertsAction.kt @@ -27,7 +27,6 @@ import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.action.AlertingActions import org.opensearch.commons.alerting.action.GetAlertsRequest @@ -36,11 +35,12 @@ import org.opensearch.commons.alerting.action.GetWorkflowAlertsResponse import org.opensearch.commons.alerting.model.Alert import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.Operator import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder 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 38fe9d464..427bf6e4e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt @@ -51,7 +51,6 @@ 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.io.stream.NamedWriteableRegistry import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler @@ -69,6 +68,8 @@ import org.opensearch.commons.alerting.model.ScheduledJob.Companion.SCHEDULED_JO import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.common.io.stream.NamedWriteableRegistry +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.index.query.QueryBuilders @@ -76,7 +77,6 @@ import org.opensearch.index.reindex.BulkByScrollResponse import org.opensearch.index.reindex.DeleteByQueryAction import org.opensearch.index.reindex.DeleteByQueryRequestBuilder import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 3e103b33b..2eabd7b70 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt @@ -47,7 +47,6 @@ 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.io.stream.NamedWriteableRegistry import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory.jsonBuilder @@ -66,12 +65,13 @@ import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.common.io.stream.NamedWriteableRegistry +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.index.IndexNotFoundException import org.opensearch.index.query.QueryBuilders import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService 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 d28df822f..03805b0ac 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailAccountAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailAccountAction.kt @@ -20,7 +20,7 @@ import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.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 86b483a34..58ea5df0b 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailGroupAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportSearchEmailGroupAction.kt @@ -20,7 +20,7 @@ import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/AlertingException.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/AlertingException.kt index a86f571d4..4127afaa2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/AlertingException.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/AlertingException.kt @@ -10,10 +10,10 @@ import org.opensearch.OpenSearchException import org.opensearch.OpenSearchSecurityException import org.opensearch.OpenSearchStatusException import org.opensearch.core.common.Strings +import org.opensearch.core.rest.RestStatus import org.opensearch.index.IndexNotFoundException import org.opensearch.index.engine.VersionConflictEngineException import org.opensearch.indices.InvalidIndexNameException -import org.opensearch.rest.RestStatus private val log = LogManager.getLogger(AlertingException::class.java) 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 af96d0ab6..42512738e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt @@ -37,8 +37,8 @@ import org.opensearch.commons.alerting.model.DocLevelMonitorInput import org.opensearch.commons.alerting.model.DocLevelQuery import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob +import org.opensearch.core.rest.RestStatus import org.opensearch.index.mapper.MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING -import org.opensearch.rest.RestStatus private val log = LogManager.getLogger(DocLevelMonitorQueries::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/ScheduledJobUtils.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/ScheduledJobUtils.kt index 8e3a946e8..70fe42a38 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/ScheduledJobUtils.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/ScheduledJobUtils.kt @@ -14,8 +14,8 @@ import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.rest.RestStatus private val log = LogManager.getLogger(ScheduledJobUtils::class.java) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt index 38420c98a..211083360 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt @@ -22,9 +22,9 @@ import org.opensearch.action.admin.indices.stats.IndicesStatsResponse import org.opensearch.action.support.IndicesOptions import org.opensearch.alerting.util.IndexUtils.Companion.VALID_INDEX_NAME_REGEX import org.opensearch.cluster.metadata.IndexMetadata -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable import org.opensearch.common.time.DateFormatter +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt index cde22918b..64db4b7d0 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt @@ -17,9 +17,9 @@ import org.opensearch.action.admin.indices.stats.IndicesStatsResponse import org.opensearch.action.admin.indices.stats.ShardStats import org.opensearch.alerting.util.IndexUtils.Companion.VALID_INDEX_NAME_REGEX import org.opensearch.cluster.routing.UnassignedInfo -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable import org.opensearch.common.unit.TimeValue +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder 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 3061996a2..a1aa72956 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 @@ -25,17 +25,17 @@ import org.opensearch.client.node.NodeClient import org.opensearch.common.Strings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.ConfigConstants import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.notifications.action.CreateNotificationConfigRequest import org.opensearch.commons.notifications.model.NotificationConfig import org.opensearch.commons.notifications.model.NotificationConfigInfo +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.fetch.subphase.FetchSourceContext import java.time.Instant 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 7113f0d01..4278907d3 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 @@ -30,7 +30,7 @@ import org.opensearch.commons.notifications.model.ChannelMessage import org.opensearch.commons.notifications.model.EventSource import org.opensearch.commons.notifications.model.NotificationConfigInfo import org.opensearch.commons.notifications.model.SeverityType -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class NotificationApiUtils { diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt index ce74e6ec3..615ce486a 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt @@ -23,7 +23,6 @@ import org.opensearch.alerting.util.isDocLevelMonitor import org.opensearch.alerting.util.isQueryLevelMonitor import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Alert import org.opensearch.commons.alerting.model.ChainedAlertTrigger @@ -34,6 +33,7 @@ import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.alerting.util.isBucketLevelMonitor import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.QueryBuilders import org.opensearch.index.query.QueryBuilders.boolQuery import org.opensearch.index.query.QueryBuilders.existsQuery diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt b/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt index 9adfed367..914977e96 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt @@ -39,7 +39,6 @@ import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentFactory.jsonBuilder -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.common.xcontent.json.JsonXContent.jsonXContent import org.opensearch.commons.alerting.action.GetFindingsResponse @@ -57,11 +56,12 @@ import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.alerting.model.Workflow import org.opensearch.commons.alerting.util.string +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.rest.RestStatus +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.search.SearchModule import java.net.URLEncoder import java.nio.file.Files diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt index 808839d16..8e091ae8f 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt @@ -35,7 +35,6 @@ import org.opensearch.alerting.workflow.CompositeWorkflowRunner import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.action.AcknowledgeAlertRequest import org.opensearch.commons.alerting.action.AcknowledgeAlertResponse @@ -60,13 +59,14 @@ import org.opensearch.commons.alerting.model.ScheduledJob.Companion.DOC_LEVEL_QU import org.opensearch.commons.alerting.model.ScheduledJob.Companion.SCHEDULED_JOBS_INDEX import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.alerting.model.Table +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.mapper.MapperService import org.opensearch.index.query.MatchQueryBuilder import org.opensearch.index.query.QueryBuilders import org.opensearch.index.query.TermQueryBuilder import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.search.aggregations.bucket.composite.CompositeAggregationBuilder import org.opensearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/MonitorRunnerServiceIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/MonitorRunnerServiceIT.kt index 6a17b8622..63b4d8286 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/MonitorRunnerServiceIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/MonitorRunnerServiceIT.kt @@ -37,8 +37,8 @@ import org.opensearch.commons.alerting.model.action.PerAlertActionScope import org.opensearch.commons.alerting.model.action.PerExecutionActionScope import org.opensearch.commons.alerting.model.action.Throttle import org.opensearch.commons.authuser.User +import org.opensearch.core.rest.RestStatus import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.search.aggregations.bucket.composite.CompositeAggregationBuilder import org.opensearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/TestHelpers.kt b/alerting/src/test/kotlin/org/opensearch/alerting/TestHelpers.kt index b7309614e..5ce746fda 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/TestHelpers.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/TestHelpers.kt @@ -24,7 +24,6 @@ import org.opensearch.client.Response import org.opensearch.client.RestClient import org.opensearch.client.WarningsHandler import org.opensearch.common.UUIDs -import org.opensearch.common.settings.SecureString import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory @@ -64,6 +63,7 @@ import org.opensearch.commons.alerting.model.action.PerExecutionActionScope import org.opensearch.commons.alerting.model.action.Throttle import org.opensearch.commons.alerting.util.string import org.opensearch.commons.authuser.User +import org.opensearch.core.common.settings.SecureString import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequestTests.kt index 022b93455..f54b6fea6 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorRequestTests.kt @@ -7,9 +7,9 @@ package org.opensearch.alerting.action import org.opensearch.alerting.randomQueryLevelMonitor import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput import org.opensearch.common.unit.TimeValue import org.opensearch.commons.alerting.model.SearchInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.test.OpenSearchTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponseTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponseTests.kt index 34b41bc2b..10ccd7038 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponseTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/ExecuteMonitorResponseTests.kt @@ -9,7 +9,7 @@ import org.junit.Assert import org.opensearch.alerting.randomBucketLevelMonitorRunResult import org.opensearch.alerting.randomQueryLevelMonitorRunResult import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.test.OpenSearchTestCase class ExecuteMonitorResponseTests : OpenSearchTestCase() { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsRequestTests.kt index e8875caca..7c76621f9 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsRequestTests.kt @@ -6,8 +6,8 @@ package org.opensearch.alerting.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput import org.opensearch.commons.alerting.model.Table +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.test.OpenSearchTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsResponseTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsResponseTests.kt index e87e8b722..ed837bdce 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsResponseTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetDestinationsResponseTests.kt @@ -9,8 +9,8 @@ import org.opensearch.alerting.model.destination.Destination import org.opensearch.alerting.model.destination.Slack import org.opensearch.alerting.util.DestinationType import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.rest.RestStatus +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.time.Instant import java.util.Collections diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountRequestTests.kt index 5f6f5ce57..02631a38b 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.alerting.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.rest.RestRequest import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.test.OpenSearchTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountResponseTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountResponseTests.kt index 1febe1597..ed60c3439 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountResponseTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailAccountResponseTests.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.alerting.randomEmailAccount import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.rest.RestStatus +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase class GetEmailAccountResponseTests : OpenSearchTestCase() { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupRequestTests.kt index cc2043fb0..7fa8b2037 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.alerting.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.rest.RestRequest import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.test.OpenSearchTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupResponseTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupResponseTests.kt index 968907aae..19612fe4a 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupResponseTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetEmailGroupResponseTests.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.alerting.randomEmailGroup import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.rest.RestStatus +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase class GetEmailGroupResponseTests : OpenSearchTestCase() { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetFindingsRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetFindingsRequestTests.kt index 43da11870..d1bd6f7e3 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetFindingsRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetFindingsRequestTests.kt @@ -6,9 +6,9 @@ package org.opensearch.alerting.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput import org.opensearch.commons.alerting.action.GetFindingsRequest import org.opensearch.commons.alerting.model.Table +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.test.OpenSearchTestCase class GetFindingsRequestTests : OpenSearchTestCase() { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorRequestTests.kt index c3d6831ba..c8d8731c5 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.alerting.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.rest.RestRequest import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.test.OpenSearchTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorResponseTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorResponseTests.kt index 6e6596951..af7b0e5c9 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorResponseTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/GetMonitorResponseTests.kt @@ -7,10 +7,10 @@ package org.opensearch.alerting.action import org.opensearch.alerting.randomUser import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput import org.opensearch.commons.alerting.model.CronSchedule import org.opensearch.commons.alerting.model.Monitor -import org.opensearch.rest.RestStatus +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.time.Instant import java.time.ZoneId diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/action/SearchMonitorRequestTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/action/SearchMonitorRequestTests.kt index dc593e480..43a5bc873 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/action/SearchMonitorRequestTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/action/SearchMonitorRequestTests.kt @@ -7,8 +7,8 @@ package org.opensearch.alerting.action import org.opensearch.action.search.SearchRequest import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput import org.opensearch.common.unit.TimeValue +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.rest.OpenSearchRestTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/alerts/AlertIndicesIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/alerts/AlertIndicesIT.kt index 1fe0f1782..948801296 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/alerts/AlertIndicesIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/alerts/AlertIndicesIT.kt @@ -22,7 +22,7 @@ import org.opensearch.common.xcontent.json.JsonXContent.jsonXContent import org.opensearch.commons.alerting.model.DocLevelMonitorInput import org.opensearch.commons.alerting.model.DocLevelQuery import org.opensearch.commons.alerting.model.ScheduledJob -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.util.concurrent.TimeUnit diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt index f6f4650ec..68abd0548 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt @@ -13,8 +13,8 @@ import org.opensearch.alerting.makeRequest import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Monitor +import org.opensearch.core.rest.RestStatus import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder class AlertingBackwardsCompatibilityIT : AlertingRestTestCase() { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/model/DestinationTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/model/DestinationTests.kt index 777206449..7dac05b2a 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/model/DestinationTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/model/DestinationTests.kt @@ -16,7 +16,7 @@ import org.opensearch.alerting.parser import org.opensearch.alerting.randomUser import org.opensearch.alerting.util.DestinationType import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.test.OpenSearchTestCase import java.time.Instant diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/model/WriteableTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/model/WriteableTests.kt index 16ff7db0a..6851c471d 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/model/WriteableTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/model/WriteableTests.kt @@ -18,8 +18,8 @@ import org.opensearch.alerting.randomInputRunResults import org.opensearch.alerting.randomQueryLevelMonitorRunResult import org.opensearch.alerting.randomQueryLevelTriggerRunResult import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput import org.opensearch.commons.alerting.model.SearchInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.test.OpenSearchTestCase diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailAccountRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailAccountRestApiIT.kt index b6078e20d..c86270f5b 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailAccountRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailAccountRestApiIT.kt @@ -14,8 +14,8 @@ import org.opensearch.alerting.model.destination.email.EmailAccount import org.opensearch.alerting.randomEmailAccount import org.opensearch.client.ResponseException import org.opensearch.common.xcontent.XContentType +import org.opensearch.core.rest.RestStatus import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.junit.annotations.TestLogging diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailGroupRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailGroupRestApiIT.kt index c1a71eb6a..c60a09d6b 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailGroupRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/EmailGroupRestApiIT.kt @@ -15,8 +15,8 @@ import org.opensearch.alerting.model.destination.email.EmailGroup import org.opensearch.alerting.randomEmailGroup import org.opensearch.client.ResponseException import org.opensearch.common.xcontent.XContentType +import org.opensearch.core.rest.RestStatus import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.junit.annotations.TestLogging diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt index 5ab73786f..000364bf0 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt @@ -37,7 +37,6 @@ import org.opensearch.alerting.toJsonString import org.opensearch.alerting.util.DestinationType import org.opensearch.client.ResponseException import org.opensearch.client.WarningFailureException -import org.opensearch.common.bytes.BytesReference import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.Alert @@ -49,10 +48,11 @@ import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.QueryLevelTrigger import org.opensearch.commons.alerting.model.ScheduledJob import org.opensearch.commons.alerting.model.SearchInput +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.search.aggregations.AggregationBuilders import org.opensearch.search.builder.SearchSourceBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureDestinationRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureDestinationRestApiIT.kt index e90ca1730..1cf20bf47 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureDestinationRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureDestinationRestApiIT.kt @@ -24,7 +24,7 @@ import org.opensearch.alerting.randomUser import org.opensearch.alerting.util.DestinationType import org.opensearch.client.RestClient import org.opensearch.commons.rest.SecureRestClientBuilder -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailAccountRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailAccountRestApiIT.kt index 6a8d3ee37..25c27b861 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailAccountRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailAccountRestApiIT.kt @@ -24,7 +24,7 @@ import org.opensearch.alerting.makeRequest import org.opensearch.client.ResponseException import org.opensearch.client.RestClient import org.opensearch.commons.rest.SecureRestClientBuilder -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus val SEARCH_EMAIL_ACCOUNT_DSL = """ { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailGroupsRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailGroupsRestApiIT.kt index 769e4725a..614b9d5a6 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailGroupsRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureEmailGroupsRestApiIT.kt @@ -22,7 +22,7 @@ import org.opensearch.alerting.TEST_HR_ROLE import org.opensearch.alerting.makeRequest import org.opensearch.client.RestClient import org.opensearch.commons.rest.SecureRestClientBuilder -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging val SEARCH_EMAIL_GROUP_DSL = """ diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt index 5ba96f791..79959c45a 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureMonitorRestApiIT.kt @@ -56,9 +56,9 @@ import org.opensearch.commons.alerting.model.DocLevelMonitorInput import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.authuser.User import org.opensearch.commons.rest.SecureRestClientBuilder +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.search.aggregations.bucket.composite.CompositeAggregationBuilder import org.opensearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt index 7a07c5df4..e4150c596 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt @@ -51,9 +51,9 @@ import org.opensearch.commons.alerting.model.DocLevelMonitorInput import org.opensearch.commons.alerting.model.DocLevelQuery import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.rest.SecureRestClientBuilder +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.search.aggregations.bucket.composite.CompositeAggregationBuilder import org.opensearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/WorkflowRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/WorkflowRestApiIT.kt index ec128109f..c3d103b09 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/WorkflowRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/WorkflowRestApiIT.kt @@ -30,8 +30,8 @@ import org.opensearch.commons.alerting.model.IntervalSchedule import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.rest.RestStatus import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus import org.opensearch.script.Script import org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder import org.opensearch.search.builder.SearchSourceBuilder diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/util/AnomalyDetectionUtilsTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/util/AnomalyDetectionUtilsTests.kt index 19e451f26..2295c8b59 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/util/AnomalyDetectionUtilsTests.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/util/AnomalyDetectionUtilsTests.kt @@ -7,10 +7,10 @@ package org.opensearch.alerting.util import org.opensearch.alerting.ANOMALY_RESULT_INDEX import org.opensearch.alerting.randomQueryLevelMonitor -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.model.Input import org.opensearch.commons.alerting.model.SearchInput import org.opensearch.commons.authuser.User +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.index.query.QueryBuilders diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilServiceIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilServiceIT.kt index 7997f246c..f9c40e465 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilServiceIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationUtilServiceIT.kt @@ -17,7 +17,7 @@ import org.opensearch.alerting.randomUser import org.opensearch.alerting.util.DestinationType import org.opensearch.client.ResponseException import org.opensearch.commons.alerting.model.ScheduledJob.Companion.SCHEDULED_JOBS_INDEX -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.util.UUID diff --git a/build.gradle b/build.gradle index bec3b5f58..defcf229b 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ buildscript { } opensearch_no_snapshot = opensearch_version.replace("-SNAPSHOT","") common_utils_version = System.getProperty("common_utils.version", opensearch_build) - kotlin_version = '1.6.10' + kotlin_version = '1.8.21' } repositories { 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 7d1a7feb5..1a082d8d8 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeper.kt @@ -24,7 +24,6 @@ import org.opensearch.cluster.routing.IndexShardRoutingTable import org.opensearch.cluster.routing.Murmur3HashFunction import org.opensearch.cluster.service.ClusterService import org.opensearch.common.Strings -import org.opensearch.common.bytes.BytesReference import org.opensearch.common.component.LifecycleListener import org.opensearch.common.logging.Loggers import org.opensearch.common.lucene.uid.Versions @@ -33,17 +32,18 @@ import org.opensearch.common.unit.TimeValue import org.opensearch.common.util.concurrent.OpenSearchExecutors import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.alerting.model.ScheduledJob +import org.opensearch.core.common.bytes.BytesReference +import org.opensearch.core.index.shard.ShardId +import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.engine.Engine import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.QueryBuilders import org.opensearch.index.shard.IndexingOperationListener -import org.opensearch.index.shard.ShardId -import org.opensearch.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.FieldSortBuilder import org.opensearch.threadpool.Scheduler diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeperMetrics.kt b/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeperMetrics.kt index 705e275be..9a10586d1 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeperMetrics.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/JobSweeperMetrics.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.core -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobStats.kt b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobStats.kt index 0e670910d..07792d553 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobStats.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobStats.kt @@ -10,8 +10,8 @@ import org.opensearch.alerting.core.JobSweeperMetrics import org.opensearch.alerting.core.resthandler.RestScheduledJobStatsHandler import org.opensearch.alerting.core.schedule.JobSchedulerMetrics import org.opensearch.cluster.node.DiscoveryNode -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsAction.kt b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsAction.kt index a333d5e90..698c6c44e 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsAction.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsAction.kt @@ -6,7 +6,7 @@ package org.opensearch.alerting.core.action.node import org.opensearch.action.ActionType -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable class ScheduledJobsStatsAction : ActionType(NAME, reader) { companion object { diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsRequest.kt b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsRequest.kt index b0d736c96..6a82e8204 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsRequest.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsRequest.kt @@ -6,8 +6,8 @@ package org.opensearch.alerting.core.action.node import org.opensearch.action.support.nodes.BaseNodesRequest -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import java.io.IOException /** diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsResponse.kt b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsResponse.kt index c24a5e22b..edfcc0cce 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsResponse.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsResponse.kt @@ -11,8 +11,8 @@ import org.opensearch.alerting.core.settings.LegacyOpenDistroScheduledJobSetting import org.opensearch.alerting.core.settings.ScheduledJobSettings import org.opensearch.cluster.ClusterName import org.opensearch.cluster.health.ClusterIndexHealth -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsTransportAction.kt b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsTransportAction.kt index cb94d82ef..f2ed94623 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsTransportAction.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsTransportAction.kt @@ -17,8 +17,8 @@ import org.opensearch.alerting.core.schedule.JobSchedulerMetrics import org.opensearch.cluster.health.ClusterIndexHealth import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.threadpool.ThreadPool import org.opensearch.transport.TransportRequest import org.opensearch.transport.TransportService diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/schedule/JobSchedulerMetrics.kt b/core/src/main/kotlin/org/opensearch/alerting/core/schedule/JobSchedulerMetrics.kt index 3d13de5e9..dff1ecd52 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/schedule/JobSchedulerMetrics.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/schedule/JobSchedulerMetrics.kt @@ -5,9 +5,9 @@ package org.opensearch.alerting.core.schedule -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder 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 4c79d4e4f..0b0bf0d3e 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt @@ -23,13 +23,13 @@ import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.InjectSecurity import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.NotificationsPluginInterface +import org.opensearch.core.rest.RestStatus +import org.opensearch.core.rest.RestStatus.BAD_GATEWAY +import org.opensearch.core.rest.RestStatus.GATEWAY_TIMEOUT +import org.opensearch.core.rest.RestStatus.SERVICE_UNAVAILABLE import org.opensearch.core.xcontent.ToXContent import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.QueryBuilders -import org.opensearch.rest.RestStatus -import org.opensearch.rest.RestStatus.BAD_GATEWAY -import org.opensearch.rest.RestStatus.GATEWAY_TIMEOUT -import org.opensearch.rest.RestStatus.SERVICE_UNAVAILABLE import org.opensearch.search.builder.SearchSourceBuilder import kotlin.coroutines.CoroutineContext import kotlin.coroutines.resume diff --git a/core/src/test/kotlin/org/opensearch/alerting/core/WriteableTests.kt b/core/src/test/kotlin/org/opensearch/alerting/core/WriteableTests.kt index 32fd3d510..f48ffa370 100644 --- a/core/src/test/kotlin/org/opensearch/alerting/core/WriteableTests.kt +++ b/core/src/test/kotlin/org/opensearch/alerting/core/WriteableTests.kt @@ -9,7 +9,7 @@ import org.joda.time.DateTime import org.junit.Test import org.opensearch.alerting.core.schedule.JobSchedulerMetrics import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.test.OpenSearchTestCase.assertEquals class WriteableTests { diff --git a/core/src/test/kotlin/org/opensearch/alerting/core/model/MockScheduledJob.kt b/core/src/test/kotlin/org/opensearch/alerting/core/model/MockScheduledJob.kt index 25c40d65e..08e3fb8c4 100644 --- a/core/src/test/kotlin/org/opensearch/alerting/core/model/MockScheduledJob.kt +++ b/core/src/test/kotlin/org/opensearch/alerting/core/model/MockScheduledJob.kt @@ -1,8 +1,8 @@ package org.opensearch.alerting.core.model -import org.opensearch.common.io.stream.StreamOutput import org.opensearch.commons.alerting.model.Schedule import org.opensearch.commons.alerting.model.ScheduledJob +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import java.io.IOException From 38c38cc48ade277e801bb67640267e176f443a45 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Fri, 21 Jul 2023 10:00:32 -0700 Subject: [PATCH 2/4] fix jacoco Signed-off-by: Ashish Agrawal --- build-tools/merged-coverage.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build-tools/merged-coverage.gradle b/build-tools/merged-coverage.gradle index 83fa44d20..ab3703f7d 100644 --- a/build-tools/merged-coverage.gradle +++ b/build-tools/merged-coverage.gradle @@ -9,6 +9,7 @@ allprojects { // For some reason this dependency isn't getting setup automatically by the jacoco plugin tasks.withType(JacocoReport) { dependsOn tasks.withType(Test) + dependsOn "alerting-core:test" } } } From 353dc1c199198d4f7293a4e74cade01180fe7493 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Fri, 21 Jul 2023 10:44:11 -0700 Subject: [PATCH 3/4] change ci flow Signed-off-by: Ashish Agrawal --- .github/workflows/test-workflow.yml | 7 ------- build-tools/merged-coverage.gradle | 1 - 2 files changed, 8 deletions(-) diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 2d5217e5a..9e9eb42ec 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -17,13 +17,6 @@ jobs: matrix: java: [11, 17] os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: windows-latest - os_build_args: -x integTest -x jacocoTestReport - working_directory: X:\ - os_java_options: -Xmx4096M - - os: macos-latest - os_build_args: -x integTest -x jacocoTestReport # Job name name: Build Alerting with JDK ${{ matrix.java }} on ${{ matrix.os }} # This job runs on Linux diff --git a/build-tools/merged-coverage.gradle b/build-tools/merged-coverage.gradle index ab3703f7d..83fa44d20 100644 --- a/build-tools/merged-coverage.gradle +++ b/build-tools/merged-coverage.gradle @@ -9,7 +9,6 @@ allprojects { // For some reason this dependency isn't getting setup automatically by the jacoco plugin tasks.withType(JacocoReport) { dependsOn tasks.withType(Test) - dependsOn "alerting-core:test" } } } From 01b3ca37df88d1f1c8a36093251a757c8ba40a4c Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Fri, 21 Jul 2023 11:43:55 -0700 Subject: [PATCH 4/4] resolve ubuntu and windows ci Signed-off-by: Ashish Agrawal --- .github/workflows/test-workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 9e9eb42ec..92bdc641f 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -17,6 +17,11 @@ jobs: matrix: java: [11, 17] os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: windows-latest + os_build_args: -x integTest + working_directory: X:\ + os_java_options: -Xmx4096M # Job name name: Build Alerting with JDK ${{ matrix.java }} on ${{ matrix.os }} # This job runs on Linux