Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors #1009

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import org.opensearch.core.common.io.stream.NamedWriteableRegistry
import org.opensearch.core.xcontent.NamedXContentRegistry
import org.opensearch.env.Environment
import org.opensearch.env.NodeEnvironment
import org.opensearch.indices.SystemIndexDescriptor
import org.opensearch.jobscheduler.spi.JobSchedulerExtension
import org.opensearch.jobscheduler.spi.ScheduledJobParser
import org.opensearch.jobscheduler.spi.ScheduledJobRunner
import org.opensearch.plugins.ActionPlugin
import org.opensearch.plugins.Plugin
import org.opensearch.plugins.SystemIndexPlugin
import org.opensearch.reportsscheduler.action.CreateReportDefinitionAction
import org.opensearch.reportsscheduler.action.DeleteReportDefinitionAction
import org.opensearch.reportsscheduler.action.GetAllReportDefinitionsAction
Expand Down Expand Up @@ -59,7 +61,7 @@ import java.util.function.Supplier
* Entry point of the OpenSearch Reports scheduler plugin.
* This class initializes the rest handlers.
*/
class ReportsSchedulerPlugin : Plugin(), ActionPlugin, JobSchedulerExtension {
class ReportsSchedulerPlugin : Plugin(), ActionPlugin, SystemIndexPlugin, JobSchedulerExtension {

companion object {
const val PLUGIN_NAME = "opensearch-reports-scheduler"
Expand All @@ -77,6 +79,12 @@ class ReportsSchedulerPlugin : Plugin(), ActionPlugin, JobSchedulerExtension {
return settingList
}

override fun getSystemIndexDescriptors(settings: Settings): Collection<SystemIndexDescriptor> {
return listOf(
SystemIndexDescriptor(".opendistro-reports-*", "Reports Scheduler Plugin system index pattern")
derek-ho marked this conversation as resolved.
Show resolved Hide resolved
)
}

/**
* {@inheritDoc}
*/
Expand Down
Loading