diff --git a/reports-scheduler/.idea/misc.xml b/reports-scheduler/.idea/misc.xml index 7844d451..cecfa8fc 100644 --- a/reports-scheduler/.idea/misc.xml +++ b/reports-scheduler/.idea/misc.xml @@ -4,6 +4,9 @@ + + diff --git a/reports-scheduler/LICENSE.txt b/reports-scheduler/LICENSE.txt deleted file mode 100644 index 7a4a3ea2..00000000 --- a/reports-scheduler/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/reports-scheduler/NOTICE b/reports-scheduler/NOTICE deleted file mode 100644 index 015a81b9..00000000 --- a/reports-scheduler/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -Open Distro for Elasticsearch Reports Scheduler -Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/reports-scheduler/build-tools/esplugin-coverage.gradle b/reports-scheduler/build-tools/esplugin-coverage.gradle index 993cc8aa..3dba89d4 100644 --- a/reports-scheduler/build-tools/esplugin-coverage.gradle +++ b/reports-scheduler/build-tools/esplugin-coverage.gradle @@ -16,7 +16,7 @@ /** * ES Plugin build tools don't work with the Gradle Jacoco Plugin to report coverage out of the box. - * https://github.com/elastic/elasticsearch/issues/28867. + * https://github.com/elastic/opensearch/issues/28867. * * This code sets up coverage reporting manually for ES plugin tests. This is complicated because: * 1. The ES integTest Task doesn't implement Gradle's JavaForkOptions so we have to manually start the jacoco agent with the test JVM diff --git a/reports-scheduler/build-tools/pkgbuild.gradle b/reports-scheduler/build-tools/pkgbuild.gradle index 936ab57d..b2a1f0ee 100644 --- a/reports-scheduler/build-tools/pkgbuild.gradle +++ b/reports-scheduler/build-tools/pkgbuild.gradle @@ -23,9 +23,9 @@ afterEvaluate { release = isSnapshot ? "0.1" : '1' version = "${project.version}" - "-SNAPSHOT" - into '/usr/share/elasticsearch/plugins' + into '/usr/share/opensearch/plugins' from(zipTree(bundlePlugin.archivePath)) { - into esplugin.name + into opensearchplugin.name } user 'root' @@ -33,18 +33,18 @@ afterEvaluate { fileMode 0644 dirMode 0755 - requires('elasticsearch-oss', versions.elasticsearch, EQUAL) + requires('opensearch-oss', versions.opensearch, EQUAL) packager = 'Amazon' vendor = 'Amazon' os = 'LINUX' prefix '/usr' license 'ASL-2.0' - maintainer 'OpenDistro for Elasticsearch Team ' - url 'https://opendistro.github.io/elasticsearch/downloads' + maintainer 'OpenDistro for OpenSearch Team ' + url 'https://opendistro.github.io/opensearch/downloads' summary ''' - Open Distro for Elasticsearch Report scheduler. - Reference documentation can be found at https://opendistro.github.io/elasticsearch/docs. + OpenSearch Report scheduler. + Reference documentation can be found at https://opendistro.github.io/opensearch/docs. '''.stripIndent().replace('\n', ' ').trim() } diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index c431010e..980e7d99 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -1,31 +1,33 @@ /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. */ -import org.elasticsearch.gradle.test.RestIntegTestTask +import org.opensearch.gradle.test.RestIntegTestTask import java.util.concurrent.Callable buildscript { ext { - es_group = "org.elasticsearch" - es_version = System.getProperty("es.version", "7.10.2") + es_group = "org.opensearch" + es_version = System.getProperty("es.version", "7.10.3-SNAPSHOT") kotlin_version = System.getProperty("kotlin.version", "1.4.0") } repositories { mavenCentral() - maven { url "https://plugins.gradle.org/m2/" } + maven { + url = 's3://search-vemsarat/' + credentials(AwsCredentials) { + accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id') + secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key') + } + } jcenter() } @@ -47,8 +49,8 @@ plugins { apply plugin: 'java' apply plugin: 'jacoco' apply plugin: 'idea' -apply plugin: 'elasticsearch.esplugin' -apply plugin: 'elasticsearch.testclusters' +apply plugin: 'opensearch.opensearchplugin' +apply plugin: 'opensearch.testclusters' apply plugin: 'io.gitlab.arturbosch.detekt' apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'org.jetbrains.kotlin.plugin.allopen' @@ -58,9 +60,9 @@ def usingMultiNode = project.properties.containsKey('numNodes') check.dependsOn jacocoTestReport -esplugin { +opensearchplugin { name 'opendistro-reports-scheduler' - description 'Scheduler for ODFE Kibana Reports Plugin' + description 'Scheduler for Dashboards Reports Plugin' classname "com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin" extendedPlugins = ['opendistro-job-scheduler'] } @@ -120,13 +122,23 @@ allprojects { } } +repositories { + maven { + url = 's3://search-vemsarat/' + credentials(AwsCredentials) { + accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id') + secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key') + } + } +} + dependencies { - compile "org.elasticsearch:elasticsearch:${es_version}" + compile "org.opensearch:opensearch:${es_version}" compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" compile "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}" compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9" compile "${group}:common-utils:${opendistroVersion}.0" - compileOnly "${group}:opendistro-job-scheduler-spi:${opendistroVersion}.0" + compileOnly "${group}:opendistro-job-scheduler-spi:${opendistroVersion}.0-SNAPSHOT" compile group: 'com.google.guava', name: 'guava', version: '15.0' compile "org.json:json:20180813" compile group: 'com.github.wnameless', name: 'json-flattener', version: '0.1.0' @@ -136,7 +148,7 @@ dependencies { 'org.junit.jupiter:junit-jupiter-api:5.6.2' ) testRuntime('org.junit.jupiter:junit-jupiter-engine:5.6.2') - testCompile "org.elasticsearch.test:framework:${es_version}" + testCompile "org.opensearch.test:framework:${es_version}" testCompile "org.jetbrains.kotlin:kotlin-test:${kotlin_version}" testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0" testCompile "org.mockito:mockito-core:2.23.0" @@ -152,10 +164,8 @@ validateNebulaPom.enabled = false dependencyLicenses.enabled = false thirdPartyAudit.enabled = false // Allow @Test to be used in test classes not inherited from LuceneTestCase. -// see https://github.com/elastic/elasticsearch/blob/master/buildSrc/src/main/resources/forbidden/es-test-signatures.txt forbiddenApis.ignoreFailures = true // Allow test cases to be named Tests without having to be inherited from LuceneTestCase. -// see https://github.com/elastic/elasticsearch/blob/323f312bbc829a63056a79ebe45adced5099f6e6/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java testingConventions.enabled = false loggerUsageCheck.enabled = false @@ -245,7 +255,7 @@ testClusters.integTest { // Cluster shrink exception thrown if we try to set numberOfNodes to 1, so only apply if > 1 if (_numNodes > 1) numberOfNodes = _numNodes // When running integration tests it doesn't forward the --debug-jvm to the cluster anymore - // i.e. we have to use a custom property to flag when we want to debug elasticsearch JVM + // i.e. we have to use a custom property to flag when we want to debug opensearch JVM // since we also support multi node integration tests we increase debugPort per node if (System.getProperty("cluster.debug") != null) { def debugPort = 5005 diff --git a/reports-scheduler/gradle.properties b/reports-scheduler/gradle.properties index 96ffa05a..b5b5edea 100644 --- a/reports-scheduler/gradle.properties +++ b/reports-scheduler/gradle.properties @@ -1,16 +1,12 @@ # -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"). -# You may not use this file except in compliance with the License. -# A copy of the License is located at +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. # -# http://www.apache.org/licenses/LICENSE-2.0 -# -# or in the "license" file accompanying this file. This file is distributed -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -# express or implied. See the License for the specific language governing -# permissions and limitations under the License. +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. # -version = 1.13.0 \ No newline at end of file +version = 1.15.0 \ No newline at end of file diff --git a/reports-scheduler/gradle/wrapper/gradle-wrapper.properties b/reports-scheduler/gradle/wrapper/gradle-wrapper.properties index 8a19f15b..32e23ebf 100644 --- a/reports-scheduler/gradle/wrapper/gradle-wrapper.properties +++ b/reports-scheduler/gradle/wrapper/gradle-wrapper.properties @@ -1,17 +1,12 @@ # -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"). -# You may not use this file except in compliance with the License. -# A copy of the License is located at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# or in the "license" file accompanying this file. This file is distributed -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -# express or implied. See the License for the specific language governing -# permissions and limitations under the License. +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. # +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. # #Wed Jul 29 13:30:55 PDT 2020 diff --git a/reports-scheduler/release-notes/create_release_notes.py b/reports-scheduler/release-notes/create_release_notes.py index 18c27c60..5078137d 100644 --- a/reports-scheduler/release-notes/create_release_notes.py +++ b/reports-scheduler/release-notes/create_release_notes.py @@ -22,7 +22,7 @@ import fileinput import re -link_prefix = "https://github.com/opendistro-for-elasticsearch/kibana-reports/reports-scheduler" +link_prefix = "https://github.com/opendistro-for-opensearch/kibana-reports/reports-scheduler" searchExp = re.compile("([\(\[]).*?([\)\]])") current_date = raw_input("what day is today (e.g. 2020-06-29): ") @@ -31,8 +31,8 @@ plugin_version = raw_input('Plugin version (x.x.x.x): ') app_num = int( - raw_input('Elasticsearch plugin (enter 1) or Kibana plugin (enter 2)? ')) -app = 'Elasticsearch' + raw_input('OpenSearch plugin (enter 1) or Kibana plugin (enter 2)? ')) +app = 'OpenSearch' if app_num is 2: app = 'Kibana' @@ -54,7 +54,7 @@ sys.stdout.write(line) # Rename file to be consistent with ODFE standards -new_file_path = "opendistro-for-elasticsearch-" + plugin_name + ".release-notes-" + \ +new_file_path = "opendistro-for-opensearch-" + plugin_name + ".release-notes-" + \ plugin_version + ".md" os.rename(file_path, new_file_path) diff --git a/reports-scheduler/settings.gradle b/reports-scheduler/settings.gradle index 3e9d6889..009571d3 100644 --- a/reports-scheduler/settings.gradle +++ b/reports-scheduler/settings.gradle @@ -1,17 +1,13 @@ /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. */ -rootProject.name = 'opendistro-reports-scheduler' +rootProject.name = 'opensearch-reports-scheduler' diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPlugin.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPlugin.kt index bd33c9fd..80d4be73 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPlugin.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPlugin.kt @@ -43,33 +43,33 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.scheduler.ReportDe import com.amazon.opendistroforelasticsearch.reportsscheduler.scheduler.ReportDefinitionJobRunner import com.amazon.opendistroforelasticsearch.reportsscheduler.settings.PluginSettings -import org.elasticsearch.action.ActionRequest -import org.elasticsearch.action.ActionResponse -import org.elasticsearch.client.Client -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver -import org.elasticsearch.cluster.node.DiscoveryNodes -import org.elasticsearch.cluster.service.ClusterService -import org.elasticsearch.common.io.stream.NamedWriteableRegistry -import org.elasticsearch.common.settings.ClusterSettings -import org.elasticsearch.common.settings.IndexScopedSettings -import org.elasticsearch.common.settings.Setting -import org.elasticsearch.common.settings.Settings -import org.elasticsearch.common.settings.SettingsFilter -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.env.Environment -import org.elasticsearch.env.NodeEnvironment -import org.elasticsearch.plugins.ActionPlugin -import org.elasticsearch.plugins.Plugin -import org.elasticsearch.repositories.RepositoriesService -import org.elasticsearch.rest.RestController -import org.elasticsearch.rest.RestHandler -import org.elasticsearch.script.ScriptService -import org.elasticsearch.threadpool.ThreadPool -import org.elasticsearch.watcher.ResourceWatcherService +import org.opensearch.action.ActionRequest +import org.opensearch.action.ActionResponse +import org.opensearch.client.Client +import org.opensearch.cluster.metadata.IndexNameExpressionResolver +import org.opensearch.cluster.node.DiscoveryNodes +import org.opensearch.cluster.service.ClusterService +import org.opensearch.common.io.stream.NamedWriteableRegistry +import org.opensearch.common.settings.ClusterSettings +import org.opensearch.common.settings.IndexScopedSettings +import org.opensearch.common.settings.Setting +import org.opensearch.common.settings.Settings +import org.opensearch.common.settings.SettingsFilter +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.env.Environment +import org.opensearch.env.NodeEnvironment +import org.opensearch.plugins.ActionPlugin +import org.opensearch.plugins.Plugin +import org.opensearch.repositories.RepositoriesService +import org.opensearch.rest.RestController +import org.opensearch.rest.RestHandler +import org.opensearch.script.ScriptService +import org.opensearch.threadpool.ThreadPool +import org.opensearch.watcher.ResourceWatcherService import java.util.function.Supplier /** - * Entry point of the OpenDistro for Elasticsearch Reports scheduler plugin. + * Entry point of the OpenDistro for OpenSearch Reports scheduler plugin. * This class initializes the rest handlers. */ class ReportsSchedulerPlugin : Plugin(), ActionPlugin, JobSchedulerExtension { diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/CreateReportDefinitionAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/CreateReportDefinitionAction.kt index 3efeb1ed..646efafd 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/CreateReportDefinitionAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/CreateReportDefinitionAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.CreateReportDefinitionRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.CreateReportDefinitionResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * Create reportDefinition transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/DeleteReportDefinitionAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/DeleteReportDefinitionAction.kt index 9813a9bd..129e14d1 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/DeleteReportDefinitionAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/DeleteReportDefinitionAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.DeleteReportDefinitionRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.DeleteReportDefinitionResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * Delete reportDefinition transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportDefinitionsAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportDefinitionsAction.kt index 403d77eb..502224db 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportDefinitionsAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportDefinitionsAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetAllReportDefinitionsRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetAllReportDefinitionsResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * Get all reportDefinitions transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportInstancesAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportInstancesAction.kt index 701018f5..220a0ce7 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportInstancesAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetAllReportInstancesAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetAllReportInstancesRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetAllReportInstancesResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * Get all report instances transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportDefinitionAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportDefinitionAction.kt index a021dfbd..bae2d285 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportDefinitionAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportDefinitionAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetReportDefinitionRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetReportDefinitionResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * Get reportDefinition transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportInstanceAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportInstanceAction.kt index 2d1e25b0..d99e489e 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportInstanceAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/GetReportInstanceAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetReportInstanceRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetReportInstanceResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * Get report instance transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/InContextReportCreateAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/InContextReportCreateAction.kt index 9bd4a5d1..5363bc5a 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/InContextReportCreateAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/InContextReportCreateAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.InContextReportCreateRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.InContextReportCreateResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * In-Context ReportCreate transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/OnDemandReportCreateAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/OnDemandReportCreateAction.kt index 73019d74..ce59cd89 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/OnDemandReportCreateAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/OnDemandReportCreateAction.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.action import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.model.OnDemandReportCreateRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.OnDemandReportCreateResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.client.Client -import org.elasticsearch.common.inject.Inject -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.transport.TransportService +import org.opensearch.action.ActionType +import org.opensearch.action.support.ActionFilters +import org.opensearch.client.Client +import org.opensearch.common.inject.Inject +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.transport.TransportService /** * On-Demand ReportCreate transport action diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt index 2beab1f8..9bbbdba6 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/action/PluginBaseAction.kt @@ -24,21 +24,21 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.util.logger import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch -import org.elasticsearch.ElasticsearchSecurityException -import org.elasticsearch.ElasticsearchStatusException -import org.elasticsearch.action.ActionListener -import org.elasticsearch.action.ActionRequest -import org.elasticsearch.action.ActionResponse -import org.elasticsearch.action.support.ActionFilters -import org.elasticsearch.action.support.HandledTransportAction -import org.elasticsearch.client.Client -import org.elasticsearch.common.io.stream.Writeable -import org.elasticsearch.index.IndexNotFoundException -import org.elasticsearch.index.engine.VersionConflictEngineException -import org.elasticsearch.indices.InvalidIndexNameException -import org.elasticsearch.rest.RestStatus -import org.elasticsearch.tasks.Task -import org.elasticsearch.transport.TransportService +import org.opensearch.OpenSearchSecurityException +import org.opensearch.OpenSearchStatusException +import org.opensearch.action.ActionListener +import org.opensearch.action.ActionRequest +import org.opensearch.action.ActionResponse +import org.opensearch.action.support.ActionFilters +import org.opensearch.action.support.HandledTransportAction +import org.opensearch.client.Client +import org.opensearch.common.io.stream.Writeable +import org.opensearch.index.IndexNotFoundException +import org.opensearch.index.engine.VersionConflictEngineException +import org.opensearch.indices.InvalidIndexNameException +import org.opensearch.rest.RestStatus +import org.opensearch.tasks.Task +import org.opensearch.transport.TransportService import java.io.IOException abstract class PluginBaseAction( @@ -67,43 +67,43 @@ abstract class PluginBaseAction : ToXContentObject { val startIndex: Long diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionRequest.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionRequest.kt index 8dc480bf..c6212437 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionRequest.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionRequest.kt @@ -22,17 +22,17 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPO import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPORT_DEFINITION_ID_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.util.createJsonParser import com.amazon.opendistroforelasticsearch.reportsscheduler.util.logger -import org.elasticsearch.action.ActionRequest -import org.elasticsearch.action.ActionRequestValidationException -import org.elasticsearch.common.io.stream.StreamInput -import org.elasticsearch.common.io.stream.StreamOutput -import org.elasticsearch.common.xcontent.ToXContent -import org.elasticsearch.common.xcontent.ToXContentObject -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentFactory -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.common.xcontent.XContentParser.Token -import org.elasticsearch.common.xcontent.XContentParserUtils +import org.opensearch.action.ActionRequest +import org.opensearch.action.ActionRequestValidationException +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.common.xcontent.ToXContent +import org.opensearch.common.xcontent.ToXContentObject +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentFactory +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentParser.Token +import org.opensearch.common.xcontent.XContentParserUtils import java.io.IOException /** diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionResponse.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionResponse.kt index 92180842..a5a14efe 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionResponse.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportDefinitionResponse.kt @@ -20,13 +20,13 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPl import com.amazon.opendistroforelasticsearch.reportsscheduler.metrics.Metrics import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPORT_DEFINITION_ID_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.util.logger -import org.elasticsearch.common.io.stream.StreamInput -import org.elasticsearch.common.io.stream.StreamOutput -import org.elasticsearch.common.xcontent.ToXContent -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.common.xcontent.XContentParser.Token -import org.elasticsearch.common.xcontent.XContentParserUtils +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.common.xcontent.ToXContent +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentParser.Token +import org.opensearch.common.xcontent.XContentParserUtils import java.io.IOException /** diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusRequest.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusRequest.kt index f9b5aa1f..270016f9 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusRequest.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusRequest.kt @@ -24,17 +24,17 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.STAT import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.STATUS_TEXT_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.util.fieldIfNotNull import com.amazon.opendistroforelasticsearch.reportsscheduler.util.logger -import org.elasticsearch.action.ActionRequest -import org.elasticsearch.action.ActionRequestValidationException -import org.elasticsearch.common.io.stream.StreamInput -import org.elasticsearch.common.io.stream.StreamOutput -import org.elasticsearch.common.xcontent.ToXContent -import org.elasticsearch.common.xcontent.ToXContentObject -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentFactory -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.common.xcontent.XContentParser.Token -import org.elasticsearch.common.xcontent.XContentParserUtils +import org.opensearch.action.ActionRequest +import org.opensearch.action.ActionRequestValidationException +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.common.xcontent.ToXContent +import org.opensearch.common.xcontent.ToXContentObject +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentFactory +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentParser.Token +import org.opensearch.common.xcontent.XContentParserUtils import java.io.IOException /** diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusResponse.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusResponse.kt index c65b68db..3110b1b5 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusResponse.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/model/UpdateReportInstanceStatusResponse.kt @@ -19,13 +19,13 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.model import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.LOG_PREFIX import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPORT_INSTANCE_ID_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.util.logger -import org.elasticsearch.common.io.stream.StreamInput -import org.elasticsearch.common.io.stream.StreamOutput -import org.elasticsearch.common.xcontent.ToXContent -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.common.xcontent.XContentParser.Token -import org.elasticsearch.common.xcontent.XContentParserUtils +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.common.xcontent.ToXContent +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentParser.Token +import org.opensearch.common.xcontent.XContentParserUtils import java.io.IOException /** diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt index b0ebe889..de831077 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt @@ -24,14 +24,14 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.InContextRep import com.amazon.opendistroforelasticsearch.reportsscheduler.model.OnDemandReportCreateRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPORT_DEFINITION_ID_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.util.contentParserNextToken -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.POST -import org.elasticsearch.rest.RestRequest.Method.PUT -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.POST +import org.opensearch.rest.RestRequest.Method.PUT +import org.opensearch.rest.RestStatus /** * Rest handler for creating on-demand report instances. diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/PluginBaseHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/PluginBaseHandler.kt index 0dc6c920..b686216c 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/PluginBaseHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/PluginBaseHandler.kt @@ -17,9 +17,9 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.resthandler import com.amazon.opendistroforelasticsearch.reportsscheduler.metrics.Metrics -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler -import org.elasticsearch.rest.RestRequest +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler +import org.opensearch.rest.RestRequest abstract class PluginBaseHandler : BaseRestHandler() { diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionListRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionListRestHandler.kt index 60cb6ee6..05db5e41 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionListRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionListRestHandler.kt @@ -24,13 +24,13 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.FROM import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.MAX_ITEMS_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.settings.PluginSettings -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.GET -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.rest.RestStatus /** * Rest handler for getting list of report definitions. diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionRestHandler.kt index 3821757f..9c25dca5 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportDefinitionRestHandler.kt @@ -28,16 +28,16 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetReportDef import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPORT_DEFINITION_ID_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.model.UpdateReportDefinitionRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.util.contentParserNextToken -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.DELETE -import org.elasticsearch.rest.RestRequest.Method.GET -import org.elasticsearch.rest.RestRequest.Method.POST -import org.elasticsearch.rest.RestRequest.Method.PUT -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.DELETE +import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.rest.RestRequest.Method.POST +import org.opensearch.rest.RestRequest.Method.PUT +import org.opensearch.rest.RestStatus /** * Rest handler for report definitions lifecycle management. diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceListRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceListRestHandler.kt index e82f137a..c47bcf35 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceListRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceListRestHandler.kt @@ -23,13 +23,13 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetAllReport import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.FROM_INDEX_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.MAX_ITEMS_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.settings.PluginSettings -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.GET -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.rest.RestStatus /** * Rest handler for getting list of report instances. diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstancePollRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstancePollRestHandler.kt index 3669da4e..38868faf 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstancePollRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstancePollRestHandler.kt @@ -19,13 +19,13 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPl import com.amazon.opendistroforelasticsearch.reportsscheduler.action.PollReportInstanceAction import com.amazon.opendistroforelasticsearch.reportsscheduler.action.ReportInstanceActions import com.amazon.opendistroforelasticsearch.reportsscheduler.model.PollReportInstanceRequest -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.GET -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.rest.RestStatus /** * Rest handler for getting list of report instances. diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceRestHandler.kt index 2eebb10e..85bf885e 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportInstanceRestHandler.kt @@ -24,14 +24,14 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.model.GetReportIns import com.amazon.opendistroforelasticsearch.reportsscheduler.model.RestTag.REPORT_INSTANCE_ID_FIELD import com.amazon.opendistroforelasticsearch.reportsscheduler.model.UpdateReportInstanceStatusRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.util.contentParserNextToken -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.GET -import org.elasticsearch.rest.RestRequest.Method.POST -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.rest.RestRequest.Method.POST +import org.opensearch.rest.RestStatus /** * Rest handler for report instances lifecycle management. diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportStatsRestHandler.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportStatsRestHandler.kt index 91e2b834..1c0baf69 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportStatsRestHandler.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/ReportStatsRestHandler.kt @@ -17,14 +17,14 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.resthandler import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.BASE_REPORTS_URI import com.amazon.opendistroforelasticsearch.reportsscheduler.metrics.Metrics -import org.elasticsearch.client.node.NodeClient -import org.elasticsearch.rest.BaseRestHandler -import org.elasticsearch.rest.BaseRestHandler.RestChannelConsumer -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestHandler.Route -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestRequest.Method.GET -import org.elasticsearch.rest.RestStatus +import org.opensearch.client.node.NodeClient +import org.opensearch.rest.BaseRestHandler +import org.opensearch.rest.BaseRestHandler.RestChannelConsumer +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestHandler.Route +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.rest.RestStatus /** * Rest handler for getting reporting backend stats diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/RestResponseToXContentListener.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/RestResponseToXContentListener.kt index c13c275d..ab003c0d 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/RestResponseToXContentListener.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/resthandler/RestResponseToXContentListener.kt @@ -18,12 +18,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.resthandler import com.amazon.opendistroforelasticsearch.reportsscheduler.metrics.Metrics import com.amazon.opendistroforelasticsearch.reportsscheduler.model.BaseResponse -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.rest.BytesRestResponse -import org.elasticsearch.rest.RestChannel -import org.elasticsearch.rest.RestResponse -import org.elasticsearch.rest.RestStatus -import org.elasticsearch.rest.action.RestToXContentListener +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.rest.BytesRestResponse +import org.opensearch.rest.RestChannel +import org.opensearch.rest.RestResponse +import org.opensearch.rest.RestStatus +import org.opensearch.rest.action.RestToXContentListener /** * Overrides RestToXContentListener REST based action listener that assumes the response is of type diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/scheduler/ReportDefinitionJobParser.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/scheduler/ReportDefinitionJobParser.kt index 8b5179a3..25dab61a 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/scheduler/ReportDefinitionJobParser.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/scheduler/ReportDefinitionJobParser.kt @@ -20,7 +20,7 @@ import com.amazon.opendistroforelasticsearch.jobscheduler.spi.JobDocVersion import com.amazon.opendistroforelasticsearch.jobscheduler.spi.ScheduledJobParameter import com.amazon.opendistroforelasticsearch.jobscheduler.spi.ScheduledJobParser import com.amazon.opendistroforelasticsearch.reportsscheduler.model.ReportDefinitionDetails -import org.elasticsearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentParser internal object ReportDefinitionJobParser : ScheduledJobParser { /** diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/SecurityAccess.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/SecurityAccess.kt index 4b555738..98bb74bd 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/SecurityAccess.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/SecurityAccess.kt @@ -16,7 +16,7 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.security -import org.elasticsearch.SpecialPermission +import org.opensearch.SpecialPermission import java.security.AccessController import java.security.PrivilegedActionException import java.security.PrivilegedExceptionAction @@ -24,7 +24,7 @@ import java.security.PrivilegedExceptionAction /** * Class for providing the elevated permission for the function call. * Ref: - * https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html#_java_security_permissions + * https://www.elastic.co/guide/en/opensearch/plugins/current/plugin-authors.html#_java_security_permissions */ internal object SecurityAccess { /** diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/UserAccessManager.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/UserAccessManager.kt index c8053d81..bb71d6ad 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/UserAccessManager.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/security/UserAccessManager.kt @@ -20,8 +20,8 @@ import com.amazon.opendistroforelasticsearch.commons.authuser.User import com.amazon.opendistroforelasticsearch.reportsscheduler.metrics.Metrics import com.amazon.opendistroforelasticsearch.reportsscheduler.settings.PluginSettings import com.amazon.opendistroforelasticsearch.reportsscheduler.settings.PluginSettings.FilterBy -import org.elasticsearch.ElasticsearchStatusException -import org.elasticsearch.rest.RestStatus +import org.opensearch.OpenSearchStatusException +import org.opensearch.rest.RestStatus import java.util.stream.Collectors /** @@ -50,7 +50,7 @@ internal object UserAccessManager { fun validateUser(user: User?) { if (isUserPrivateTenant(user) && user?.name == null) { Metrics.REPORT_PERMISSION_USER_ERROR.counter.increment() - throw ElasticsearchStatusException("User name not provided for private tenant access", + throw OpenSearchStatusException("User name not provided for private tenant access", RestStatus.FORBIDDEN) } when (PluginSettings.filterBy) { @@ -60,25 +60,25 @@ internal object UserAccessManager { user?.name ?: run { Metrics.REPORT_PERMISSION_USER_ERROR.counter.increment() - throw ElasticsearchStatusException("Filter-by enabled with security disabled", + throw OpenSearchStatusException("Filter-by enabled with security disabled", RestStatus.FORBIDDEN) } } FilterBy.Roles -> { // backend roles must be present if (user == null || user.roles.isNullOrEmpty()) { Metrics.REPORT_PERMISSION_USER_ERROR.counter.increment() - throw ElasticsearchStatusException("User doesn't have roles configured. Contact administrator.", + throw OpenSearchStatusException("User doesn't have roles configured. Contact administrator.", RestStatus.FORBIDDEN) } else if (user.roles.stream().filter { !PluginSettings.ignoredRoles.contains(it) }.count() == 0L) { Metrics.REPORT_PERMISSION_USER_ERROR.counter.increment() - throw ElasticsearchStatusException("No distinguishing roles configured. Contact administrator.", + throw OpenSearchStatusException("No distinguishing roles configured. Contact administrator.", RestStatus.FORBIDDEN) } } FilterBy.BackendRoles -> { // backend roles must be present if (user?.backendRoles.isNullOrEmpty()) { Metrics.REPORT_PERMISSION_USER_ERROR.counter.increment() - throw ElasticsearchStatusException("User doesn't have backend roles configured. Contact administrator.", + throw OpenSearchStatusException("User doesn't have backend roles configured. Contact administrator.", RestStatus.FORBIDDEN) } } @@ -92,7 +92,7 @@ internal object UserAccessManager { if (user != null) { // Check only if security is enabled if (user.name != KIBANA_SERVER_USER) { Metrics.REPORT_PERMISSION_USER_ERROR.counter.increment() - throw ElasticsearchStatusException("Permission denied", RestStatus.FORBIDDEN) + throw OpenSearchStatusException("Permission denied", RestStatus.FORBIDDEN) } } } diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/settings/PluginSettings.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/settings/PluginSettings.kt index f518a890..5f7f4158 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/settings/PluginSettings.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/settings/PluginSettings.kt @@ -19,12 +19,12 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.settings import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.LOG_PREFIX import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.PLUGIN_NAME import org.apache.logging.log4j.LogManager -import org.elasticsearch.bootstrap.BootstrapInfo -import org.elasticsearch.cluster.service.ClusterService -import org.elasticsearch.common.settings.Setting -import org.elasticsearch.common.settings.Setting.Property.Dynamic -import org.elasticsearch.common.settings.Setting.Property.NodeScope -import org.elasticsearch.common.settings.Settings +import org.opensearch.bootstrap.BootstrapInfo +import org.opensearch.cluster.service.ClusterService +import org.opensearch.common.settings.Setting +import org.opensearch.common.settings.Setting.Property.Dynamic +import org.opensearch.common.settings.Setting.Property.NodeScope +import org.opensearch.common.settings.Settings import java.io.IOException import java.nio.file.Path diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/Helpers.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/Helpers.kt index 4f59e69e..4ca70d8a 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/Helpers.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/Helpers.kt @@ -18,17 +18,17 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.util import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger -import org.elasticsearch.common.io.stream.StreamInput -import org.elasticsearch.common.xcontent.DeprecationHandler -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.common.xcontent.ToXContent -import org.elasticsearch.common.xcontent.ToXContentObject -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.common.xcontent.XContentParser.Token -import org.elasticsearch.common.xcontent.XContentParserUtils -import org.elasticsearch.common.xcontent.XContentType -import org.elasticsearch.rest.RestRequest +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.xcontent.DeprecationHandler +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.common.xcontent.ToXContent +import org.opensearch.common.xcontent.ToXContentObject +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.XContentParser.Token +import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.common.xcontent.XContentType +import org.opensearch.rest.RestRequest internal fun StreamInput.createJsonParser(): XContentParser { return XContentType.JSON.xContent().createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.IGNORE_DEPRECATIONS, this) diff --git a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/SecureIndexClient.kt b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/SecureIndexClient.kt index 0e012126..a6ef1757 100644 --- a/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/SecureIndexClient.kt +++ b/reports-scheduler/src/main/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/util/SecureIndexClient.kt @@ -16,40 +16,40 @@ package com.amazon.opendistroforelasticsearch.reportsscheduler.util -import org.elasticsearch.action.ActionFuture -import org.elasticsearch.action.ActionListener -import org.elasticsearch.action.ActionRequest -import org.elasticsearch.action.ActionResponse -import org.elasticsearch.action.ActionType -import org.elasticsearch.action.bulk.BulkRequest -import org.elasticsearch.action.bulk.BulkResponse -import org.elasticsearch.action.delete.DeleteRequest -import org.elasticsearch.action.delete.DeleteResponse -import org.elasticsearch.action.explain.ExplainRequest -import org.elasticsearch.action.explain.ExplainResponse -import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest -import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse -import org.elasticsearch.action.get.GetRequest -import org.elasticsearch.action.get.GetResponse -import org.elasticsearch.action.get.MultiGetRequest -import org.elasticsearch.action.get.MultiGetResponse -import org.elasticsearch.action.index.IndexRequest -import org.elasticsearch.action.index.IndexResponse -import org.elasticsearch.action.search.ClearScrollRequest -import org.elasticsearch.action.search.ClearScrollResponse -import org.elasticsearch.action.search.MultiSearchRequest -import org.elasticsearch.action.search.MultiSearchResponse -import org.elasticsearch.action.search.SearchRequest -import org.elasticsearch.action.search.SearchResponse -import org.elasticsearch.action.search.SearchScrollRequest -import org.elasticsearch.action.termvectors.MultiTermVectorsRequest -import org.elasticsearch.action.termvectors.MultiTermVectorsResponse -import org.elasticsearch.action.termvectors.TermVectorsRequest -import org.elasticsearch.action.termvectors.TermVectorsResponse -import org.elasticsearch.action.update.UpdateRequest -import org.elasticsearch.action.update.UpdateResponse -import org.elasticsearch.client.Client -import org.elasticsearch.common.util.concurrent.ThreadContext +import org.opensearch.action.ActionFuture +import org.opensearch.action.ActionListener +import org.opensearch.action.ActionRequest +import org.opensearch.action.ActionResponse +import org.opensearch.action.ActionType +import org.opensearch.action.bulk.BulkRequest +import org.opensearch.action.bulk.BulkResponse +import org.opensearch.action.delete.DeleteRequest +import org.opensearch.action.delete.DeleteResponse +import org.opensearch.action.explain.ExplainRequest +import org.opensearch.action.explain.ExplainResponse +import org.opensearch.action.fieldcaps.FieldCapabilitiesRequest +import org.opensearch.action.fieldcaps.FieldCapabilitiesResponse +import org.opensearch.action.get.GetRequest +import org.opensearch.action.get.GetResponse +import org.opensearch.action.get.MultiGetRequest +import org.opensearch.action.get.MultiGetResponse +import org.opensearch.action.index.IndexRequest +import org.opensearch.action.index.IndexResponse +import org.opensearch.action.search.ClearScrollRequest +import org.opensearch.action.search.ClearScrollResponse +import org.opensearch.action.search.MultiSearchRequest +import org.opensearch.action.search.MultiSearchResponse +import org.opensearch.action.search.SearchRequest +import org.opensearch.action.search.SearchResponse +import org.opensearch.action.search.SearchScrollRequest +import org.opensearch.action.termvectors.MultiTermVectorsRequest +import org.opensearch.action.termvectors.MultiTermVectorsResponse +import org.opensearch.action.termvectors.TermVectorsRequest +import org.opensearch.action.termvectors.TermVectorsResponse +import org.opensearch.action.update.UpdateRequest +import org.opensearch.action.update.UpdateResponse +import org.opensearch.client.Client +import org.opensearch.common.util.concurrent.ThreadContext /** * Wrapper class on [Client] with security context removed. diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/PluginRestTestCase.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/PluginRestTestCase.kt index 918852ea..47814d1b 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/PluginRestTestCase.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/PluginRestTestCase.kt @@ -28,19 +28,19 @@ import org.apache.http.impl.client.BasicCredentialsProvider import org.apache.http.impl.nio.client.HttpAsyncClientBuilder import org.apache.http.message.BasicHeader import org.apache.http.ssl.SSLContextBuilder -import org.elasticsearch.client.Request -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.client.Response -import org.elasticsearch.client.ResponseException -import org.elasticsearch.client.RestClient -import org.elasticsearch.client.RestClientBuilder -import org.elasticsearch.common.settings.Settings -import org.elasticsearch.common.unit.TimeValue -import org.elasticsearch.common.util.concurrent.ThreadContext -import org.elasticsearch.common.xcontent.DeprecationHandler -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.common.xcontent.XContentType -import org.elasticsearch.test.rest.ESRestTestCase +import org.opensearch.client.Request +import org.opensearch.client.RequestOptions +import org.opensearch.client.Response +import org.opensearch.client.ResponseException +import org.opensearch.client.RestClient +import org.opensearch.client.RestClientBuilder +import org.opensearch.common.settings.Settings +import org.opensearch.common.unit.TimeValue +import org.opensearch.common.util.concurrent.ThreadContext +import org.opensearch.common.xcontent.DeprecationHandler +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.common.xcontent.XContentType +import org.opensearch.test.rest.OpenSearchRestTestCase import org.junit.After import org.junit.AfterClass import org.junit.Before @@ -56,7 +56,7 @@ import javax.management.ObjectName import javax.management.remote.JMXConnectorFactory import javax.management.remote.JMXServiceURL -abstract class PluginRestTestCase : ESRestTestCase() { +abstract class PluginRestTestCase : OpenSearchRestTestCase() { private fun isHttps(): Boolean { return System.getProperty("https", "false")!!.toBoolean() @@ -87,7 +87,7 @@ abstract class PluginRestTestCase : ESRestTestCase() { val jsonObject: Map<*, *> = index as java.util.HashMap<*, *> val indexName: String = jsonObject["index"] as String // .opendistro_security isn't allowed to delete from cluster - if (".opendistro_security" != indexName) { + if (!indexName.startsWith(".kibana") && !indexName.startsWith(".opendistro_security")) { client().performRequest(Request("DELETE", "/$indexName")) } } diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportSchedularPluginTests.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportSchedularPluginTests.kt index b5b7ecd3..c9db8a5a 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportSchedularPluginTests.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportSchedularPluginTests.kt @@ -15,9 +15,9 @@ */ package com.amazon.opendistroforelasticsearch.reportsscheduler -import org.elasticsearch.test.ESTestCase +import org.opensearch.test.OpenSearchTestCase -class ReportSchedularPluginTests : ESTestCase() { +class ReportSchedularPluginTests : OpenSearchTestCase() { fun testSample() { } } diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPluginIT.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPluginIT.kt index b9751d1d..9f3a6faf 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPluginIT.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/ReportsSchedulerPluginIT.kt @@ -14,14 +14,14 @@ */ package com.amazon.opendistroforelasticsearch.reportsscheduler -import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest -import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest -import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules -import org.elasticsearch.cluster.health.ClusterHealthStatus -import org.elasticsearch.plugins.PluginInfo -import org.elasticsearch.test.ESIntegTestCase +import org.opensearch.action.admin.cluster.health.ClusterHealthRequest +import org.opensearch.action.admin.cluster.node.info.NodesInfoRequest +import org.opensearch.action.admin.cluster.node.info.PluginsAndModules +import org.opensearch.cluster.health.ClusterHealthStatus +import org.opensearch.plugins.PluginInfo +import org.opensearch.test.OpenSearchIntegTestCase -class ReportsSchedulerPluginIT : ESIntegTestCase() { +class ReportsSchedulerPluginIT : OpenSearchIntegTestCase() { fun testPluginsAreInstalled() { val request = ClusterHealthRequest() val response = client().admin().cluster().health(request).actionGet() diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/InContextMenuReportGenerationIT.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/InContextMenuReportGenerationIT.kt index d24cabaa..67966d62 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/InContextMenuReportGenerationIT.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/InContextMenuReportGenerationIT.kt @@ -21,8 +21,8 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPl import com.amazon.opendistroforelasticsearch.reportsscheduler.jsonify import com.amazon.opendistroforelasticsearch.reportsscheduler.validateErrorResponse import com.amazon.opendistroforelasticsearch.reportsscheduler.validateTimeRecency -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestStatus +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestStatus import org.junit.Assert import java.time.Instant diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/OnDemandReportGenerationIT.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/OnDemandReportGenerationIT.kt index 8d39b75b..8d689f63 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/OnDemandReportGenerationIT.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/OnDemandReportGenerationIT.kt @@ -22,8 +22,8 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.jsonify import com.amazon.opendistroforelasticsearch.reportsscheduler.validateErrorResponse import com.amazon.opendistroforelasticsearch.reportsscheduler.validateTimeNearRefTime import com.amazon.opendistroforelasticsearch.reportsscheduler.validateTimeRecency -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestStatus +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestStatus import org.junit.Assert import java.time.Duration import java.time.Instant diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportDefinitionIT.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportDefinitionIT.kt index be8c44e0..9a04547b 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportDefinitionIT.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportDefinitionIT.kt @@ -19,8 +19,8 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.PluginRestTestCase import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.BASE_REPORTS_URI import com.amazon.opendistroforelasticsearch.reportsscheduler.constructReportDefinitionRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.validateErrorResponse -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestStatus +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestStatus import org.junit.Assert class ReportDefinitionIT : PluginRestTestCase() { diff --git a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportInstanceIT.kt b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportInstanceIT.kt index fc687f54..d02a878a 100644 --- a/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportInstanceIT.kt +++ b/reports-scheduler/src/test/kotlin/com/amazon/opendistroforelasticsearch/reportsscheduler/rest/ReportInstanceIT.kt @@ -20,8 +20,8 @@ import com.amazon.opendistroforelasticsearch.reportsscheduler.PluginRestTestCase import com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin.Companion.BASE_REPORTS_URI import com.amazon.opendistroforelasticsearch.reportsscheduler.constructReportDefinitionRequest import com.amazon.opendistroforelasticsearch.reportsscheduler.validateErrorResponse -import org.elasticsearch.rest.RestRequest -import org.elasticsearch.rest.RestStatus +import org.opensearch.rest.RestRequest +import org.opensearch.rest.RestStatus import org.junit.Assert class ReportInstanceIT : PluginRestTestCase() { diff --git a/reports-scheduler/src/test/resources/job-scheduler/opendistro-job-scheduler-1.13.0.0.zip b/reports-scheduler/src/test/resources/job-scheduler/opendistro-job-scheduler-1.13.0.0.zip deleted file mode 100644 index 9eba0f99..00000000 Binary files a/reports-scheduler/src/test/resources/job-scheduler/opendistro-job-scheduler-1.13.0.0.zip and /dev/null differ diff --git a/reports-scheduler/src/test/resources/job-scheduler/opendistro-job-scheduler-1.15.0.0-SNAPSHOT.zip b/reports-scheduler/src/test/resources/job-scheduler/opendistro-job-scheduler-1.15.0.0-SNAPSHOT.zip new file mode 100644 index 00000000..dbc934eb Binary files /dev/null and b/reports-scheduler/src/test/resources/job-scheduler/opendistro-job-scheduler-1.15.0.0-SNAPSHOT.zip differ