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

Delete rule #1

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion .idea/runConfigurations/Debug_OpenSearch.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,40 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.SettingsFilter;
import org.opensearch.core.action.ActionResponse;
import org.opensearch.plugin.wlm.action.CreateQueryGroupAction;
import org.opensearch.plugin.wlm.action.DeleteQueryGroupAction;
import org.opensearch.plugin.wlm.action.GetQueryGroupAction;
import org.opensearch.plugin.wlm.action.TransportCreateQueryGroupAction;
import org.opensearch.plugin.wlm.action.TransportDeleteQueryGroupAction;
import org.opensearch.plugin.wlm.action.TransportGetQueryGroupAction;
import org.opensearch.plugin.wlm.action.TransportUpdateQueryGroupAction;
import org.opensearch.plugin.wlm.action.UpdateQueryGroupAction;
import org.opensearch.plugin.wlm.rest.RestCreateQueryGroupAction;
import org.opensearch.plugin.wlm.rest.RestDeleteQueryGroupAction;
import org.opensearch.plugin.wlm.rest.RestGetQueryGroupAction;
import org.opensearch.plugin.wlm.rest.RestUpdateQueryGroupAction;
import org.opensearch.plugin.wlm.service.QueryGroupPersistenceService;
import org.opensearch.indices.SystemIndexDescriptor;
import org.opensearch.plugin.wlm.querygroup.action.CreateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.DeleteQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.GetQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.TransportCreateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.TransportDeleteQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.TransportGetQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.TransportUpdateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.UpdateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.rest.RestCreateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.rest.RestDeleteQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.rest.RestGetQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.rest.RestUpdateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.service.QueryGroupPersistenceService;
import org.opensearch.plugin.wlm.rule.action.*;
import org.opensearch.plugin.wlm.rule.rest.RestCreateRuleAction;
import org.opensearch.plugin.wlm.rule.rest.RestDeleteRuleAction;
import org.opensearch.plugin.wlm.rule.rest.RestGetRuleAction;
import org.opensearch.plugins.ActionPlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.SystemIndexPlugin;
import org.opensearch.rest.RestController;
import org.opensearch.rest.RestHandler;

import java.util.Collection;
import java.util.List;
import java.util.function.Supplier;

import static org.opensearch.plugin.wlm.rule.service.RulePersistenceService.RULE_INDEX;

/**
* Plugin class for WorkloadManagement
*/
public class WorkloadManagementPlugin extends Plugin implements ActionPlugin {
public class WorkloadManagementPlugin extends Plugin implements ActionPlugin, SystemIndexPlugin {

/**
* Default constructor
Expand All @@ -56,8 +64,19 @@ public WorkloadManagementPlugin() {}
new ActionPlugin.ActionHandler<>(CreateQueryGroupAction.INSTANCE, TransportCreateQueryGroupAction.class),
new ActionPlugin.ActionHandler<>(GetQueryGroupAction.INSTANCE, TransportGetQueryGroupAction.class),
new ActionPlugin.ActionHandler<>(DeleteQueryGroupAction.INSTANCE, TransportDeleteQueryGroupAction.class),
new ActionPlugin.ActionHandler<>(UpdateQueryGroupAction.INSTANCE, TransportUpdateQueryGroupAction.class)
new ActionPlugin.ActionHandler<>(UpdateQueryGroupAction.INSTANCE, TransportUpdateQueryGroupAction.class),
new ActionPlugin.ActionHandler<>(CreateRuleAction.INSTANCE, TransportCreateRuleAction.class),
new ActionPlugin.ActionHandler<>(GetRuleAction.INSTANCE, TransportGetRuleAction.class),
new ActionPlugin.ActionHandler<>(DeleteRuleAction.INSTANCE, TransportDeleteRuleAction.class)
);
}

@Override
public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings settings) {
List<SystemIndexDescriptor> descriptors = List.of(
new SystemIndexDescriptor(RULE_INDEX, "System index used for storing rules")
);
return descriptors;
}

@Override
Expand All @@ -74,7 +93,10 @@ public List<RestHandler> getRestHandlers(
new RestCreateQueryGroupAction(),
new RestGetQueryGroupAction(),
new RestDeleteQueryGroupAction(),
new RestUpdateQueryGroupAction()
new RestUpdateQueryGroupAction(),
new RestCreateRuleAction(),
new RestGetRuleAction(),
new RestDeleteRuleAction()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import org.opensearch.common.inject.AbstractModule;
import org.opensearch.common.inject.Singleton;
import org.opensearch.plugin.wlm.service.QueryGroupPersistenceService;
import org.opensearch.plugin.wlm.querygroup.service.QueryGroupPersistenceService;

/**
* Guice Module to manage WorkloadManagement related objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.cluster.metadata.QueryGroup;
import org.opensearch.core.action.ActionResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionType;
import org.opensearch.action.support.clustermanager.AcknowledgedResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.support.clustermanager.AcknowledgedRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.cluster.metadata.QueryGroup;
import org.opensearch.core.action.ActionResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction;
Expand All @@ -17,7 +17,7 @@
import org.opensearch.common.inject.Inject;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.plugin.wlm.service.QueryGroupPersistenceService;
import org.opensearch.plugin.wlm.querygroup.service.QueryGroupPersistenceService;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.clustermanager.AcknowledgedResponse;
Expand All @@ -19,7 +19,7 @@
import org.opensearch.common.inject.Inject;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.plugin.wlm.service.QueryGroupPersistenceService;
import org.opensearch.plugin.wlm.querygroup.service.QueryGroupPersistenceService;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -23,7 +23,7 @@
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.plugin.wlm.service.QueryGroupPersistenceService;
import org.opensearch.plugin.wlm.querygroup.service.QueryGroupPersistenceService;
import org.opensearch.search.pipeline.SearchPipelineService;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction;
Expand All @@ -17,7 +17,7 @@
import org.opensearch.common.inject.Inject;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.plugin.wlm.service.QueryGroupPersistenceService;
import org.opensearch.plugin.wlm.querygroup.service.QueryGroupPersistenceService;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.action;
package org.opensearch.plugin.wlm.querygroup.action;

import org.opensearch.cluster.metadata.QueryGroup;
import org.opensearch.core.action.ActionResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/**
* Package for the action classes related to query groups in WorkloadManagementPlugin
*/
package org.opensearch.plugin.wlm.querygroup.action;
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.rest;
package org.opensearch.plugin.wlm.querygroup.rest;

import org.opensearch.client.node.NodeClient;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.plugin.wlm.action.CreateQueryGroupAction;
import org.opensearch.plugin.wlm.action.CreateQueryGroupRequest;
import org.opensearch.plugin.wlm.action.CreateQueryGroupResponse;
import org.opensearch.plugin.wlm.querygroup.action.CreateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.CreateQueryGroupRequest;
import org.opensearch.plugin.wlm.querygroup.action.CreateQueryGroupResponse;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.rest;
package org.opensearch.plugin.wlm.querygroup.rest;

import org.opensearch.client.node.NodeClient;
import org.opensearch.plugin.wlm.action.DeleteQueryGroupAction;
import org.opensearch.plugin.wlm.action.DeleteQueryGroupRequest;
import org.opensearch.plugin.wlm.querygroup.action.DeleteQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.DeleteQueryGroupRequest;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.RestRequest;
import org.opensearch.rest.action.RestToXContentListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.rest;
package org.opensearch.plugin.wlm.querygroup.rest;

import org.opensearch.client.node.NodeClient;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.plugin.wlm.action.GetQueryGroupAction;
import org.opensearch.plugin.wlm.action.GetQueryGroupRequest;
import org.opensearch.plugin.wlm.action.GetQueryGroupResponse;
import org.opensearch.plugin.wlm.querygroup.action.GetQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.GetQueryGroupRequest;
import org.opensearch.plugin.wlm.querygroup.action.GetQueryGroupResponse;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* compatible open source license.
*/

package org.opensearch.plugin.wlm.rest;
package org.opensearch.plugin.wlm.querygroup.rest;

import org.opensearch.client.node.NodeClient;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.plugin.wlm.action.UpdateQueryGroupAction;
import org.opensearch.plugin.wlm.action.UpdateQueryGroupRequest;
import org.opensearch.plugin.wlm.action.UpdateQueryGroupResponse;
import org.opensearch.plugin.wlm.querygroup.action.UpdateQueryGroupAction;
import org.opensearch.plugin.wlm.querygroup.action.UpdateQueryGroupRequest;
import org.opensearch.plugin.wlm.querygroup.action.UpdateQueryGroupResponse;
import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestChannel;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/**
* Package for the rest classes related to query groups in WorkloadManagementPlugin
*/
package org.opensearch.plugin.wlm.querygroup.rest;
Loading
Loading