From 64748abb44343362c62e5d36f2e399d6857c0420 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 01:13:39 +0100 Subject: [PATCH 01/16] Move data streams from xpack plugin to a normal module. This moves the data stream actions to the server module The data stream info and usage actions were moved to the xpack core project, because the info and usage infrastructure only exists in xpack. --- .../DataStreamsStatsResponseTests.java | 2 +- .../indices/GetDataStreamResponseTests.java | 4 +- .../data-streams/build.gradle | 6 +-- .../data-streams/qa/build.gradle | 0 .../data-streams/qa/multi-node/build.gradle | 0 .../xpack/datastreams/DataStreamRestIT.java | 6 +-- .../data-streams/qa/rest/build.gradle | 0 .../datastreams/DataStreamUpgradeRestIT.java | 6 +-- .../xpack/datastreams/DataStreamsRestIT.java | 6 +-- .../datastreams/TsdbDataStreamRestIT.java | 6 +-- .../datastreams/AutoCreateDataStreamIT.java | 1 - .../DataStreamsClientYamlTestSuiteIT.java | 6 +-- .../datastreams/DataStreamIT.java | 13 +++--- .../datastreams/DataStreamMigrationIT.java | 10 ++--- .../datastreams/DataStreamsSnapshotsIT.java | 11 ++--- .../datastreams/SystemDataStreamIT.java | 8 ++-- .../SystemDataStreamSnapshotIT.java | 12 +++--- .../datastreams/DataTierDataStreamIT.java | 11 +++-- .../DataStreamIndexSettingsProvider.java | 6 +-- .../xpack/datastreams/DataStreamsPlugin.java | 41 ++++++++----------- .../CreateDataStreamTransportAction.java | 7 ++-- .../action/DataStreamsActionUtil.java | 6 +-- .../DataStreamsStatsTransportAction.java | 8 ++-- .../DeleteDataStreamTransportAction.java | 8 ++-- .../action/GetDataStreamsTransportAction.java | 8 ++-- .../MigrateToDataStreamTransportAction.java | 8 ++-- .../ModifyDataStreamsTransportAction.java | 4 +- .../PromoteDataStreamTransportAction.java | 8 ++-- .../rest/RestCreateDataStreamAction.java | 7 ++-- .../rest/RestDataStreamsStatsAction.java | 7 ++-- .../rest/RestDeleteDataStreamAction.java | 7 ++-- .../rest/RestGetDataStreamsAction.java | 7 ++-- .../rest/RestMigrateToDataStreamAction.java | 8 ++-- .../rest}/RestModifyDataStreamsAction.java | 3 +- .../rest/RestPromoteDataStreamAction.java | 7 ++-- .../action/CreateDataStreamRequestTests.java | 8 ++-- .../action/DataStreamsStatsResponseTests.java | 6 ++- .../action/DeleteDataStreamRequestTests.java | 8 ++-- .../action/GetDataStreamsRequestTests.java | 7 ++-- .../action/GetDataStreamsResponseTests.java | 7 ++-- .../DataStreamIndexSettingsProviderTests.java | 6 +-- .../datastreams/DataStreamsStatsTests.java | 12 +++--- ...etadataDataStreamRolloverServiceTests.java | 6 +-- .../DeleteDataStreamTransportActionTests.java | 8 ++-- .../GetDataStreamsTransportActionTests.java | 8 ++-- .../DataStreamTimestampFieldMapperTests.java | 5 ++- .../MetadataCreateDataStreamServiceTests.java | 6 +-- .../test/data_stream/100_delete_by_query.yml | 0 .../test/data_stream/10_basic.yml | 0 .../10_data_stream_resolvability.yml | 0 .../test/data_stream/110_update_by_query.yml | 0 .../data_stream/120_data_streams_stats.yml | 0 .../130_migrate_to_data_stream.yml | 0 .../data_stream/140_data_stream_aliases.yml | 0 .../test/data_stream/150_tsdb.yml | 0 .../data_stream/160_unsupported_setting.yml | 0 .../data_stream/170_modify_data_stream.yml | 0 .../test/data_stream/20_unsupported_apis.yml | 0 .../30_auto_create_data_stream.yml | 0 .../test/data_stream/40_supported_apis.yml | 0 .../data_stream/50_delete_backing_indices.yml | 0 .../data_stream/60_get_backing_indices.yml | 0 .../data_stream/70_rollover_data_streams.yml | 0 .../80_resolve_index_data_streams.yml | 0 .../test/data_stream/90_reindex.yml | 0 .../elasticsearch/action/ActionModule.java | 9 ---- .../datastreams}/CreateDataStreamAction.java | 7 ++-- .../datastreams}/DataStreamsStatsAction.java | 7 ++-- .../datastreams}/DeleteDataStreamAction.java | 7 ++-- .../datastreams}/GetDataStreamAction.java | 7 ++-- .../MigrateToDataStreamAction.java | 8 ++-- .../datastreams}/PromoteDataStreamAction.java | 8 ++-- x-pack/plugin/autoscaling/build.gradle | 2 +- .../storage/ProactiveStorageIT.java | 4 +- .../elasticsearch/xpack/core/XPackPlugin.java | 4 ++ .../action/DataStreamInfoTransportAction.java | 2 +- .../DataStreamUsageTransportAction.java | 2 +- .../xpack/core/ilm/DeleteStep.java | 2 +- .../authz/privilege/IndexPrivilege.java | 8 ++-- .../authz/store/ReservedRolesStoreTests.java | 6 +-- .../org/elasticsearch/xpack/fleet/Fleet.java | 4 +- x-pack/plugin/ilm/build.gradle | 2 +- .../xpack/ilm/ILMMultiNodeIT.java | 2 +- .../slm/SLMSnapshotBlockingIntegTests.java | 2 +- x-pack/plugin/ml/build.gradle | 2 +- .../qa/native-multi-node-tests/build.gradle | 2 +- .../ml/integration/MlNativeIntegTestCase.java | 4 +- x-pack/plugin/monitoring/build.gradle | 2 +- x-pack/plugin/rollup/build.gradle | 2 +- .../v2/RollupActionSingleNodeTests.java | 4 +- x-pack/plugin/security/build.gradle | 2 +- ...onsWithAliasesWildcardsAndRegexsTests.java | 4 +- .../security/authz/AuthorizationService.java | 4 +- x-pack/plugin/watcher/build.gradle | 2 +- .../AbstractWatcherIntegrationTestCase.java | 4 +- 95 files changed, 235 insertions(+), 235 deletions(-) rename {x-pack/plugin => modules}/data-streams/build.gradle (63%) rename {x-pack/plugin => modules}/data-streams/qa/build.gradle (100%) rename {x-pack/plugin => modules}/data-streams/qa/multi-node/build.gradle (100%) rename {x-pack/plugin => modules}/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java (94%) rename {x-pack/plugin => modules}/data-streams/qa/rest/build.gradle (100%) rename {x-pack/plugin => modules}/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java (98%) rename {x-pack/plugin => modules}/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java (99%) rename {x-pack/plugin => modules}/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java (98%) rename {x-pack/plugin => modules}/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java (99%) rename {x-pack/plugin => modules}/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java (80%) rename {x-pack/plugin => modules}/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java (99%) rename {x-pack/plugin => modules}/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java (97%) rename {x-pack/plugin => modules}/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java (99%) rename {x-pack/plugin => modules}/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java (98%) rename {x-pack/plugin => modules}/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java (97%) rename {x-pack/plugin => modules}/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java (90%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java (94%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java (74%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java (92%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java (89%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java (97%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java (96%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java (95%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java (92%) rename {server/src/main/java/org/elasticsearch/action/datastreams => modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action}/ModifyDataStreamsTransportAction.java (95%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java (94%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java (82%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java (86%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java (84%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java (85%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java (82%) rename {server/src/main/java/org/elasticsearch/rest/action/datastreams => modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest}/RestModifyDataStreamsAction.java (97%) rename {x-pack/plugin => modules}/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java (82%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java (81%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java (92%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java (81%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java (80%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java (83%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java (97%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java (97%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java (97%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java (97%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java (95%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java (97%) rename {x-pack/plugin => modules}/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java (95%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml (100%) rename {x-pack/plugin => rest-api-spec}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml (100%) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action => server/src/main/java/org/elasticsearch/action/datastreams}/CreateDataStreamAction.java (93%) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action => server/src/main/java/org/elasticsearch/action/datastreams}/DataStreamsStatsAction.java (97%) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action => server/src/main/java/org/elasticsearch/action/datastreams}/DeleteDataStreamAction.java (95%) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action => server/src/main/java/org/elasticsearch/action/datastreams}/GetDataStreamAction.java (97%) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core => server/src/main/java/org/elasticsearch/action/datastreams}/MigrateToDataStreamAction.java (92%) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action => server/src/main/java/org/elasticsearch/action/datastreams}/PromoteDataStreamAction.java (92%) rename x-pack/plugin/{data-streams/src/main/java/org/elasticsearch/xpack/datastreams => core/src/main/java/org/elasticsearch/xpack/core}/action/DataStreamInfoTransportAction.java (95%) rename x-pack/plugin/{data-streams/src/main/java/org/elasticsearch/xpack/datastreams => core/src/main/java/org/elasticsearch/xpack/core}/action/DataStreamUsageTransportAction.java (97%) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java index b588f2c0e139d..7f4ecf5ffa4ed 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.action.DataStreamsStatsAction; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java index bd466d24142c7..e1a94fa8347cb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.index.Index; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction.Response.DataStreamInfo; +import org.elasticsearch.action.datastreams.GetDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction.Response.DataStreamInfo; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/data-streams/build.gradle b/modules/data-streams/build.gradle similarity index 63% rename from x-pack/plugin/data-streams/build.gradle rename to modules/data-streams/build.gradle index d7a50704bee53..ea59eb8779461 100644 --- a/x-pack/plugin/data-streams/build.gradle +++ b/modules/data-streams/build.gradle @@ -1,16 +1,12 @@ apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.internal-cluster-test' + esplugin { - name 'x-pack-data-streams' description 'Elasticsearch Expanded Pack Plugin - Data Streams' classname 'org.elasticsearch.xpack.datastreams.DataStreamsPlugin' - extendedPlugins = ['x-pack-core'] } -archivesBaseName = 'x-pack-data-streams' dependencies { - compileOnly project(path: xpackModule('core')) - testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(path: ':plugins:transport-nio') // for http in SystemDataStreamIT } diff --git a/x-pack/plugin/data-streams/qa/build.gradle b/modules/data-streams/qa/build.gradle similarity index 100% rename from x-pack/plugin/data-streams/qa/build.gradle rename to modules/data-streams/qa/build.gradle diff --git a/x-pack/plugin/data-streams/qa/multi-node/build.gradle b/modules/data-streams/qa/multi-node/build.gradle similarity index 100% rename from x-pack/plugin/data-streams/qa/multi-node/build.gradle rename to modules/data-streams/qa/multi-node/build.gradle diff --git a/x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java b/modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java similarity index 94% rename from x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java rename to modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java index 3b774b8da0b43..07387ddd0e8c0 100644 --- a/x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java +++ b/modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.apache.http.util.EntityUtils; diff --git a/x-pack/plugin/data-streams/qa/rest/build.gradle b/modules/data-streams/qa/rest/build.gradle similarity index 100% rename from x-pack/plugin/data-streams/qa/rest/build.gradle rename to modules/data-streams/qa/rest/build.gradle diff --git a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java b/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java similarity index 98% rename from x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java rename to modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java index c77b52385e67d..cddd6087de01b 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java +++ b/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.apache.http.util.EntityUtils; diff --git a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java b/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java similarity index 99% rename from x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java rename to modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java index 872f592e25ed3..297f175dd33a9 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java +++ b/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.client.Request; diff --git a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java b/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java similarity index 98% rename from x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java rename to modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java index 912411c56e72a..b242cbcfe9ca2 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java +++ b/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.client.Request; diff --git a/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java b/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java similarity index 99% rename from x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java rename to modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java index 5ed96c5633200..01a8686c349d3 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java +++ b/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.action.support.AutoCreateIndex; diff --git a/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java b/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java similarity index 80% rename from x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java rename to modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java index 44c2760ad80ec..af3ea65b5800e 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java +++ b/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java similarity index 99% rename from x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java rename to modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java index 2d976798565b6..29edffc2f32f0 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java +++ b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.datastreams; @@ -34,6 +35,10 @@ import org.elasticsearch.action.bulk.BulkItemResponse; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction.Response.DataStreamInfo; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexResponse; @@ -70,10 +75,6 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction.Response.DataStreamInfo; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import org.junit.After; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java similarity index 97% rename from x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java rename to modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java index f821fd1c550eb..7f835f3e02fd0 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java +++ b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.datastreams; import joptsimple.internal.Strings; @@ -18,6 +18,8 @@ import org.elasticsearch.action.bulk.BulkItemResponse; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -26,8 +28,6 @@ import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.MigrateToDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import org.junit.After; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java similarity index 99% rename from x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java rename to modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java index cf83c29ca4ed8..9e7e11cdcfe1a 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java +++ b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamsSnapshotsIT.java @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.datastreams; @@ -24,6 +25,9 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverRequest; import org.elasticsearch.action.admin.indices.rollover.RolloverResponse; import org.elasticsearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -44,9 +48,6 @@ import org.elasticsearch.snapshots.SnapshotRestoreException; import org.elasticsearch.snapshots.SnapshotState; import org.elasticsearch.snapshots.mockstore.MockRepository; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import org.hamcrest.Matchers; import org.junit.After; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java similarity index 98% rename from x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java rename to modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java index fb927180f9f38..4fea8deb6d8f8 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java +++ b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.datastreams; import org.apache.http.util.EntityUtils; @@ -12,6 +12,7 @@ import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse.ResetFeatureStateStatus; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions.Option; import org.elasticsearch.action.support.PlainActionFuture; @@ -39,7 +40,6 @@ import org.elasticsearch.transport.netty4.Netty4Plugin; import org.elasticsearch.transport.nio.NioTransportPlugin; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import org.junit.After; import org.junit.BeforeClass; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java similarity index 97% rename from x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java rename to modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java index b7751b70e1155..8abde1cdf564c 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java +++ b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java @@ -1,15 +1,18 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.datastreams; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.action.admin.indices.get.GetIndexResponse; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; @@ -23,9 +26,6 @@ import org.elasticsearch.snapshots.mockstore.MockRepository; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import org.junit.After; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java similarity index 90% rename from x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java rename to modules/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java index 619fcf7c3be01..c9e45aad5be29 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java +++ b/modules/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java @@ -1,21 +1,20 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import java.util.Arrays; import java.util.Collection; @@ -29,7 +28,7 @@ public class DataTierDataStreamIT extends ESIntegTestCase { @Override protected Collection> nodePlugins() { - return Arrays.asList(LocalStateCompositeXPackPlugin.class, DataStreamsPlugin.class); + return Arrays.asList(DataStreamsPlugin.class); } public void testDefaultDataStreamAllocateToHot() { diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java similarity index 94% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java index 670e504db3166..d7f2b658f83d4 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProvider.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.cluster.metadata.DataStream; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java similarity index 74% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java index 345731f84eaca..da488cd7ea125 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java @@ -1,13 +1,21 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; +import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; +import org.elasticsearch.action.datastreams.ModifyDataStreamsAction; +import org.elasticsearch.action.datastreams.PromoteDataStreamAction; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.settings.ClusterSettings; @@ -19,27 +27,19 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; -import org.elasticsearch.xpack.core.MigrateToDataStreamAction; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DataStreamsStatsAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; -import org.elasticsearch.xpack.core.action.PromoteDataStreamAction; -import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; -import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.datastreams.action.CreateDataStreamTransportAction; -import org.elasticsearch.xpack.datastreams.action.DataStreamInfoTransportAction; -import org.elasticsearch.xpack.datastreams.action.DataStreamUsageTransportAction; import org.elasticsearch.xpack.datastreams.action.DataStreamsStatsTransportAction; import org.elasticsearch.xpack.datastreams.action.DeleteDataStreamTransportAction; import org.elasticsearch.xpack.datastreams.action.GetDataStreamsTransportAction; import org.elasticsearch.xpack.datastreams.action.MigrateToDataStreamTransportAction; +import org.elasticsearch.xpack.datastreams.action.ModifyDataStreamsTransportAction; import org.elasticsearch.xpack.datastreams.action.PromoteDataStreamTransportAction; import org.elasticsearch.xpack.datastreams.rest.RestCreateDataStreamAction; import org.elasticsearch.xpack.datastreams.rest.RestDataStreamsStatsAction; import org.elasticsearch.xpack.datastreams.rest.RestDeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.rest.RestGetDataStreamsAction; import org.elasticsearch.xpack.datastreams.rest.RestMigrateToDataStreamAction; +import org.elasticsearch.xpack.datastreams.rest.RestModifyDataStreamsAction; import org.elasticsearch.xpack.datastreams.rest.RestPromoteDataStreamAction; import java.util.Collection; @@ -54,20 +54,10 @@ public class DataStreamsPlugin extends Plugin implements ActionPlugin { var deleteDsInfoAction = new ActionHandler<>(DeleteDataStreamAction.INSTANCE, DeleteDataStreamTransportAction.class); var getDsAction = new ActionHandler<>(GetDataStreamAction.INSTANCE, GetDataStreamsTransportAction.class); var dsStatsAction = new ActionHandler<>(DataStreamsStatsAction.INSTANCE, DataStreamsStatsTransportAction.class); - var dsUsageAction = new ActionHandler<>(XPackUsageFeatureAction.DATA_STREAMS, DataStreamUsageTransportAction.class); - var dsInfoAction = new ActionHandler<>(XPackInfoFeatureAction.DATA_STREAMS, DataStreamInfoTransportAction.class); var migrateAction = new ActionHandler<>(MigrateToDataStreamAction.INSTANCE, MigrateToDataStreamTransportAction.class); var promoteAction = new ActionHandler<>(PromoteDataStreamAction.INSTANCE, PromoteDataStreamTransportAction.class); - return List.of( - createDsAction, - deleteDsInfoAction, - getDsAction, - dsStatsAction, - dsUsageAction, - dsInfoAction, - migrateAction, - promoteAction - ); + var modifyAction = new ActionHandler<>(ModifyDataStreamsAction.INSTANCE, ModifyDataStreamsTransportAction.class); + return List.of(createDsAction, deleteDsInfoAction, getDsAction, dsStatsAction, migrateAction, promoteAction, modifyAction); } @Override @@ -86,7 +76,8 @@ public List getRestHandlers( var dsStatsAction = new RestDataStreamsStatsAction(); var migrateAction = new RestMigrateToDataStreamAction(); var promoteAction = new RestPromoteDataStreamAction(); - return List.of(createDsAction, deleteDsAction, getDsAction, dsStatsAction, migrateAction, promoteAction); + var modifyAction = new RestModifyDataStreamsAction(); + return List.of(createDsAction, deleteDsAction, getDsAction, dsStatsAction, migrateAction, promoteAction, modifyAction); } @Override diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java similarity index 92% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java index cce3f83795e70..485c151eca2e5 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/CreateDataStreamTransportAction.java @@ -1,12 +1,14 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.action; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction; @@ -22,7 +24,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; public class CreateDataStreamTransportAction extends AcknowledgedTransportMasterNodeAction { diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java similarity index 89% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java index 51e78d5f5535e..2b7fb85a96dbe 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsActionUtil.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.elasticsearch.action.support.IndicesOptions; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java similarity index 97% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java index db6bc236a6b4a..126204ceb4fac 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamsStatsTransportAction.java @@ -1,16 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.apache.lucene.document.LongPoint; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.PointValues; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction; @@ -35,7 +36,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.action.DataStreamsStatsAction; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java similarity index 96% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java index 8e450fadfb908..0c90fba4b2d49 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java @@ -1,16 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction; @@ -34,7 +35,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import java.util.Arrays; import java.util.HashSet; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java similarity index 95% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java index d513be5738d5c..e8c7c4818ed96 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportAction.java @@ -1,15 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.TransportMasterNodeReadAction; import org.elasticsearch.cluster.ClusterState; @@ -28,7 +29,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; import java.util.ArrayList; import java.util.Comparator; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java similarity index 92% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java index 3493763aa2de1..f66c4ccd8b138 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/MigrateToDataStreamTransportAction.java @@ -1,13 +1,14 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction; @@ -23,7 +24,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.MigrateToDataStreamAction; public class MigrateToDataStreamTransportAction extends AcknowledgedTransportMasterNodeAction { diff --git a/server/src/main/java/org/elasticsearch/action/datastreams/ModifyDataStreamsTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/ModifyDataStreamsTransportAction.java similarity index 95% rename from server/src/main/java/org/elasticsearch/action/datastreams/ModifyDataStreamsTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/ModifyDataStreamsTransportAction.java index f9ea83dcc6db9..6e70a17958e4d 100644 --- a/server/src/main/java/org/elasticsearch/action/datastreams/ModifyDataStreamsTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/ModifyDataStreamsTransportAction.java @@ -5,10 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -package org.elasticsearch.action.datastreams; +package org.elasticsearch.xpack.datastreams.action; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.ModifyDataStreamsAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java similarity index 94% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java index 7c0fafa3a6a81..0ee86b931c640 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/PromoteDataStreamTransportAction.java @@ -1,14 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.datastreams.PromoteDataStreamAction; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAction; @@ -27,7 +28,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.action.PromoteDataStreamAction; public class PromoteDataStreamTransportAction extends AcknowledgedTransportMasterNodeAction { diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java similarity index 82% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java index 3cccfc7875efd..ea42be36ce577 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestCreateDataStreamAction.java @@ -1,16 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.rest; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java similarity index 86% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java index 3bb5dffcf3d5e..6a20d0606017a 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDataStreamsStatsAction.java @@ -1,18 +1,19 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.rest; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xpack.core.action.DataStreamsStatsAction; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java similarity index 84% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java index 295f0928a26d4..9ef3b7ac7a1fa 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestDeleteDataStreamAction.java @@ -1,18 +1,19 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.rest; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java similarity index 85% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java index ee35660cc02eb..3408e80769269 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestGetDataStreamsAction.java @@ -1,18 +1,19 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.rest; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java similarity index 82% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java index 1cc92a7c55cb7..996506a1b6db5 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestMigrateToDataStreamAction.java @@ -1,17 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.rest; +import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xpack.core.MigrateToDataStreamAction; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/rest/action/datastreams/RestModifyDataStreamsAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestModifyDataStreamsAction.java similarity index 97% rename from server/src/main/java/org/elasticsearch/rest/action/datastreams/RestModifyDataStreamsAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestModifyDataStreamsAction.java index f3d180a0a67dd..148685252c2f5 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/datastreams/RestModifyDataStreamsAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestModifyDataStreamsAction.java @@ -5,8 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -package org.elasticsearch.rest.action.datastreams; +package org.elasticsearch.xpack.datastreams.rest; import org.elasticsearch.action.datastreams.ModifyDataStreamsAction; import org.elasticsearch.client.internal.node.NodeClient; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java similarity index 82% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java rename to modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java index 275d3be996e98..c4f6127672038 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java @@ -1,16 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.rest; +import org.elasticsearch.action.datastreams.PromoteDataStreamAction; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xpack.core.action.PromoteDataStreamAction; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java similarity index 81% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java index e1dcbd5c5a635..662afaff344f1 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/CreateDataStreamRequestTests.java @@ -1,15 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.ActionRequestValidationException; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction.Request; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction.Request; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java similarity index 92% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java index 95069dde51ac9..2a2d89cc6be7a 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DataStreamsStatsResponseTests.java @@ -1,12 +1,14 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.core.action; import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java similarity index 81% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java index 106eb0a872bea..db7a99b7b26dc 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/DeleteDataStreamRequestTests.java @@ -1,15 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.ActionRequestValidationException; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction.Request; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction.Request; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java similarity index 80% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java index 8706232e41efc..e5558204574b5 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsRequestTests.java @@ -1,14 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.core.action; +import org.elasticsearch.action.datastreams.GetDataStreamAction.Request; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.xpack.core.action.GetDataStreamAction.Request; public class GetDataStreamsRequestTests extends AbstractWireSerializingTestCase { diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java similarity index 83% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java index bd279918290ca..333bd8f7d089b 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/core/action/GetDataStreamsResponseTests.java @@ -1,16 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.core.action; +import org.elasticsearch.action.datastreams.GetDataStreamAction.Response; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.metadata.DataStreamTestHelper; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.xpack.core.action.GetDataStreamAction.Response; import java.util.ArrayList; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java similarity index 97% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java index 7cb683e00b85c..64fb85d32d810 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamIndexSettingsProviderTests.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.cluster.metadata.DataStream; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java similarity index 97% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java index d0f01d0d7906e..32697e086f68d 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.action.DocWriteRequest; @@ -14,6 +14,9 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverRequest; import org.elasticsearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.cluster.health.ClusterHealthStatus; @@ -23,9 +26,6 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.xcontent.json.JsonXContent; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DataStreamsStatsAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.junit.After; import java.util.Collection; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java similarity index 97% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java index 641b77a88a42c..4af1ac718a5ee 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/MetadataDataStreamRolloverServiceTests.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams; import org.elasticsearch.Version; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java similarity index 97% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java index 8a096d7f74a00..45d91d3f96c09 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java @@ -1,13 +1,14 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; import org.elasticsearch.ResourceNotFoundException; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.cluster.metadata.DataStream; @@ -27,7 +28,6 @@ import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.snapshots.SnapshotInProgressException; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import java.util.Collections; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java similarity index 95% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java index 43cd3c465d040..0e549188c34e0 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/GetDataStreamsTransportActionTests.java @@ -1,12 +1,13 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.action; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.DataStream; @@ -15,7 +16,6 @@ import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; import java.util.List; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java similarity index 97% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java index fcec999c588bb..b1d6a61e25f19 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.xpack.datastreams.mapper; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java similarity index 95% rename from x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java rename to modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java index 7fcd574135d9d..cf00da6f5b1d4 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java +++ b/modules/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/MetadataCreateDataStreamServiceTests.java @@ -1,10 +1,10 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.xpack.datastreams.mapper; import org.elasticsearch.Version; diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml diff --git a/server/src/main/java/org/elasticsearch/action/ActionModule.java b/server/src/main/java/org/elasticsearch/action/ActionModule.java index 4a7dfa0b422ec..ce8f11d4d6ffb 100644 --- a/server/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/server/src/main/java/org/elasticsearch/action/ActionModule.java @@ -195,8 +195,6 @@ import org.elasticsearch.action.bulk.BulkAction; import org.elasticsearch.action.bulk.TransportBulkAction; import org.elasticsearch.action.bulk.TransportShardBulkAction; -import org.elasticsearch.action.datastreams.ModifyDataStreamsAction; -import org.elasticsearch.action.datastreams.ModifyDataStreamsTransportAction; import org.elasticsearch.action.delete.DeleteAction; import org.elasticsearch.action.delete.TransportDeleteAction; import org.elasticsearch.action.explain.ExplainAction; @@ -381,7 +379,6 @@ import org.elasticsearch.rest.action.cat.RestTasksAction; import org.elasticsearch.rest.action.cat.RestTemplatesAction; import org.elasticsearch.rest.action.cat.RestThreadPoolAction; -import org.elasticsearch.rest.action.datastreams.RestModifyDataStreamsAction; import org.elasticsearch.rest.action.document.RestBulkAction; import org.elasticsearch.rest.action.document.RestDeleteAction; import org.elasticsearch.rest.action.document.RestGetAction; @@ -628,9 +625,6 @@ public void reg actions.register(AnalyzeIndexDiskUsageAction.INSTANCE, TransportAnalyzeIndexDiskUsageAction.class); actions.register(FieldUsageStatsAction.INSTANCE, TransportFieldUsageAction.class); - // Data streams - actions.register(ModifyDataStreamsAction.INSTANCE, ModifyDataStreamsTransportAction.class); - // Indexed scripts actions.register(PutStoredScriptAction.INSTANCE, TransportPutStoredScriptAction.class); actions.register(GetStoredScriptAction.INSTANCE, TransportGetStoredScriptAction.class); @@ -801,9 +795,6 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestReloadSecureSettingsAction()); - // Data streams - registerHandler.accept(new RestModifyDataStreamsAction()); - // Scripts API registerHandler.accept(new RestGetStoredScriptAction()); registerHandler.accept(new RestPutStoredScriptAction()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/CreateDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java similarity index 93% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/CreateDataStreamAction.java rename to server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java index 47c1571b0d7e2..49bcf38ac0e5f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/CreateDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java @@ -1,10 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -package org.elasticsearch.xpack.core.action; +package org.elasticsearch.action.datastreams; import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/DataStreamsStatsAction.java similarity index 97% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java rename to server/src/main/java/org/elasticsearch/action/datastreams/DataStreamsStatsAction.java index 78f71bebe163f..acf3f37bb61e6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/DataStreamsStatsAction.java @@ -1,10 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -package org.elasticsearch.xpack.core.action; +package org.elasticsearch.action.datastreams; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.DefaultShardOperationFailedException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DeleteDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/DeleteDataStreamAction.java similarity index 95% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DeleteDataStreamAction.java rename to server/src/main/java/org/elasticsearch/action/datastreams/DeleteDataStreamAction.java index e4ecc9b62bdc7..e23accd351a26 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DeleteDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/DeleteDataStreamAction.java @@ -1,10 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -package org.elasticsearch.xpack.core.action; +package org.elasticsearch.action.datastreams; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java similarity index 97% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java rename to server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java index 4b1ec80fa9b11..d3fdc19694f5f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java @@ -1,10 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -package org.elasticsearch.xpack.core.action; +package org.elasticsearch.action.datastreams; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/MigrateToDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/MigrateToDataStreamAction.java similarity index 92% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/MigrateToDataStreamAction.java rename to server/src/main/java/org/elasticsearch/action/datastreams/MigrateToDataStreamAction.java index c436e08376e5b..0f69a68bbfbe8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/MigrateToDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/MigrateToDataStreamAction.java @@ -1,11 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - -package org.elasticsearch.xpack.core; +package org.elasticsearch.action.datastreams; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/PromoteDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/PromoteDataStreamAction.java similarity index 92% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/PromoteDataStreamAction.java rename to server/src/main/java/org/elasticsearch/action/datastreams/PromoteDataStreamAction.java index 14dfdd3ac7d11..f58e9497949bf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/PromoteDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/PromoteDataStreamAction.java @@ -1,11 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - -package org.elasticsearch.xpack.core.action; +package org.elasticsearch.action.datastreams; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; diff --git a/x-pack/plugin/autoscaling/build.gradle b/x-pack/plugin/autoscaling/build.gradle index 6e5b1c783dd83..357a1ea48a528 100644 --- a/x-pack/plugin/autoscaling/build.gradle +++ b/x-pack/plugin/autoscaling/build.gradle @@ -14,7 +14,7 @@ archivesBaseName = 'x-pack-autoscaling' dependencies { compileOnly project(path: xpackModule('core')) testImplementation(testArtifact(project(xpackModule('core')))) - testImplementation project(path: xpackModule('data-streams')) + testImplementation project(':modules:data-streams') testImplementation project(path: xpackModule('searchable-snapshots')) testImplementation project(path: xpackModule('ilm')) diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java index 5201d86f6a880..9e11a4d8c7823 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java @@ -20,8 +20,8 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction; import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.hamcrest.Matchers; import org.junit.After; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java index c43ab23b39d0f..260353e82697d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java @@ -65,6 +65,8 @@ import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.cluster.routing.allocation.mapper.DataTierFieldMapper; +import org.elasticsearch.xpack.core.action.DataStreamInfoTransportAction; +import org.elasticsearch.xpack.core.action.DataStreamUsageTransportAction; import org.elasticsearch.xpack.core.action.ReloadAnalyzerAction; import org.elasticsearch.xpack.core.action.TransportReloadAnalyzersAction; import org.elasticsearch.xpack.core.action.TransportXPackInfoAction; @@ -334,6 +336,8 @@ public Collection createComponents( actions.add(new ActionHandler<>(DeleteAsyncResultAction.INSTANCE, TransportDeleteAsyncResultAction.class)); actions.add(new ActionHandler<>(XPackInfoFeatureAction.DATA_TIERS, DataTiersInfoTransportAction.class)); actions.add(new ActionHandler<>(XPackUsageFeatureAction.DATA_TIERS, DataTiersUsageTransportAction.class)); + actions.add(new ActionHandler<>(XPackUsageFeatureAction.DATA_STREAMS, DataStreamUsageTransportAction.class)); + actions.add(new ActionHandler<>(XPackInfoFeatureAction.DATA_STREAMS, DataStreamInfoTransportAction.class)); return actions; } diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamInfoTransportAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java similarity index 95% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamInfoTransportAction.java rename to x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java index 77c5ca8ea5955..df8d019066855 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamInfoTransportAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java @@ -5,7 +5,7 @@ * 2.0. */ -package org.elasticsearch.xpack.datastreams.action; +package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.common.inject.Inject; diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamUsageTransportAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java similarity index 97% rename from x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamUsageTransportAction.java rename to x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java index ee018a7b3cfaf..b47eae104c174 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DataStreamUsageTransportAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java @@ -5,7 +5,7 @@ * 2.0. */ -package org.elasticsearch.xpack.datastreams.action; +package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java index 1d6078d8d5d0c..96244219a9fe5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java @@ -15,7 +15,7 @@ import org.elasticsearch.cluster.metadata.IndexAbstraction; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import java.util.Locale; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java index 89cd8bb4d7867..27d143c784249 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java @@ -25,10 +25,10 @@ import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction; import org.elasticsearch.common.Strings; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; -import org.elasticsearch.xpack.core.action.PromoteDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; +import org.elasticsearch.action.datastreams.PromoteDataStreamAction; import org.elasticsearch.xpack.core.ccr.action.ForgetFollowerAction; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; import org.elasticsearch.xpack.core.ccr.action.UnfollowAction; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java index a8c2881a39111..5403145f9d326 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java @@ -62,9 +62,9 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.XPackPlugin; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.xpack.core.action.XPackInfoAction; import org.elasticsearch.xpack.core.ilm.action.DeleteLifecycleAction; import org.elasticsearch.xpack.core.ilm.action.ExplainLifecycleAction; diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java index 19152a4ba8938..47daddbd046a1 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java @@ -46,8 +46,8 @@ import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction.Request; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction.Request; import org.elasticsearch.xpack.core.template.TemplateUtils; import org.elasticsearch.xpack.fleet.action.GetGlobalCheckpointsAction; import org.elasticsearch.xpack.fleet.action.GetGlobalCheckpointsShardAction; diff --git a/x-pack/plugin/ilm/build.gradle b/x-pack/plugin/ilm/build.gradle index b880850657924..b3c64ed4cde8e 100644 --- a/x-pack/plugin/ilm/build.gradle +++ b/x-pack/plugin/ilm/build.gradle @@ -14,7 +14,7 @@ archivesBaseName = 'x-pack-ilm' dependencies { compileOnly project(path: xpackModule('core')) testImplementation(testArtifact(project(xpackModule('core')))) - testImplementation project(path: xpackModule('data-streams')) + testImplementation project(':modules:data-streams') } addQaCheckDependencies() diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java index 8bc121871ba6b..9297a68fae60a 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java @@ -18,7 +18,7 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.ilm.ExplainLifecycleRequest; import org.elasticsearch.xpack.core.ilm.ExplainLifecycleResponse; import org.elasticsearch.xpack.core.ilm.IndexLifecycleExplainResponse; diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java index f33f300a2bf2c..d5a56b58e6d56 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java @@ -33,7 +33,7 @@ import org.elasticsearch.snapshots.mockstore.MockRepository; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.ilm.LifecycleSettings; import org.elasticsearch.xpack.core.slm.SnapshotInvocationRecord; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy; diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index 40c086809c514..68254206ec675 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -61,7 +61,7 @@ dependencies { testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(path: xpackModule('ilm')) testImplementation project(path: xpackModule('shutdown')) - testImplementation project(path: xpackModule('data-streams')) + testImplementation project(':modules:data-streams') testImplementation project(path: xpackModule('monitoring')) testImplementation project(':modules:ingest-common') testImplementation project(':modules:reindex') diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index a58a8569a1d45..9baa7d38c5293 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -9,7 +9,7 @@ dependencies { javaRestTestImplementation project(path: ':modules:reindex') javaRestTestImplementation project(path: ':modules:transport-netty4') javaRestTestImplementation project(path: xpackModule('autoscaling')) - javaRestTestImplementation project(path: xpackModule('data-streams')) + javaRestTestImplementation project(':modules:data-streams') javaRestTestImplementation project(path: xpackModule('ilm')) javaRestTestImplementation project(path: xpackModule('monitoring')) javaRestTestImplementation project(path: xpackModule('transform')) diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java index 11e0c29c84898..7af1419b48622 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java @@ -54,8 +54,8 @@ import org.elasticsearch.xpack.autoscaling.AutoscalingMetadata; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.ForceMergeAction; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; diff --git a/x-pack/plugin/monitoring/build.gradle b/x-pack/plugin/monitoring/build.gradle index c1f68a63dfe1f..7ec0e36c8c347 100644 --- a/x-pack/plugin/monitoring/build.gradle +++ b/x-pack/plugin/monitoring/build.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation project(":modules:analysis-common") testImplementation project(xpackModule('watcher')) testImplementation project(xpackModule('ilm')) - testImplementation project(xpackModule('data-streams')) + testImplementation project(':modules:data-streams') testImplementation(testArtifact(project(xpackModule('core')))) } diff --git a/x-pack/plugin/rollup/build.gradle b/x-pack/plugin/rollup/build.gradle index f825239e4c6e8..483a84aea9987 100644 --- a/x-pack/plugin/rollup/build.gradle +++ b/x-pack/plugin/rollup/build.gradle @@ -15,7 +15,7 @@ dependencies { compileOnly project(path: xpackModule('core')) compileOnly project(path: xpackModule('analytics')) compileOnly project(path: xpackModule('mapper-aggregate-metric')) - compileOnly project(path: xpackModule('data-streams')) + compileOnly project(':modules:data-streams') testImplementation(testArtifact(project(xpackModule('core')))) } diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java index 9117664fd2f47..1a61a910d9a37 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java @@ -52,8 +52,8 @@ import org.elasticsearch.xpack.aggregatemetric.AggregateMetricMapperPlugin; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; import org.elasticsearch.xpack.core.rollup.RollupActionConfig; import org.elasticsearch.xpack.core.rollup.RollupActionDateHistogramGroupConfig; diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index ee65c39f1ec59..d5b652c281af0 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -27,7 +27,7 @@ dependencies { testImplementation project(path: xpackModule('sql:sql-action')) testImplementation project(path: ':modules:analysis-common') testImplementation project(path: ':modules:reindex') - testImplementation project(path: xpackModule('data-streams')) + testImplementation project(':modules:data-streams') testImplementation project(":client:rest-high-level") testImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java index 5c88dc0652789..6890410cde9f3 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java @@ -23,8 +23,8 @@ import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java index a793ad6630d4c..ecfd22b97f761 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java @@ -40,8 +40,8 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportActionProxy; import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.xpack.core.MigrateToDataStreamAction; -import org.elasticsearch.xpack.core.action.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; import org.elasticsearch.xpack.core.security.action.apikey.QueryApiKeyAction; import org.elasticsearch.xpack.core.security.action.apikey.QueryApiKeyRequest; import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesRequest; diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index e45daa068cf6d..93f4015586181 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -26,7 +26,7 @@ dependencies { testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(xpackModule('ilm')) - testImplementation project(xpackModule('data-streams')) + testImplementation project(':modules:data-streams') testImplementation project(':modules:lang-mustache') // watcher deps diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index 7334ee4ed0a13..e0899fa557ca4 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -42,8 +42,8 @@ import org.elasticsearch.test.store.MockFSIndexStore; import org.elasticsearch.test.transport.MockTransportService; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; -import org.elasticsearch.xpack.core.action.GetDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.core.watcher.WatcherField; import org.elasticsearch.xpack.core.watcher.WatcherState; From ba1e49dad951e8406502614ba89f275a053e5d02 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 09:29:30 +0100 Subject: [PATCH 02/16] spotless --- .../client/indices/DataStreamsStatsResponseTests.java | 2 +- .../client/indices/GetDataStreamResponseTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java index 7f4ecf5ffa4ed..b2380ad1dff9f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.indices; import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.action.datastreams.DataStreamsStatsAction; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.action.datastreams.DataStreamsStatsAction; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java index e1a94fa8347cb..37fc219a3ba38 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java @@ -8,6 +8,8 @@ package org.elasticsearch.client.indices; +import org.elasticsearch.action.datastreams.GetDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction.Response.DataStreamInfo; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.metadata.DataStream; @@ -15,8 +17,6 @@ import org.elasticsearch.index.Index; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.action.datastreams.GetDataStreamAction; -import org.elasticsearch.action.datastreams.GetDataStreamAction.Response.DataStreamInfo; import java.io.IOException; import java.util.ArrayList; From 0e3c8eea8d74bba4aae5e8dc65d491f7e784bc10 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 09:37:59 +0100 Subject: [PATCH 03/16] undo move of yaml test, that tests resolvability of data streams in other xpack features. --- .../test/data_stream/10_data_stream_resolvability.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {rest-api-spec => x-pack/plugin}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml (100%) diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml rename to x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml From ca8450864adbf0a1a6586b47f186fe5ed2ffae24 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 09:43:54 +0100 Subject: [PATCH 04/16] spotless --- .../xpack/autoscaling/storage/ProactiveStorageIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java index 9e11a4d8c7823..22a81e4ff8578 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageIT.java @@ -10,6 +10,8 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverRequest; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.IndexMetadata; @@ -20,8 +22,6 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction; import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction; -import org.elasticsearch.action.datastreams.CreateDataStreamAction; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.hamcrest.Matchers; import org.junit.After; From 564f2fd8bd84f55666474bb1b24209e2a5ffd826 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 09:49:22 +0100 Subject: [PATCH 05/16] spotless --- .../xpack/core/action/DataStreamInfoTransportAction.java | 2 -- .../xpack/core/action/DataStreamUsageTransportAction.java | 3 --- .../java/org/elasticsearch/xpack/core/ilm/DeleteStep.java | 2 +- .../xpack/core/security/authz/privilege/IndexPrivilege.java | 4 ++-- .../core/security/authz/store/ReservedRolesStoreTests.java | 6 +++--- .../src/main/java/org/elasticsearch/xpack/fleet/Fleet.java | 4 ++-- .../java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java | 2 +- .../xpack/slm/SLMSnapshotBlockingIntegTests.java | 2 +- .../xpack/ml/integration/MlNativeIntegTestCase.java | 4 ++-- .../xpack/rollup/v2/RollupActionSingleNodeTests.java | 4 ++-- ...ndicesPermissionsWithAliasesWildcardsAndRegexsTests.java | 4 ++-- .../xpack/security/authz/AuthorizationService.java | 4 ++-- .../watcher/test/AbstractWatcherIntegrationTestCase.java | 4 ++-- 13 files changed, 20 insertions(+), 25 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java index df8d019066855..d12f3dbb7f650 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamInfoTransportAction.java @@ -11,8 +11,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackField; -import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; -import org.elasticsearch.xpack.core.action.XPackInfoFeatureTransportAction; public class DataStreamInfoTransportAction extends XPackInfoFeatureTransportAction { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java index b47eae104c174..fd62289c51c93 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamUsageTransportAction.java @@ -18,9 +18,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; -import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; -import org.elasticsearch.xpack.core.action.XPackUsageFeatureTransportAction; import org.elasticsearch.xpack.core.datastreams.DataStreamFeatureSetUsage; import java.util.Map; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java index 96244219a9fe5..f966f2c68f1da 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteStep.java @@ -10,12 +10,12 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.client.internal.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexAbstraction; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import java.util.Locale; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java index 27d143c784249..0f79f7b9310ae 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java @@ -23,12 +23,12 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverAction; import org.elasticsearch.action.admin.indices.settings.get.GetSettingsAction; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction; -import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction; -import org.elasticsearch.common.Strings; import org.elasticsearch.action.datastreams.CreateDataStreamAction; import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.datastreams.PromoteDataStreamAction; +import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction; +import org.elasticsearch.common.Strings; import org.elasticsearch.xpack.core.ccr.action.ForgetFollowerAction; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; import org.elasticsearch.xpack.core.ccr.action.UnfollowAction; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java index 5403145f9d326..4b166e15f8b56 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java @@ -41,6 +41,9 @@ import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateAction; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction; import org.elasticsearch.action.bulk.BulkAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.delete.DeleteAction; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction; import org.elasticsearch.action.get.GetAction; @@ -62,9 +65,6 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.XPackPlugin; -import org.elasticsearch.action.datastreams.CreateDataStreamAction; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; -import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.xpack.core.action.XPackInfoAction; import org.elasticsearch.xpack.core.ilm.action.DeleteLifecycleAction; import org.elasticsearch.xpack.core.ilm.action.ExplainLifecycleAction; diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java index 47daddbd046a1..2d15243de6344 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java @@ -15,6 +15,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse.ResetFeatureStateStatus; import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction.Request; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions.Option; import org.elasticsearch.client.internal.Client; @@ -46,8 +48,6 @@ import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction.Request; import org.elasticsearch.xpack.core.template.TemplateUtils; import org.elasticsearch.xpack.fleet.action.GetGlobalCheckpointsAction; import org.elasticsearch.xpack.fleet.action.GetGlobalCheckpointsShardAction; diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java index 9297a68fae60a..f76059cf7275a 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ILMMultiNodeIT.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ilm; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.cluster.metadata.IndexMetadata; @@ -18,7 +19,6 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.ilm.ExplainLifecycleRequest; import org.elasticsearch.xpack.core.ilm.ExplainLifecycleResponse; import org.elasticsearch.xpack.core.ilm.IndexLifecycleExplainResponse; diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java index d5a56b58e6d56..64f644e8b6247 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMSnapshotBlockingIntegTests.java @@ -14,6 +14,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotStatus; import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.cluster.health.ClusterHealthStatus; @@ -33,7 +34,6 @@ import org.elasticsearch.snapshots.mockstore.MockRepository; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.ilm.LifecycleSettings; import org.elasticsearch.xpack.core.slm.SnapshotInvocationRecord; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java index 7af1419b48622..cb342205a3d74 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java @@ -12,6 +12,8 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequestBuilder; @@ -54,8 +56,6 @@ import org.elasticsearch.xpack.autoscaling.AutoscalingMetadata; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.action.datastreams.CreateDataStreamAction; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.ForceMergeAction; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java index 1a61a910d9a37..2e80ade81567f 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java @@ -18,6 +18,8 @@ import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; @@ -52,8 +54,6 @@ import org.elasticsearch.xpack.aggregatemetric.AggregateMetricMapperPlugin; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; -import org.elasticsearch.action.datastreams.CreateDataStreamAction; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; import org.elasticsearch.xpack.core.rollup.RollupActionConfig; import org.elasticsearch.xpack.core.rollup.RollupActionDateHistogramGroupConfig; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java index 6890410cde9f3..5e37c9517165c 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/IndicesPermissionsWithAliasesWildcardsAndRegexsTests.java @@ -10,6 +10,8 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; import org.elasticsearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -23,8 +25,6 @@ import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.action.datastreams.CreateDataStreamAction; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java index ecfd22b97f761..6bf84a7884d6f 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationService.java @@ -19,6 +19,8 @@ import org.elasticsearch.action.bulk.BulkItemRequest; import org.elasticsearch.action.bulk.BulkShardRequest; import org.elasticsearch.action.bulk.TransportShardBulkAction; +import org.elasticsearch.action.datastreams.CreateDataStreamAction; +import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; import org.elasticsearch.action.delete.DeleteAction; import org.elasticsearch.action.index.IndexAction; import org.elasticsearch.action.support.GroupedActionListener; @@ -40,8 +42,6 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportActionProxy; import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.action.datastreams.MigrateToDataStreamAction; -import org.elasticsearch.action.datastreams.CreateDataStreamAction; import org.elasticsearch.xpack.core.security.action.apikey.QueryApiKeyAction; import org.elasticsearch.xpack.core.security.action.apikey.QueryApiKeyRequest; import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesRequest; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index e0899fa557ca4..b938fa8db47a8 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -14,6 +14,8 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.get.GetIndexResponse; import org.elasticsearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; +import org.elasticsearch.action.datastreams.DeleteDataStreamAction; +import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.IndicesOptions; @@ -42,8 +44,6 @@ import org.elasticsearch.test.store.MockFSIndexStore; import org.elasticsearch.test.transport.MockTransportService; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.action.datastreams.DeleteDataStreamAction; -import org.elasticsearch.action.datastreams.GetDataStreamAction; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.core.watcher.WatcherField; import org.elasticsearch.xpack.core.watcher.WatcherState; From e8ce6aabcbc5006e3788747ce812cf686a2ca5b0 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 11:01:23 +0100 Subject: [PATCH 06/16] add data-streams module by default to test clusters --- rest-api-spec/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 71e735de95476..e2ac7aa93fe94 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -35,6 +35,7 @@ artifacts { testClusters.configureEach { module ':modules:mapper-extras' + module ':modules:data-streams' if (BuildParams.isSnapshotBuild() == false) { systemProperty 'es.index_mode_feature_flag_registered', 'true' systemProperty 'es.random_sampler_feature_flag_registered', 'true' From 6b2645d05c24cd25bc26ebc23bdc0cf43d6c94a3 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 11:32:59 +0100 Subject: [PATCH 07/16] ensure SystemDataStreamIT has the right jvm privileges to run (SocketPermission) --- modules/data-streams/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/data-streams/build.gradle b/modules/data-streams/build.gradle index ea59eb8779461..3c90d99319990 100644 --- a/modules/data-streams/build.gradle +++ b/modules/data-streams/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'elasticsearch.internal-es-plugin' +apply plugin: 'elasticsearch.test-with-dependencies' apply plugin: 'elasticsearch.internal-cluster-test' esplugin { From 68da146e1a719ca04821f1f780185e57d93c6d91 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 12:28:23 +0100 Subject: [PATCH 08/16] Move yaml and rest tests: * Move xpack related yaml tests back to xpack. * Move info and usage related rest tests to xpack core module * Move yaml tests to data stream module * Move all qa tests to regular java rest tests inside data stream module --- modules/data-streams/build.gradle | 42 ++++++++++++++++++- modules/data-streams/qa/build.gradle | 0 .../data-streams/qa/multi-node/build.gradle | 28 ------------- modules/data-streams/qa/rest/build.gradle | 33 --------------- .../datastreams/AutoCreateDataStreamIT.java | 0 .../datastreams/DataStreamUpgradeRestIT.java | 10 +++++ .../xpack/datastreams/DataStreamsRestIT.java | 0 .../datastreams/TsdbDataStreamRestIT.java | 0 .../DataStreamsClientYamlTestSuiteIT.java | 10 +++++ .../test/data_stream/100_delete_by_query.yml | 0 .../test/data_stream/10_basic.yml | 0 .../test/data_stream/110_update_by_query.yml | 0 .../data_stream/120_data_streams_stats.yml | 0 .../130_migrate_to_data_stream.yml | 0 .../data_stream/140_data_stream_aliases.yml | 0 .../test/data_stream/150_tsdb.yml | 0 .../data_stream/160_unsupported_setting.yml | 0 .../data_stream/170_modify_data_stream.yml | 0 .../test/data_stream/20_unsupported_apis.yml | 0 .../30_auto_create_data_stream.yml | 0 .../test/data_stream/40_supported_apis.yml | 0 .../data_stream/50_delete_backing_indices.yml | 0 .../data_stream/60_get_backing_indices.yml | 0 .../data_stream/70_rollover_data_streams.yml | 0 .../80_resolve_index_data_streams.yml | 0 .../test/data_stream/90_reindex.yml | 0 rest-api-spec/build.gradle | 1 - x-pack/plugin/core/build.gradle | 8 ++++ .../xpack/core}/DataStreamRestIT.java | 12 +++++- .../10_data_stream_resolvability.yml | 0 30 files changed, 80 insertions(+), 64 deletions(-) delete mode 100644 modules/data-streams/qa/build.gradle delete mode 100644 modules/data-streams/qa/multi-node/build.gradle delete mode 100644 modules/data-streams/qa/rest/build.gradle rename modules/data-streams/{qa/rest/src/yamlRestTest => src/javaRestTest}/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java (100%) rename modules/data-streams/{qa/rest => }/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java (96%) rename modules/data-streams/{qa/rest => }/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java (100%) rename modules/data-streams/{qa/rest => }/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java (100%) rename modules/data-streams/{qa/rest => }/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java (66%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml (100%) rename {rest-api-spec => modules/data-streams}/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml (100%) rename {modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams => x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core}/DataStreamRestIT.java (86%) rename x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/{data_stream => data_streams}/10_data_stream_resolvability.yml (100%) diff --git a/modules/data-streams/build.gradle b/modules/data-streams/build.gradle index 3c90d99319990..ab0b8687a8626 100644 --- a/modules/data-streams/build.gradle +++ b/modules/data-streams/build.gradle @@ -1,5 +1,10 @@ +import org.elasticsearch.gradle.internal.info.BuildParams + apply plugin: 'elasticsearch.test-with-dependencies' apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'elasticsearch.internal-yaml-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' +apply plugin: 'elasticsearch.yaml-rest-compat-test' esplugin { description 'Elasticsearch Expanded Pack Plugin - Data Streams' @@ -10,4 +15,39 @@ dependencies { testImplementation project(path: ':plugins:transport-nio') // for http in SystemDataStreamIT } -addQaCheckDependencies() +restResources { + restApi { + include 'bulk', 'count', 'search', '_common', 'indices', 'index', 'cluster', 'rank_eval', 'reindex', 'update_by_query', 'delete_by_query', + 'eql', 'data_stream' + } +} + +testClusters.configureEach { + module ':modules:reindex' + testDistribution = 'DEFAULT' + // disable ILM history, since it disturbs tests using _all + setting 'indices.lifecycle.history_index_enabled', 'false' + setting 'xpack.security.enabled', 'true' + keystore 'bootstrap.password', 'x-pack-test-password' + user username: "x_pack_rest_user", password: "x-pack-test-password" + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } +} + +testClusters.matching { it.name == "javaRestTest" }.configureEach { + testDistribution = 'DEFAULT' + setting 'xpack.security.enabled', 'false' + // disable ILM history, since it disturbs tests using _all + setting 'indices.lifecycle.history_index_enabled', 'false' + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } +} + +if (BuildParams.inFipsJvm){ + // These fail in CI but only when run as part of checkPart2 and not individually. + // Tracked in : + tasks.named("javaRestTest").configure{enabled = false } + tasks.named("yamlRestTest").configure{enabled = false } +} diff --git a/modules/data-streams/qa/build.gradle b/modules/data-streams/qa/build.gradle deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/modules/data-streams/qa/multi-node/build.gradle b/modules/data-streams/qa/multi-node/build.gradle deleted file mode 100644 index 0dfc36b3c8561..0000000000000 --- a/modules/data-streams/qa/multi-node/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -import org.elasticsearch.gradle.internal.info.BuildParams - -apply plugin: 'elasticsearch.internal-java-rest-test' - -File repoDir = file("$buildDir/testclusters/repo") - -tasks.named("javaRestTest").configure { - /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir -} - -testClusters.matching { it.name == "javaRestTest" }.configureEach { - testDistribution = 'DEFAULT' - numberOfNodes = 4 - - setting 'path.repo', repoDir.absolutePath - setting 'xpack.security.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' - //disabling ILM history as it disturbs testDSXpackUsage test - setting 'indices.lifecycle.history_index_enabled', 'false' -} - -if (BuildParams.inFipsJvm){ - // Test clusters run with security disabled - tasks.named("javaRestTest").configure{enabled = false } -} diff --git a/modules/data-streams/qa/rest/build.gradle b/modules/data-streams/qa/rest/build.gradle deleted file mode 100644 index 80e3647638994..0000000000000 --- a/modules/data-streams/qa/rest/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -import org.elasticsearch.gradle.internal.info.BuildParams - -apply plugin: 'elasticsearch.internal-java-rest-test' -apply plugin: 'elasticsearch.internal-yaml-rest-test' -apply plugin: 'elasticsearch.yaml-rest-compat-test' - -restResources { - restApi { - include 'bulk', 'count', 'search', '_common', 'indices', 'index', 'cluster', 'rank_eval', 'reindex', 'update_by_query', 'delete_by_query', - 'eql', 'data_stream', 'migration', 'async_search', 'searchable_snapshots', 'rollup', 'graph', 'ilm', 'open_point_in_time', 'close_point_in_time' - } - restTests { - includeXpack 'data_stream' - } -} - -testClusters.configureEach { - testDistribution = 'DEFAULT' - // Data streams is basic, but a few tests test data streams in combination with paid features - setting 'xpack.license.self_generated.type', 'trial' - // disable ILM history, since it disturbs tests using _all - setting 'indices.lifecycle.history_index_enabled', 'false' - setting 'xpack.security.enabled', 'false' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.index_mode_feature_flag_registered', 'true' - } -} -if (BuildParams.inFipsJvm){ - // These fail in CI but only when run as part of checkPart2 and not individually. - // Tracked in : - tasks.named("javaRestTest").configure{enabled = false } - tasks.named("yamlRestTest").configure{enabled = false } -} diff --git a/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java similarity index 100% rename from modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java rename to modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java diff --git a/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java similarity index 96% rename from modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java rename to modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java index cddd6087de01b..c423252a3d43f 100644 --- a/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java +++ b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java @@ -11,6 +11,9 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.test.rest.ESRestTestCase; @@ -30,6 +33,13 @@ */ public class DataStreamUpgradeRestIT extends ESRestTestCase { + private static final String BASIC_AUTH_VALUE = basicAuthHeaderValue("x_pack_rest_user", new SecureString("x-pack-test-password")); + + @Override + protected Settings restClientSettings() { + return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", BASIC_AUTH_VALUE).build(); + } + public void testCompatibleMappingUpgrade() throws Exception { // Create pipeline Request putPipelineRequest = new Request("PUT", "/_ingest/pipeline/mysql-error1"); diff --git a/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java similarity index 100% rename from modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java rename to modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsRestIT.java diff --git a/modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java similarity index 100% rename from modules/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java rename to modules/data-streams/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/TsdbDataStreamRestIT.java diff --git a/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java b/modules/data-streams/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java similarity index 66% rename from modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java rename to modules/data-streams/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java index af3ea65b5800e..806328cc86995 100644 --- a/modules/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java +++ b/modules/data-streams/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamsClientYamlTestSuiteIT.java @@ -9,6 +9,9 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; @@ -23,4 +26,11 @@ public static Iterable parameters() throws Exception { return createParameters(); } + private static final String BASIC_AUTH_VALUE = basicAuthHeaderValue("x_pack_rest_user", new SecureString("x-pack-test-password")); + + @Override + protected Settings restClientSettings() { + return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", BASIC_AUTH_VALUE).build(); + } + } diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/100_delete_by_query.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/110_update_by_query.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/120_data_streams_stats.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/130_migrate_to_data_stream.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/140_data_stream_aliases.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/170_modify_data_stream.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/20_unsupported_apis.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/30_auto_create_data_stream.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/40_supported_apis.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/50_delete_backing_indices.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/60_get_backing_indices.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/70_rollover_data_streams.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/80_resolve_index_data_streams.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml b/modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml rename to modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/90_reindex.yml diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index e2ac7aa93fe94..71e735de95476 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -35,7 +35,6 @@ artifacts { testClusters.configureEach { module ':modules:mapper-extras' - module ':modules:data-streams' if (BuildParams.isSnapshotBuild() == false) { systemProperty 'es.index_mode_feature_flag_registered', 'true' systemProperty 'es.random_sampler_feature_flag_registered', 'true' diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle index 0c84e04797bc8..768bbb936ee0f 100644 --- a/x-pack/plugin/core/build.gradle +++ b/x-pack/plugin/core/build.gradle @@ -7,6 +7,7 @@ apply plugin: 'elasticsearch.internal-es-plugin' apply plugin: 'elasticsearch.publish' apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' +apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.yaml-rest-compat-test' apply plugin: 'elasticsearch.internal-test-artifact' @@ -133,6 +134,13 @@ testClusters.configureEach { testDistribution = 'default' setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' + //disabling ILM history as it disturbs testDSXpackUsage test + setting 'indices.lifecycle.history_index_enabled', 'false' keystore 'bootstrap.password', 'x-pack-test-password' user username: "x_pack_rest_user", password: "x-pack-test-password" } + +if (BuildParams.inFipsJvm){ + // Test clusters run with security disabled + tasks.named("javaRestTest").configure{enabled = false } +} diff --git a/modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java b/x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java similarity index 86% rename from modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java rename to x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java index 07387ddd0e8c0..dadf8b778a886 100644 --- a/modules/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java +++ b/x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java @@ -5,11 +5,14 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.xpack.datastreams; +package org.elasticsearch.xpack.core; import org.apache.http.util.EntityUtils; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.xcontent.NamedXContentRegistry; @@ -23,6 +26,13 @@ public class DataStreamRestIT extends ESRestTestCase { + private static final String BASIC_AUTH_VALUE = basicAuthHeaderValue("x_pack_rest_user", new SecureString("x-pack-test-password")); + + @Override + protected Settings restClientSettings() { + return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", BASIC_AUTH_VALUE).build(); + } + @SuppressWarnings("unchecked") public void testDSXpackInfo() { Map features = (Map) getLocation("/_xpack").get("features"); diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_streams/10_data_stream_resolvability.yml similarity index 100% rename from x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_data_stream_resolvability.yml rename to x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_streams/10_data_stream_resolvability.yml From d78e220db6e653749a430a874c4fb367f0b573cb Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 12:45:50 +0100 Subject: [PATCH 09/16] fix license header after move --- .../java/org/elasticsearch/xpack/core/DataStreamRestIT.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java b/x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java index dadf8b778a886..a5c4ab8e6156b 100644 --- a/x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java +++ b/x-pack/plugin/core/src/javaRestTest/java/org/elasticsearch/xpack/core/DataStreamRestIT.java @@ -1,9 +1,8 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ package org.elasticsearch.xpack.core; From 471a217c5e5e7d7239505439e266ab5ae88fbd34 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 2 Feb 2022 13:03:22 +0100 Subject: [PATCH 10/16] Suppress line length checkstyle checking for one file. --- .../src/main/resources/checkstyle_suppressions.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-tools-internal/src/main/resources/checkstyle_suppressions.xml b/build-tools-internal/src/main/resources/checkstyle_suppressions.xml index a205b83364cde..b1636cbf7d708 100644 --- a/build-tools-internal/src/main/resources/checkstyle_suppressions.xml +++ b/build-tools-internal/src/main/resources/checkstyle_suppressions.xml @@ -29,6 +29,9 @@ + + + - +