* Resolving the todo, cleaning up the unused `settings` parameter * Cleaning up some other minor dead code in affected classes
This commit is contained in:
parent
f8c08c537b
commit
a9e1402189
|
@ -55,7 +55,7 @@ public class NoopPlugin extends Plugin implements ActionPlugin {
|
|||
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return Arrays.asList(
|
||||
new RestNoopBulkAction(settings, restController),
|
||||
new RestNoopSearchAction(settings, restController));
|
||||
new RestNoopBulkAction(restController),
|
||||
new RestNoopSearchAction(restController));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.support.ActiveShardCount;
|
|||
import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.elasticsearch.client.Requests;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
|
@ -45,9 +44,8 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
|||
import static org.elasticsearch.rest.RestStatus.OK;
|
||||
|
||||
public class RestNoopBulkAction extends BaseRestHandler {
|
||||
public RestNoopBulkAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestNoopBulkAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_noop_bulk", this);
|
||||
controller.registerHandler(PUT, "/_noop_bulk", this);
|
||||
controller.registerHandler(POST, "/{index}/_noop_bulk", this);
|
||||
|
|
|
@ -20,20 +20,17 @@ package org.elasticsearch.plugin.noop.action.search;
|
|||
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestStatusToXContentListener;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestNoopSearchAction extends BaseRestHandler {
|
||||
public RestNoopSearchAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestNoopSearchAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_noop_search", this);
|
||||
controller.registerHandler(POST, "/_noop_search", this);
|
||||
controller.registerHandler(GET, "/{index}/_noop_search", this);
|
||||
|
@ -48,7 +45,7 @@ public class RestNoopSearchAction extends BaseRestHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) {
|
||||
SearchRequest searchRequest = new SearchRequest();
|
||||
return channel -> client.execute(NoopSearchAction.INSTANCE, searchRequest, new RestStatusToXContentListener<>(channel));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.elasticsearch.client.node.NodeClient;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
|
@ -117,8 +116,7 @@ public class GrokProcessorGetAction extends ActionType<GrokProcessorGetAction.Re
|
|||
}
|
||||
|
||||
public static class RestAction extends BaseRestHandler {
|
||||
RestAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
RestAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_ingest/processor/grok", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ public class IngestCommonPlugin extends Plugin implements ActionPlugin, IngestPl
|
|||
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return Arrays.asList(new GrokProcessorGetAction.RestAction(settings, restController));
|
||||
return Arrays.asList(new GrokProcessorGetAction.RestAction(restController));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -59,8 +59,8 @@ public class MustachePlugin extends Plugin implements ScriptPlugin, ActionPlugin
|
|||
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return Arrays.asList(
|
||||
new RestSearchTemplateAction(settings, restController),
|
||||
new RestSearchTemplateAction(restController),
|
||||
new RestMultiSearchTemplateAction(settings, restController),
|
||||
new RestRenderSearchTemplateAction(settings, restController));
|
||||
new RestRenderSearchTemplateAction(restController));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ public class RestMultiSearchTemplateAction extends BaseRestHandler {
|
|||
private final boolean allowExplicitIndex;
|
||||
|
||||
public RestMultiSearchTemplateAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings);
|
||||
|
||||
controller.registerHandler(GET, "/_msearch/template", this);
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -34,8 +33,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestRenderSearchTemplateAction extends BaseRestHandler {
|
||||
public RestRenderSearchTemplateAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestRenderSearchTemplateAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_render/template", this);
|
||||
controller.registerHandler(POST, "/_render/template", this);
|
||||
controller.registerHandler(GET, "/_render/template/{id}", this);
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.script.mustache;
|
|||
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -47,9 +46,7 @@ public class RestSearchTemplateAction extends BaseRestHandler {
|
|||
RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams);
|
||||
}
|
||||
|
||||
public RestSearchTemplateAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestSearchTemplateAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_search/template", this);
|
||||
controller.registerHandler(POST, "/_search/template", this);
|
||||
controller.registerHandler(GET, "/{index}/_search/template", this);
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.search.RestSearchAction;
|
||||
import org.elasticsearch.test.rest.FakeRestRequest;
|
||||
|
@ -32,7 +31,7 @@ public class RestSearchTemplateActionTests extends RestActionTestCase {
|
|||
|
||||
@Before
|
||||
public void setUpAction() {
|
||||
new RestSearchTemplateAction(Settings.EMPTY, controller());
|
||||
new RestSearchTemplateAction(controller());
|
||||
}
|
||||
|
||||
public void testTypeInPath() {
|
||||
|
|
|
@ -142,8 +142,8 @@ public final class PainlessPlugin extends Plugin implements ScriptPlugin, Extens
|
|||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
List<RestHandler> handlers = new ArrayList<>();
|
||||
handlers.add(new PainlessExecuteAction.RestAction(settings, restController));
|
||||
handlers.add(new PainlessContextAction.RestAction(settings, restController));
|
||||
handlers.add(new PainlessExecuteAction.RestAction(restController));
|
||||
handlers.add(new PainlessContextAction.RestAction(restController));
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.painless.PainlessScriptEngine;
|
||||
|
@ -195,8 +194,7 @@ public class PainlessContextAction extends ActionType<PainlessContextAction.Resp
|
|||
|
||||
public static class RestAction extends BaseRestHandler {
|
||||
|
||||
public RestAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_scripts/painless/_context", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
|
@ -583,8 +582,7 @@ public class PainlessExecuteAction extends ActionType<PainlessExecuteAction.Resp
|
|||
|
||||
public static class RestAction extends BaseRestHandler {
|
||||
|
||||
public RestAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_scripts/painless/_execute", this);
|
||||
controller.registerHandler(POST, "/_scripts/painless/_execute", this);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class RankEvalPlugin extends Plugin implements ActionPlugin {
|
|||
public List<RestHandler> getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings,
|
||||
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return Arrays.asList(new RestRankEvalAction(settings, restController));
|
||||
return Arrays.asList(new RestRankEvalAction(restController));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.index.rankeval;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -90,8 +89,7 @@ public class RestRankEvalAction extends BaseRestHandler {
|
|||
|
||||
public static String ENDPOINT = "_rank_eval";
|
||||
|
||||
public RestRankEvalAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestRankEvalAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/" + ENDPOINT, this);
|
||||
controller.registerHandler(POST, "/" + ENDPOINT, this);
|
||||
controller.registerHandler(GET, "/{index}/" + ENDPOINT, this);
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package org.elasticsearch.index.reindex;
|
||||
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.support.ActiveShardCount;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -43,8 +42,7 @@ public abstract class AbstractBaseReindexRestHandler<
|
|||
|
||||
private final A action;
|
||||
|
||||
protected AbstractBaseReindexRestHandler(Settings settings, A action) {
|
||||
super(settings);
|
||||
protected AbstractBaseReindexRestHandler(A action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
|
@ -113,7 +111,7 @@ public abstract class AbstractBaseReindexRestHandler<
|
|||
return request;
|
||||
}
|
||||
|
||||
private RestChannelConsumer sendTask(String localNodeId, Task task) throws IOException {
|
||||
private RestChannelConsumer sendTask(String localNodeId, Task task) {
|
||||
return channel -> {
|
||||
try (XContentBuilder builder = channel.newBuilder()) {
|
||||
builder.startObject();
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.index.reindex;
|
|||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
@ -41,8 +40,8 @@ public abstract class AbstractBulkByQueryRestHandler<
|
|||
Request extends AbstractBulkByScrollRequest<Request>,
|
||||
A extends ActionType<BulkByScrollResponse>> extends AbstractBaseReindexRestHandler<Request, A> {
|
||||
|
||||
protected AbstractBulkByQueryRestHandler(Settings settings, A action) {
|
||||
super(settings, action);
|
||||
protected AbstractBulkByQueryRestHandler(A action) {
|
||||
super(action);
|
||||
}
|
||||
|
||||
protected void parseInternalRequest(Request internal, RestRequest restRequest,
|
||||
|
|
|
@ -74,10 +74,10 @@ public class ReindexPlugin extends Plugin implements ActionPlugin {
|
|||
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return Arrays.asList(
|
||||
new RestReindexAction(settings, restController),
|
||||
new RestUpdateByQueryAction(settings, restController),
|
||||
new RestDeleteByQueryAction(settings, restController),
|
||||
new RestRethrottleAction(settings, restController, nodesInCluster));
|
||||
new RestReindexAction(restController),
|
||||
new RestUpdateByQueryAction(restController),
|
||||
new RestDeleteByQueryAction(restController),
|
||||
new RestRethrottleAction(restController, nodesInCluster));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.index.reindex;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
||||
|
@ -32,8 +31,9 @@ import java.util.function.Consumer;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestDeleteByQueryAction extends AbstractBulkByQueryRestHandler<DeleteByQueryRequest, DeleteByQueryAction> {
|
||||
public RestDeleteByQueryAction(Settings settings, RestController controller) {
|
||||
super(settings, DeleteByQueryAction.INSTANCE);
|
||||
|
||||
public RestDeleteByQueryAction(RestController controller) {
|
||||
super(DeleteByQueryAction.INSTANCE);
|
||||
controller.registerHandler(POST, "/{index}/_delete_by_query", this);
|
||||
controller.registerHandler(POST, "/{index}/{type}/_delete_by_query", this);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.index.reindex;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -35,8 +34,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
*/
|
||||
public class RestReindexAction extends AbstractBaseReindexRestHandler<ReindexRequest, ReindexAction> {
|
||||
|
||||
public RestReindexAction(Settings settings, RestController controller) {
|
||||
super(settings, ReindexAction.INSTANCE);
|
||||
public RestReindexAction(RestController controller) {
|
||||
super(ReindexAction.INSTANCE);
|
||||
controller.registerHandler(POST, "/_reindex", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,13 +21,11 @@ package org.elasticsearch.index.reindex;
|
|||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.tasks.TaskId;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
@ -36,8 +34,7 @@ import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.li
|
|||
public class RestRethrottleAction extends BaseRestHandler {
|
||||
private final Supplier<DiscoveryNodes> nodesInCluster;
|
||||
|
||||
public RestRethrottleAction(Settings settings, RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
super(settings);
|
||||
public RestRethrottleAction(RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
this.nodesInCluster = nodesInCluster;
|
||||
controller.registerHandler(POST, "/_update_by_query/{taskId}/_rethrottle", this);
|
||||
controller.registerHandler(POST, "/_delete_by_query/{taskId}/_rethrottle", this);
|
||||
|
@ -50,7 +47,7 @@ public class RestRethrottleAction extends BaseRestHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) {
|
||||
RethrottleRequest internalRequest = new RethrottleRequest();
|
||||
internalRequest.setTaskId(new TaskId(request.param("taskId")));
|
||||
Float requestsPerSecond = AbstractBaseReindexRestHandler.parseRequestsPerSecond(request);
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.index.reindex;
|
|||
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -39,8 +38,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
import static org.elasticsearch.script.Script.DEFAULT_SCRIPT_LANG;
|
||||
|
||||
public class RestUpdateByQueryAction extends AbstractBulkByQueryRestHandler<UpdateByQueryRequest, UpdateByQueryAction> {
|
||||
public RestUpdateByQueryAction(Settings settings, RestController controller) {
|
||||
super(settings, UpdateByQueryAction.INSTANCE);
|
||||
public RestUpdateByQueryAction(RestController controller) {
|
||||
super(UpdateByQueryAction.INSTANCE);
|
||||
controller.registerHandler(POST, "/{index}/_update_by_query", this);
|
||||
controller.registerHandler(POST, "/{index}/{type}/_update_by_query", this);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.index.reindex;
|
||||
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.search.RestSearchAction;
|
||||
|
@ -36,7 +35,7 @@ public class RestDeleteByQueryActionTests extends RestActionTestCase {
|
|||
|
||||
@Before
|
||||
public void setUpAction() {
|
||||
action = new RestDeleteByQueryAction(Settings.EMPTY, controller());
|
||||
action = new RestDeleteByQueryAction(controller());
|
||||
}
|
||||
|
||||
public void testTypeInPath() throws IOException {
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.index.reindex;
|
|||
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||
|
@ -41,7 +40,7 @@ public class RestReindexActionTests extends RestActionTestCase {
|
|||
|
||||
@Before
|
||||
public void setUpAction() {
|
||||
action = new RestReindexAction(Settings.EMPTY, controller());
|
||||
action = new RestReindexAction(controller());
|
||||
}
|
||||
|
||||
public void testPipelineQueryParameterIsError() throws IOException {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.elasticsearch.index.reindex;
|
||||
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.search.RestSearchAction;
|
||||
|
@ -37,7 +36,7 @@ public class RestUpdateByQueryActionTests extends RestActionTestCase {
|
|||
|
||||
@Before
|
||||
public void setUpAction() {
|
||||
action = new RestUpdateByQueryAction(Settings.EMPTY, controller());
|
||||
action = new RestUpdateByQueryAction(controller());
|
||||
}
|
||||
|
||||
public void testTypeInPath() throws IOException {
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.elasticsearch.example.resthandler;
|
|||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Table;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -35,8 +34,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
*/
|
||||
public class ExampleCatAction extends AbstractCatAction {
|
||||
|
||||
ExampleCatAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
ExampleCatAction(final RestController controller) {
|
||||
controller.registerHandler(GET, "/_cat/example", this);
|
||||
controller.registerHandler(POST, "/_cat/example", this);
|
||||
}
|
||||
|
|
|
@ -46,6 +46,6 @@ public class ExampleRestHandlerPlugin extends Plugin implements ActionPlugin {
|
|||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
final Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
|
||||
return singletonList(new ExampleCatAction(settings, restController));
|
||||
return singletonList(new ExampleCatAction(restController));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ public class S3BlobStoreRepositoryTests extends ESBlobStoreRepositoryIntegTestCa
|
|||
final String repositoryName = "testInsecureRepositoryCredentials";
|
||||
createAndCheckTestRepository(repositoryName);
|
||||
final NodeClient nodeClient = internalCluster().getInstance(NodeClient.class);
|
||||
final RestGetRepositoriesAction getRepoAction = new RestGetRepositoriesAction(Settings.EMPTY, mock(RestController.class),
|
||||
final RestGetRepositoriesAction getRepoAction = new RestGetRepositoriesAction(mock(RestController.class),
|
||||
internalCluster().getInstance(SettingsFilter.class));
|
||||
final RestRequest getRepoRequest = new FakeRestRequest();
|
||||
getRepoRequest.params().put("repository", repositoryName);
|
||||
|
|
|
@ -49,7 +49,7 @@ public class DieWithDignityPlugin extends Plugin implements ActionPlugin {
|
|||
final SettingsFilter settingsFilter,
|
||||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
final Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return Collections.singletonList(new RestDieWithDignityAction(settings, restController));
|
||||
return Collections.singletonList(new RestDieWithDignityAction(restController));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,17 +20,13 @@
|
|||
package org.elasticsearch;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RestDieWithDignityAction extends BaseRestHandler {
|
||||
|
||||
RestDieWithDignityAction(final Settings settings, final RestController restController) {
|
||||
super(settings);
|
||||
RestDieWithDignityAction(final RestController restController) {
|
||||
restController.registerHandler(RestRequest.Method.GET, "/_die_with_dignity", this);
|
||||
}
|
||||
|
||||
|
@ -40,7 +36,7 @@ public class RestDieWithDignityAction extends BaseRestHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) {
|
||||
throw new OutOfMemoryError("die with dignity");
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ public class TestDeprecationHeaderRestAction extends BaseRestHandler {
|
|||
private final Settings settings;
|
||||
|
||||
public TestDeprecationHeaderRestAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
this.settings = settings;
|
||||
|
||||
controller.registerAsDeprecatedHandler(RestRequest.Method.GET, "/_test_cluster/deprecated_settings", this,
|
||||
|
|
|
@ -40,6 +40,6 @@ public class TestResponseHeaderPlugin extends Plugin implements ActionPlugin {
|
|||
public List<RestHandler> getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings,
|
||||
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
return singletonList(new TestResponseHeaderRestAction(settings, restController));
|
||||
return singletonList(new TestResponseHeaderRestAction(restController));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.elasticsearch.http;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -27,11 +26,9 @@ import org.elasticsearch.rest.RestRequest;
|
|||
import org.elasticsearch.rest.RestResponse;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class TestResponseHeaderRestAction extends BaseRestHandler {
|
||||
public TestResponseHeaderRestAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public TestResponseHeaderRestAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_protected", this);
|
||||
}
|
||||
|
||||
|
@ -41,7 +38,7 @@ public class TestResponseHeaderRestAction extends BaseRestHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
|
||||
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) {
|
||||
if ("password".equals(request.header("Secret"))) {
|
||||
RestResponse response = new BytesRestResponse(RestStatus.OK, "Access granted");
|
||||
response.addHeader("Secret", "granted");
|
||||
|
|
|
@ -556,140 +556,140 @@ public class ActionModule extends AbstractModule {
|
|||
catActions.add((AbstractCatAction) a);
|
||||
}
|
||||
};
|
||||
registerHandler.accept(new RestAddVotingConfigExclusionAction(settings, restController));
|
||||
registerHandler.accept(new RestClearVotingConfigExclusionsAction(settings, restController));
|
||||
registerHandler.accept(new RestMainAction(settings, restController));
|
||||
registerHandler.accept(new RestNodesInfoAction(settings, restController, settingsFilter));
|
||||
registerHandler.accept(new RestRemoteClusterInfoAction(settings, restController));
|
||||
registerHandler.accept(new RestNodesStatsAction(settings, restController));
|
||||
registerHandler.accept(new RestNodesUsageAction(settings, restController));
|
||||
registerHandler.accept(new RestNodesHotThreadsAction(settings, restController));
|
||||
registerHandler.accept(new RestClusterAllocationExplainAction(settings, restController));
|
||||
registerHandler.accept(new RestClusterStatsAction(settings, restController));
|
||||
registerHandler.accept(new RestClusterStateAction(settings, restController, settingsFilter));
|
||||
registerHandler.accept(new RestClusterHealthAction(settings, restController));
|
||||
registerHandler.accept(new RestClusterUpdateSettingsAction(settings, restController));
|
||||
registerHandler.accept(new RestAddVotingConfigExclusionAction(restController));
|
||||
registerHandler.accept(new RestClearVotingConfigExclusionsAction(restController));
|
||||
registerHandler.accept(new RestMainAction(restController));
|
||||
registerHandler.accept(new RestNodesInfoAction(restController, settingsFilter));
|
||||
registerHandler.accept(new RestRemoteClusterInfoAction(restController));
|
||||
registerHandler.accept(new RestNodesStatsAction(restController));
|
||||
registerHandler.accept(new RestNodesUsageAction(restController));
|
||||
registerHandler.accept(new RestNodesHotThreadsAction(restController));
|
||||
registerHandler.accept(new RestClusterAllocationExplainAction(restController));
|
||||
registerHandler.accept(new RestClusterStatsAction(restController));
|
||||
registerHandler.accept(new RestClusterStateAction(restController, settingsFilter));
|
||||
registerHandler.accept(new RestClusterHealthAction(restController));
|
||||
registerHandler.accept(new RestClusterUpdateSettingsAction(restController));
|
||||
registerHandler.accept(new RestClusterGetSettingsAction(settings, restController, clusterSettings, settingsFilter));
|
||||
registerHandler.accept(new RestClusterRerouteAction(settings, restController, settingsFilter));
|
||||
registerHandler.accept(new RestClusterSearchShardsAction(settings, restController));
|
||||
registerHandler.accept(new RestPendingClusterTasksAction(settings, restController));
|
||||
registerHandler.accept(new RestPutRepositoryAction(settings, restController));
|
||||
registerHandler.accept(new RestGetRepositoriesAction(settings, restController, settingsFilter));
|
||||
registerHandler.accept(new RestDeleteRepositoryAction(settings, restController));
|
||||
registerHandler.accept(new RestVerifyRepositoryAction(settings, restController));
|
||||
registerHandler.accept(new RestGetSnapshotsAction(settings, restController));
|
||||
registerHandler.accept(new RestCreateSnapshotAction(settings, restController));
|
||||
registerHandler.accept(new RestRestoreSnapshotAction(settings, restController));
|
||||
registerHandler.accept(new RestDeleteSnapshotAction(settings, restController));
|
||||
registerHandler.accept(new RestSnapshotsStatusAction(settings, restController));
|
||||
registerHandler.accept(new RestGetIndicesAction(settings, restController));
|
||||
registerHandler.accept(new RestIndicesStatsAction(settings, restController));
|
||||
registerHandler.accept(new RestIndicesSegmentsAction(settings, restController));
|
||||
registerHandler.accept(new RestIndicesShardStoresAction(settings, restController));
|
||||
registerHandler.accept(new RestGetAliasesAction(settings, restController));
|
||||
registerHandler.accept(new RestIndexDeleteAliasesAction(settings, restController));
|
||||
registerHandler.accept(new RestIndexPutAliasAction(settings, restController));
|
||||
registerHandler.accept(new RestIndicesAliasesAction(settings, restController));
|
||||
registerHandler.accept(new RestCreateIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestResizeHandler.RestShrinkIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestResizeHandler.RestSplitIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestResizeHandler.RestCloneIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestRolloverIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestDeleteIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestCloseIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestOpenIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestClusterRerouteAction(restController, settingsFilter));
|
||||
registerHandler.accept(new RestClusterSearchShardsAction(restController));
|
||||
registerHandler.accept(new RestPendingClusterTasksAction(restController));
|
||||
registerHandler.accept(new RestPutRepositoryAction(restController));
|
||||
registerHandler.accept(new RestGetRepositoriesAction(restController, settingsFilter));
|
||||
registerHandler.accept(new RestDeleteRepositoryAction(restController));
|
||||
registerHandler.accept(new RestVerifyRepositoryAction(restController));
|
||||
registerHandler.accept(new RestGetSnapshotsAction(restController));
|
||||
registerHandler.accept(new RestCreateSnapshotAction(restController));
|
||||
registerHandler.accept(new RestRestoreSnapshotAction(restController));
|
||||
registerHandler.accept(new RestDeleteSnapshotAction(restController));
|
||||
registerHandler.accept(new RestSnapshotsStatusAction(restController));
|
||||
registerHandler.accept(new RestGetIndicesAction(restController));
|
||||
registerHandler.accept(new RestIndicesStatsAction(restController));
|
||||
registerHandler.accept(new RestIndicesSegmentsAction(restController));
|
||||
registerHandler.accept(new RestIndicesShardStoresAction(restController));
|
||||
registerHandler.accept(new RestGetAliasesAction(restController));
|
||||
registerHandler.accept(new RestIndexDeleteAliasesAction(restController));
|
||||
registerHandler.accept(new RestIndexPutAliasAction(restController));
|
||||
registerHandler.accept(new RestIndicesAliasesAction(restController));
|
||||
registerHandler.accept(new RestCreateIndexAction(restController));
|
||||
registerHandler.accept(new RestResizeHandler.RestShrinkIndexAction(restController));
|
||||
registerHandler.accept(new RestResizeHandler.RestSplitIndexAction(restController));
|
||||
registerHandler.accept(new RestResizeHandler.RestCloneIndexAction(restController));
|
||||
registerHandler.accept(new RestRolloverIndexAction(restController));
|
||||
registerHandler.accept(new RestDeleteIndexAction(restController));
|
||||
registerHandler.accept(new RestCloseIndexAction(restController));
|
||||
registerHandler.accept(new RestOpenIndexAction(restController));
|
||||
|
||||
registerHandler.accept(new RestUpdateSettingsAction(settings, restController));
|
||||
registerHandler.accept(new RestGetSettingsAction(settings, restController));
|
||||
registerHandler.accept(new RestUpdateSettingsAction(restController));
|
||||
registerHandler.accept(new RestGetSettingsAction(restController));
|
||||
|
||||
registerHandler.accept(new RestAnalyzeAction(settings, restController));
|
||||
registerHandler.accept(new RestGetIndexTemplateAction(settings, restController));
|
||||
registerHandler.accept(new RestPutIndexTemplateAction(settings, restController));
|
||||
registerHandler.accept(new RestDeleteIndexTemplateAction(settings, restController));
|
||||
registerHandler.accept(new RestAnalyzeAction(restController));
|
||||
registerHandler.accept(new RestGetIndexTemplateAction(restController));
|
||||
registerHandler.accept(new RestPutIndexTemplateAction(restController));
|
||||
registerHandler.accept(new RestDeleteIndexTemplateAction(restController));
|
||||
|
||||
registerHandler.accept(new RestPutMappingAction(settings, restController));
|
||||
registerHandler.accept(new RestGetMappingAction(settings, restController));
|
||||
registerHandler.accept(new RestGetFieldMappingAction(settings, restController));
|
||||
registerHandler.accept(new RestPutMappingAction(restController));
|
||||
registerHandler.accept(new RestGetMappingAction(restController));
|
||||
registerHandler.accept(new RestGetFieldMappingAction(restController));
|
||||
|
||||
registerHandler.accept(new RestRefreshAction(settings, restController));
|
||||
registerHandler.accept(new RestFlushAction(settings, restController));
|
||||
registerHandler.accept(new RestSyncedFlushAction(settings, restController));
|
||||
registerHandler.accept(new RestForceMergeAction(settings, restController));
|
||||
registerHandler.accept(new RestUpgradeAction(settings, restController));
|
||||
registerHandler.accept(new RestUpgradeStatusAction(settings, restController));
|
||||
registerHandler.accept(new RestClearIndicesCacheAction(settings, restController));
|
||||
registerHandler.accept(new RestRefreshAction(restController));
|
||||
registerHandler.accept(new RestFlushAction(restController));
|
||||
registerHandler.accept(new RestSyncedFlushAction(restController));
|
||||
registerHandler.accept(new RestForceMergeAction(restController));
|
||||
registerHandler.accept(new RestUpgradeAction(restController));
|
||||
registerHandler.accept(new RestUpgradeStatusAction(restController));
|
||||
registerHandler.accept(new RestClearIndicesCacheAction(restController));
|
||||
|
||||
registerHandler.accept(new RestIndexAction(settings, restController));
|
||||
registerHandler.accept(new RestGetAction(settings, restController));
|
||||
registerHandler.accept(new RestGetSourceAction(settings, restController));
|
||||
registerHandler.accept(new RestIndexAction(restController));
|
||||
registerHandler.accept(new RestGetAction(restController));
|
||||
registerHandler.accept(new RestGetSourceAction(restController));
|
||||
registerHandler.accept(new RestMultiGetAction(settings, restController));
|
||||
registerHandler.accept(new RestDeleteAction(settings, restController));
|
||||
registerHandler.accept(new RestCountAction(settings, restController));
|
||||
registerHandler.accept(new RestTermVectorsAction(settings, restController));
|
||||
registerHandler.accept(new RestMultiTermVectorsAction(settings, restController));
|
||||
registerHandler.accept(new RestDeleteAction(restController));
|
||||
registerHandler.accept(new RestCountAction(restController));
|
||||
registerHandler.accept(new RestTermVectorsAction(restController));
|
||||
registerHandler.accept(new RestMultiTermVectorsAction(restController));
|
||||
registerHandler.accept(new RestBulkAction(settings, restController));
|
||||
registerHandler.accept(new RestUpdateAction(settings, restController));
|
||||
registerHandler.accept(new RestUpdateAction(restController));
|
||||
|
||||
registerHandler.accept(new RestSearchAction(settings, restController));
|
||||
registerHandler.accept(new RestSearchScrollAction(settings, restController));
|
||||
registerHandler.accept(new RestClearScrollAction(settings, restController));
|
||||
registerHandler.accept(new RestSearchAction(restController));
|
||||
registerHandler.accept(new RestSearchScrollAction(restController));
|
||||
registerHandler.accept(new RestClearScrollAction(restController));
|
||||
registerHandler.accept(new RestMultiSearchAction(settings, restController));
|
||||
|
||||
registerHandler.accept(new RestValidateQueryAction(settings, restController));
|
||||
registerHandler.accept(new RestValidateQueryAction(restController));
|
||||
|
||||
registerHandler.accept(new RestExplainAction(settings, restController));
|
||||
registerHandler.accept(new RestExplainAction(restController));
|
||||
|
||||
registerHandler.accept(new RestRecoveryAction(settings, restController));
|
||||
registerHandler.accept(new RestRecoveryAction(restController));
|
||||
|
||||
registerHandler.accept(new RestReloadSecureSettingsAction(settings, restController));
|
||||
registerHandler.accept(new RestReloadSecureSettingsAction(restController));
|
||||
|
||||
// Scripts API
|
||||
registerHandler.accept(new RestGetStoredScriptAction(settings, restController));
|
||||
registerHandler.accept(new RestPutStoredScriptAction(settings, restController));
|
||||
registerHandler.accept(new RestDeleteStoredScriptAction(settings, restController));
|
||||
registerHandler.accept(new RestGetStoredScriptAction(restController));
|
||||
registerHandler.accept(new RestPutStoredScriptAction(restController));
|
||||
registerHandler.accept(new RestDeleteStoredScriptAction(restController));
|
||||
|
||||
registerHandler.accept(new RestFieldCapabilitiesAction(settings, restController));
|
||||
registerHandler.accept(new RestFieldCapabilitiesAction(restController));
|
||||
|
||||
// Tasks API
|
||||
registerHandler.accept(new RestListTasksAction(settings, restController, nodesInCluster));
|
||||
registerHandler.accept(new RestGetTaskAction(settings, restController));
|
||||
registerHandler.accept(new RestCancelTasksAction(settings, restController, nodesInCluster));
|
||||
registerHandler.accept(new RestListTasksAction(restController, nodesInCluster));
|
||||
registerHandler.accept(new RestGetTaskAction(restController));
|
||||
registerHandler.accept(new RestCancelTasksAction(restController, nodesInCluster));
|
||||
|
||||
// Ingest API
|
||||
registerHandler.accept(new RestPutPipelineAction(settings, restController));
|
||||
registerHandler.accept(new RestGetPipelineAction(settings, restController));
|
||||
registerHandler.accept(new RestDeletePipelineAction(settings, restController));
|
||||
registerHandler.accept(new RestSimulatePipelineAction(settings, restController));
|
||||
registerHandler.accept(new RestPutPipelineAction(restController));
|
||||
registerHandler.accept(new RestGetPipelineAction(restController));
|
||||
registerHandler.accept(new RestDeletePipelineAction(restController));
|
||||
registerHandler.accept(new RestSimulatePipelineAction(restController));
|
||||
|
||||
// CAT API
|
||||
registerHandler.accept(new RestAllocationAction(settings, restController));
|
||||
registerHandler.accept(new RestShardsAction(settings, restController));
|
||||
registerHandler.accept(new RestMasterAction(settings, restController));
|
||||
registerHandler.accept(new RestNodesAction(settings, restController));
|
||||
registerHandler.accept(new RestTasksAction(settings, restController, nodesInCluster));
|
||||
registerHandler.accept(new RestIndicesAction(settings, restController));
|
||||
registerHandler.accept(new RestSegmentsAction(settings, restController));
|
||||
registerHandler.accept(new RestAllocationAction(restController));
|
||||
registerHandler.accept(new RestShardsAction(restController));
|
||||
registerHandler.accept(new RestMasterAction(restController));
|
||||
registerHandler.accept(new RestNodesAction(restController));
|
||||
registerHandler.accept(new RestTasksAction(restController, nodesInCluster));
|
||||
registerHandler.accept(new RestIndicesAction(restController));
|
||||
registerHandler.accept(new RestSegmentsAction(restController));
|
||||
// Fully qualified to prevent interference with rest.action.count.RestCountAction
|
||||
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestCountAction(settings, restController));
|
||||
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestCountAction(restController));
|
||||
// Fully qualified to prevent interference with rest.action.indices.RestRecoveryAction
|
||||
registerHandler.accept(new RestCatRecoveryAction(settings, restController));
|
||||
registerHandler.accept(new RestHealthAction(settings, restController));
|
||||
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestPendingClusterTasksAction(settings, restController));
|
||||
registerHandler.accept(new RestAliasAction(settings, restController));
|
||||
registerHandler.accept(new RestThreadPoolAction(settings, restController));
|
||||
registerHandler.accept(new RestPluginsAction(settings, restController));
|
||||
registerHandler.accept(new RestFielddataAction(settings, restController));
|
||||
registerHandler.accept(new RestNodeAttrsAction(settings, restController));
|
||||
registerHandler.accept(new RestRepositoriesAction(settings, restController));
|
||||
registerHandler.accept(new RestSnapshotAction(settings, restController));
|
||||
registerHandler.accept(new RestTemplatesAction(settings, restController));
|
||||
registerHandler.accept(new RestCatRecoveryAction(restController));
|
||||
registerHandler.accept(new RestHealthAction(restController));
|
||||
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestPendingClusterTasksAction(restController));
|
||||
registerHandler.accept(new RestAliasAction(restController));
|
||||
registerHandler.accept(new RestThreadPoolAction(restController));
|
||||
registerHandler.accept(new RestPluginsAction(restController));
|
||||
registerHandler.accept(new RestFielddataAction(restController));
|
||||
registerHandler.accept(new RestNodeAttrsAction(restController));
|
||||
registerHandler.accept(new RestRepositoriesAction(restController));
|
||||
registerHandler.accept(new RestSnapshotAction(restController));
|
||||
registerHandler.accept(new RestTemplatesAction(restController));
|
||||
for (ActionPlugin plugin : actionPlugins) {
|
||||
for (RestHandler handler : plugin.getRestHandlers(settings, restController, clusterSettings, indexScopedSettings,
|
||||
settingsFilter, indexNameExpressionResolver, nodesInCluster)) {
|
||||
registerHandler.accept(handler);
|
||||
}
|
||||
}
|
||||
registerHandler.accept(new RestCatAction(settings, restController, catActions));
|
||||
registerHandler.accept(new RestCatAction(restController, catActions));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.common.CheckedConsumer;
|
|||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction;
|
||||
|
||||
|
@ -70,10 +69,6 @@ public abstract class BaseRestHandler implements RestHandler {
|
|||
public static final String INCLUDE_TYPE_NAME_PARAMETER = "include_type_name";
|
||||
public static final boolean DEFAULT_INCLUDE_TYPE_NAME_POLICY = false;
|
||||
|
||||
protected BaseRestHandler(Settings settings) {
|
||||
// TODO drop settings from ctor
|
||||
}
|
||||
|
||||
public final long getUsageCount() {
|
||||
return usageCount.sum();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -34,8 +33,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestFieldCapabilitiesAction extends BaseRestHandler {
|
||||
public RestFieldCapabilitiesAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestFieldCapabilitiesAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_field_caps", this);
|
||||
controller.registerHandler(POST, "/_field_caps", this);
|
||||
controller.registerHandler(GET, "/{index}/_field_caps", this);
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.main.MainAction;
|
|||
import org.elasticsearch.action.main.MainRequest;
|
||||
import org.elasticsearch.action.main.MainResponse;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -38,8 +37,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.HEAD;
|
||||
|
||||
public class RestMainAction extends BaseRestHandler {
|
||||
public RestMainAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestMainAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/", this);
|
||||
controller.registerHandler(HEAD, "/", this);
|
||||
}
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
package org.elasticsearch.rest.action.admin.cluster;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsRequest;
|
||||
import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsAction;
|
||||
import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -36,8 +35,7 @@ public class RestAddVotingConfigExclusionAction extends BaseRestHandler {
|
|||
|
||||
private static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueSeconds(30L);
|
||||
|
||||
public RestAddVotingConfigExclusionAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestAddVotingConfigExclusionAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.POST, "/_cluster/voting_config_exclusions/{node_name}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksReque
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -39,8 +38,7 @@ import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.li
|
|||
public class RestCancelTasksAction extends BaseRestHandler {
|
||||
private final Supplier<DiscoveryNodes> nodesInCluster;
|
||||
|
||||
public RestCancelTasksAction(Settings settings, RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
super(settings);
|
||||
public RestCancelTasksAction(RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
this.nodesInCluster = nodesInCluster;
|
||||
controller.registerHandler(POST, "/_tasks/_cancel", this);
|
||||
controller.registerHandler(POST, "/_tasks/{task_id}/_cancel", this);
|
||||
|
|
|
@ -19,10 +19,9 @@
|
|||
|
||||
package org.elasticsearch.rest.action.admin.cluster;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsRequest;
|
||||
import org.elasticsearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsAction;
|
||||
import org.elasticsearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -32,8 +31,7 @@ import java.io.IOException;
|
|||
|
||||
public class RestClearVotingConfigExclusionsAction extends BaseRestHandler {
|
||||
|
||||
public RestClearVotingConfigExclusionsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestClearVotingConfigExclusionsAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.DELETE, "/_cluster/voting_config_exclusions", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainRequest;
|
||||
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainResponse;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
@ -40,8 +39,8 @@ import java.io.IOException;
|
|||
* Class handling cluster allocation explanation at the REST level
|
||||
*/
|
||||
public class RestClusterAllocationExplainAction extends BaseRestHandler {
|
||||
public RestClusterAllocationExplainAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestClusterAllocationExplainAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/allocation/explain", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/_cluster/allocation/explain", this);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ public class RestClusterGetSettingsAction extends BaseRestHandler {
|
|||
|
||||
public RestClusterGetSettingsAction(Settings settings, RestController controller, ClusterSettings clusterSettings,
|
||||
SettingsFilter settingsFilter) {
|
||||
super(settings);
|
||||
this.settings = settings;
|
||||
this.clusterSettings = clusterSettings;
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/settings", this);
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.elasticsearch.client.node.NodeClient;
|
|||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -41,8 +40,7 @@ import static org.elasticsearch.client.Requests.clusterHealthRequest;
|
|||
|
||||
public class RestClusterHealthAction extends BaseRestHandler {
|
||||
|
||||
public RestClusterHealthAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestClusterHealthAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/health", this);
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/health/{index}", this);
|
||||
}
|
||||
|
|
|
@ -54,8 +54,7 @@ public class RestClusterRerouteAction extends BaseRestHandler {
|
|||
|
||||
private final SettingsFilter settingsFilter;
|
||||
|
||||
public RestClusterRerouteAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
|
||||
super(settings);
|
||||
public RestClusterRerouteAction(RestController controller, SettingsFilter settingsFilter) {
|
||||
this.settingsFilter = settingsFilter;
|
||||
controller.registerHandler(RestRequest.Method.POST, "/_cluster/reroute", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.support.IndicesOptions;
|
|||
import org.elasticsearch.client.Requests;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -36,8 +35,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestClusterSearchShardsAction extends BaseRestHandler {
|
||||
public RestClusterSearchShardsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestClusterSearchShardsAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_search_shards", this);
|
||||
controller.registerHandler(POST, "/_search_shards", this);
|
||||
controller.registerHandler(GET, "/{index}/_search_shards", this);
|
||||
|
|
|
@ -47,8 +47,7 @@ public class RestClusterStateAction extends BaseRestHandler {
|
|||
|
||||
private final SettingsFilter settingsFilter;
|
||||
|
||||
public RestClusterStateAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
|
||||
super(settings);
|
||||
public RestClusterStateAction(RestController controller, SettingsFilter settingsFilter) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/state", this);
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/state/{metric}", this);
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/state/{metric}/{indices}", this);
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -30,8 +29,8 @@ import org.elasticsearch.rest.action.RestActions.NodesResponseRestListener;
|
|||
import java.io.IOException;
|
||||
|
||||
public class RestClusterStatsAction extends BaseRestHandler {
|
||||
public RestClusterStatsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestClusterStatsAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/stats", this);
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/stats/nodes/{nodeId}", this);
|
||||
}
|
||||
|
|
|
@ -38,8 +38,7 @@ public class RestClusterUpdateSettingsAction extends BaseRestHandler {
|
|||
private static final String PERSISTENT = "persistent";
|
||||
private static final String TRANSIENT = "transient";
|
||||
|
||||
public RestClusterUpdateSettingsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestClusterUpdateSettingsAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/_cluster/settings", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -37,8 +36,8 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
|||
* Creates a new snapshot
|
||||
*/
|
||||
public class RestCreateSnapshotAction extends BaseRestHandler {
|
||||
public RestCreateSnapshotAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestCreateSnapshotAction(RestController controller) {
|
||||
controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);
|
||||
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}", this);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -36,8 +35,8 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
|||
* Unregisters a repository
|
||||
*/
|
||||
public class RestDeleteRepositoryAction extends BaseRestHandler {
|
||||
public RestDeleteRepositoryAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestDeleteRepositoryAction(RestController controller) {
|
||||
controller.registerHandler(DELETE, "/_snapshot/{repository}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -36,8 +35,8 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
|||
* Deletes a snapshot
|
||||
*/
|
||||
public class RestDeleteSnapshotAction extends BaseRestHandler {
|
||||
public RestDeleteSnapshotAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestDeleteSnapshotAction(RestController controller) {
|
||||
controller.registerHandler(DELETE, "/_snapshot/{repository}/{snapshot}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -32,9 +31,7 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
|||
|
||||
public class RestDeleteStoredScriptAction extends BaseRestHandler {
|
||||
|
||||
public RestDeleteStoredScriptAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestDeleteStoredScriptAction(RestController controller) {
|
||||
controller.registerHandler(DELETE, "/_scripts/{id}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,7 @@ public class RestGetRepositoriesAction extends BaseRestHandler {
|
|||
|
||||
private final SettingsFilter settingsFilter;
|
||||
|
||||
public RestGetRepositoriesAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
|
||||
super(settings);
|
||||
public RestGetRepositoriesAction(RestController controller, SettingsFilter settingsFilter) {
|
||||
controller.registerHandler(GET, "/_snapshot", this);
|
||||
controller.registerHandler(GET, "/_snapshot/{repository}", this);
|
||||
this.settingsFilter = settingsFilter;
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -37,8 +36,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
* Returns information about snapshot
|
||||
*/
|
||||
public class RestGetSnapshotsAction extends BaseRestHandler {
|
||||
public RestGetSnapshotsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestGetSnapshotsAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -32,9 +31,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
|
||||
public class RestGetStoredScriptAction extends BaseRestHandler {
|
||||
|
||||
public RestGetStoredScriptAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestGetStoredScriptAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_scripts/{id}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.node.tasks.get.GetTaskRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -34,8 +33,8 @@ import java.io.IOException;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetTaskAction extends BaseRestHandler {
|
||||
public RestGetTaskAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestGetTaskAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_tasks/{task_id}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
|
@ -49,8 +48,7 @@ public class RestListTasksAction extends BaseRestHandler {
|
|||
|
||||
private final Supplier<DiscoveryNodes> nodesInCluster;
|
||||
|
||||
public RestListTasksAction(Settings settings, RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
super(settings);
|
||||
public RestListTasksAction(RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
|
||||
this.nodesInCluster = nodesInCluster;
|
||||
controller.registerHandler(GET, "/_tasks", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsReq
|
|||
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsResponse;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -38,8 +37,8 @@ import java.io.IOException;
|
|||
|
||||
|
||||
public class RestNodesHotThreadsAction extends BaseRestHandler {
|
||||
public RestNodesHotThreadsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestNodesHotThreadsAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/hotthreads", this);
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/hot_threads", this);
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/{nodeId}/hotthreads", this);
|
||||
|
|
|
@ -50,8 +50,7 @@ public class RestNodesInfoAction extends BaseRestHandler {
|
|||
|
||||
private final SettingsFilter settingsFilter;
|
||||
|
||||
public RestNodesInfoAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
|
||||
super(settings);
|
||||
public RestNodesInfoAction(RestController controller, SettingsFilter settingsFilter) {
|
||||
controller.registerHandler(GET, "/_nodes", this);
|
||||
// this endpoint is used for metrics, not for node IDs, like /_nodes/fs
|
||||
controller.registerHandler(GET, "/_nodes/{nodeId}", this);
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
|
|||
import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags.Flag;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -42,8 +41,8 @@ import java.util.function.Consumer;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestNodesStatsAction extends BaseRestHandler {
|
||||
public RestNodesStatsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestNodesStatsAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_nodes/stats", this);
|
||||
controller.registerHandler(GET, "/_nodes/{nodeId}/stats", this);
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.node.usage.NodesUsageResponse;
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -44,8 +43,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
public class RestNodesUsageAction extends BaseRestHandler {
|
||||
|
||||
@Inject
|
||||
public RestNodesUsageAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestNodesUsageAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_nodes/usage", this);
|
||||
controller.registerHandler(GET, "/_nodes/{nodeId}/usage", this);
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -30,8 +29,8 @@ import org.elasticsearch.rest.action.RestToXContentListener;
|
|||
import java.io.IOException;
|
||||
|
||||
public class RestPendingClusterTasksAction extends BaseRestHandler {
|
||||
public RestPendingClusterTasksAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestPendingClusterTasksAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.GET, "/_cluster/pending_tasks", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -38,8 +37,8 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
|||
* Registers repositories
|
||||
*/
|
||||
public class RestPutRepositoryAction extends BaseRestHandler {
|
||||
public RestPutRepositoryAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestPutRepositoryAction(RestController controller) {
|
||||
controller.registerHandler(PUT, "/_snapshot/{repository}", this);
|
||||
controller.registerHandler(POST, "/_snapshot/{repository}", this);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -36,9 +35,7 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
|||
|
||||
public class RestPutStoredScriptAction extends BaseRestHandler {
|
||||
|
||||
public RestPutStoredScriptAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestPutStoredScriptAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_scripts/{id}", this);
|
||||
controller.registerHandler(PUT, "/_scripts/{id}", this);
|
||||
controller.registerHandler(POST, "/_scripts/{id}/{context}", this);
|
||||
|
|
|
@ -19,12 +19,10 @@
|
|||
|
||||
package org.elasticsearch.rest.action.admin.cluster;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsRequest;
|
||||
import org.elasticsearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsRequestBuilder;
|
||||
import org.elasticsearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsResponse;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -41,8 +39,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
|
||||
public final class RestReloadSecureSettingsAction extends BaseRestHandler {
|
||||
|
||||
public RestReloadSecureSettingsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestReloadSecureSettingsAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_nodes/reload_secure_settings", this);
|
||||
controller.registerHandler(POST, "/_nodes/{nodeId}/reload_secure_settings", this);
|
||||
}
|
||||
|
@ -60,7 +57,6 @@ public final class RestReloadSecureSettingsAction extends BaseRestHandler {
|
|||
.prepareReloadSecureSettings()
|
||||
.setTimeout(request.param("timeout"))
|
||||
.setNodesIds(nodesIds);
|
||||
final NodesReloadSecureSettingsRequest nodesRequest = nodesRequestBuilder.request();
|
||||
return channel -> nodesRequestBuilder
|
||||
.execute(new RestBuilderListener<NodesReloadSecureSettingsResponse>(channel) {
|
||||
@Override
|
||||
|
|
|
@ -22,20 +22,16 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
import org.elasticsearch.action.admin.cluster.remote.RemoteInfoAction;
|
||||
import org.elasticsearch.action.admin.cluster.remote.RemoteInfoRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public final class RestRemoteClusterInfoAction extends BaseRestHandler {
|
||||
|
||||
public RestRemoteClusterInfoAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestRemoteClusterInfoAction(RestController controller) {
|
||||
controller.registerHandler(GET, "_remote/info", this);
|
||||
}
|
||||
|
||||
|
@ -45,9 +41,10 @@ public final class RestRemoteClusterInfoAction extends BaseRestHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) {
|
||||
return channel -> client.execute(RemoteInfoAction.INSTANCE, new RemoteInfoRequest(), new RestToXContentListener<>(channel));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTripCircuitBreaker() {
|
||||
return false;
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -36,8 +35,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
* Restores a snapshot
|
||||
*/
|
||||
public class RestRestoreSnapshotAction extends BaseRestHandler {
|
||||
public RestRestoreSnapshotAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestRestoreSnapshotAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_restore", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -37,8 +36,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
* Returns status of currently running snapshot
|
||||
*/
|
||||
public class RestSnapshotsStatusAction extends BaseRestHandler {
|
||||
public RestSnapshotsStatusAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestSnapshotsStatusAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}/_status", this);
|
||||
controller.registerHandler(GET, "/_snapshot/{repository}/_status", this);
|
||||
controller.registerHandler(GET, "/_snapshot/_status", this);
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -33,8 +32,8 @@ import static org.elasticsearch.client.Requests.verifyRepositoryRequest;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestVerifyRepositoryAction extends BaseRestHandler {
|
||||
public RestVerifyRepositoryAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestVerifyRepositoryAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_snapshot/{repository}/_verify", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.indices;
|
|||
import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -47,8 +46,7 @@ public class RestAnalyzeAction extends BaseRestHandler {
|
|||
public static final ParseField NORMALIZER = new ParseField("normalizer");
|
||||
}
|
||||
|
||||
public RestAnalyzeAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestAnalyzeAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_analyze", this);
|
||||
controller.registerHandler(GET, "/{index}/_analyze", this);
|
||||
controller.registerHandler(POST, "/_analyze", this);
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheReque
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -35,8 +34,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
|
||||
public class RestClearIndicesCacheAction extends BaseRestHandler {
|
||||
|
||||
public RestClearIndicesCacheAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestClearIndicesCacheAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_cache/clear", this);
|
||||
controller.registerHandler(POST, "/{index}/_cache/clear", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.support.ActiveShardCount;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -33,8 +32,8 @@ import org.elasticsearch.rest.action.RestToXContentListener;
|
|||
import java.io.IOException;
|
||||
|
||||
public class RestCloseIndexAction extends BaseRestHandler {
|
||||
public RestCloseIndexAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestCloseIndexAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.POST, "/_close", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_close", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
|
|||
import org.elasticsearch.action.support.ActiveShardCount;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
|
@ -44,8 +43,7 @@ public class RestCreateIndexAction extends BaseRestHandler {
|
|||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using include_type_name in create " +
|
||||
"index requests is deprecated. The parameter will be removed in the next major version.";
|
||||
|
||||
public RestCreateIndexAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestCreateIndexAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/{index}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -32,8 +31,8 @@ import org.elasticsearch.rest.action.RestToXContentListener;
|
|||
import java.io.IOException;
|
||||
|
||||
public class RestDeleteIndexAction extends BaseRestHandler {
|
||||
public RestDeleteIndexAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestDeleteIndexAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.DELETE, "/", this);
|
||||
controller.registerHandler(RestRequest.Method.DELETE, "/{index}", this);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.elasticsearch.rest.action.admin.indices;
|
|||
|
||||
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -29,8 +28,8 @@ import org.elasticsearch.rest.action.RestToXContentListener;
|
|||
import java.io.IOException;
|
||||
|
||||
public class RestDeleteIndexTemplateAction extends BaseRestHandler {
|
||||
public RestDeleteIndexTemplateAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestDeleteIndexTemplateAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.DELETE, "/_template/{name}", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.flush.FlushRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -35,8 +34,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestFlushAction extends BaseRestHandler {
|
||||
public RestFlushAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestFlushAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_flush", this);
|
||||
controller.registerHandler(POST, "/{index}/_flush", this);
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.support.IndicesOptions;
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -39,8 +38,7 @@ public class RestForceMergeAction extends BaseRestHandler {
|
|||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestForceMergeAction.class));
|
||||
|
||||
public RestForceMergeAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestForceMergeAction(final RestController controller) {
|
||||
controller.registerHandler(POST, "/_forcemerge", this);
|
||||
controller.registerHandler(POST, "/{index}/_forcemerge", this);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
|||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
|
@ -56,8 +55,7 @@ import static org.elasticsearch.rest.RestRequest.Method.HEAD;
|
|||
*/
|
||||
public class RestGetAliasesAction extends BaseRestHandler {
|
||||
|
||||
public RestGetAliasesAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestGetAliasesAction(final RestController controller) {
|
||||
controller.registerHandler(GET, "/_alias", this);
|
||||
controller.registerHandler(GET, "/_aliases", this);
|
||||
controller.registerHandler(GET, "/_alias/{name}", this);
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.support.IndicesOptions;
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -51,8 +50,7 @@ public class RestGetFieldMappingAction extends BaseRestHandler {
|
|||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using include_type_name in get " +
|
||||
"field mapping requests is deprecated. The parameter will be removed in the next major version.";
|
||||
|
||||
public RestGetFieldMappingAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestGetFieldMappingAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_mapping/field/{fields}", this);
|
||||
controller.registerHandler(GET, "/_mapping/{type}/field/{fields}", this);
|
||||
controller.registerHandler(GET, "/{index}/_mapping/field/{fields}", this);
|
||||
|
|
|
@ -54,8 +54,7 @@ public class RestGetIndexTemplateAction extends BaseRestHandler {
|
|||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" +
|
||||
" Specifying include_type_name in get index template requests is deprecated.";
|
||||
|
||||
public RestGetIndexTemplateAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestGetIndexTemplateAction(final RestController controller) {
|
||||
controller.registerHandler(GET, "/_template", this);
|
||||
controller.registerHandler(GET, "/_template/{name}", this);
|
||||
controller.registerHandler(HEAD, "/_template/{name}", this);
|
||||
|
|
|
@ -54,10 +54,7 @@ public class RestGetIndicesAction extends BaseRestHandler {
|
|||
.unmodifiableSet(Stream.concat(Collections.singleton(INCLUDE_TYPE_NAME_PARAMETER).stream(), Settings.FORMAT_PARAMS.stream())
|
||||
.collect(Collectors.toSet()));
|
||||
|
||||
public RestGetIndicesAction(
|
||||
final Settings settings,
|
||||
final RestController controller) {
|
||||
super(settings);
|
||||
public RestGetIndicesAction(final RestController controller) {
|
||||
controller.registerHandler(GET, "/{index}", this);
|
||||
controller.registerHandler(HEAD, "/{index}", this);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.elasticsearch.common.Strings;
|
|||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.indices.TypeMissingException;
|
||||
|
@ -63,8 +62,7 @@ public class RestGetMappingAction extends BaseRestHandler {
|
|||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using include_type_name in get" +
|
||||
" mapping requests is deprecated. The parameter will be removed in the next major version.";
|
||||
|
||||
public RestGetMappingAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestGetMappingAction(final RestController controller) {
|
||||
controller.registerHandler(GET, "/_mapping", this);
|
||||
controller.registerHandler(GET, "/_mappings", this);
|
||||
controller.registerHandler(GET, "/{index}/{type}/_mapping", this);
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -35,8 +34,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
|
||||
public class RestGetSettingsAction extends BaseRestHandler {
|
||||
|
||||
public RestGetSettingsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestGetSettingsAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_settings", this);
|
||||
controller.registerHandler(GET, "/_settings/{name}", this);
|
||||
controller.registerHandler(GET, "/{index}/_settings", this);
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
|
|||
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -33,8 +32,8 @@ import java.io.IOException;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestIndexDeleteAliasesAction extends BaseRestHandler {
|
||||
public RestIndexDeleteAliasesAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestIndexDeleteAliasesAction(RestController controller) {
|
||||
controller.registerHandler(DELETE, "/{index}/_alias/{name}", this);
|
||||
controller.registerHandler(DELETE, "/{index}/_aliases/{name}", this);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
|
|||
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -36,8 +35,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestIndexPutAliasAction extends BaseRestHandler {
|
||||
public RestIndexPutAliasAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestIndexPutAliasAction(RestController controller) {
|
||||
controller.registerHandler(PUT, "/{index}/_alias/{name}", this);
|
||||
controller.registerHandler(PUT, "/_alias/{name}", this);
|
||||
controller.registerHandler(PUT, "/{index}/_aliases/{name}", this);
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.indices;
|
|||
|
||||
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -39,8 +38,7 @@ public class RestIndicesAliasesAction extends BaseRestHandler {
|
|||
return "indices_aliases_action";
|
||||
}
|
||||
|
||||
public RestIndicesAliasesAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestIndicesAliasesAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_aliases", this);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -34,8 +33,8 @@ import java.io.IOException;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestIndicesSegmentsAction extends BaseRestHandler {
|
||||
public RestIndicesSegmentsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestIndicesSegmentsAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_segments", this);
|
||||
controller.registerHandler(GET, "/{index}/_segments", this);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresResponse;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -43,8 +42,8 @@ import static org.elasticsearch.rest.RestStatus.OK;
|
|||
* Rest action for {@link IndicesShardStoresAction}
|
||||
*/
|
||||
public class RestIndicesShardStoresAction extends BaseRestHandler {
|
||||
public RestIndicesShardStoresAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestIndicesShardStoresAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_shard_stores", this);
|
||||
controller.registerHandler(GET, "/{index}/_shard_stores", this);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -43,8 +42,8 @@ import java.util.function.Consumer;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestIndicesStatsAction extends BaseRestHandler {
|
||||
public RestIndicesStatsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestIndicesStatsAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_stats", this);
|
||||
controller.registerHandler(GET, "/_stats/{metric}", this);
|
||||
controller.registerHandler(GET, "/{index}/_stats", this);
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.support.ActiveShardCount;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -33,8 +32,8 @@ import org.elasticsearch.rest.action.RestToXContentListener;
|
|||
import java.io.IOException;
|
||||
|
||||
public class RestOpenIndexAction extends BaseRestHandler {
|
||||
public RestOpenIndexAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestOpenIndexAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.POST, "/_open", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_open", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateReque
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
|
@ -44,8 +43,7 @@ public class RestPutIndexTemplateAction extends BaseRestHandler {
|
|||
" Specifying include_type_name in put index template requests is deprecated."+
|
||||
" The parameter will be removed in the next major version.";
|
||||
|
||||
public RestPutIndexTemplateAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestPutIndexTemplateAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/_template/{name}", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/_template/{name}", this);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.support.IndicesOptions;
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
|
@ -47,8 +46,7 @@ public class RestPutMappingAction extends BaseRestHandler {
|
|||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using include_type_name in put " +
|
||||
"mapping requests is deprecated. The parameter will be removed in the next major version.";
|
||||
|
||||
public RestPutMappingAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestPutMappingAction(RestController controller) {
|
||||
controller.registerHandler(PUT, "/{index}/_mapping/", this);
|
||||
controller.registerHandler(PUT, "/{index}/{type}/_mapping", this);
|
||||
controller.registerHandler(PUT, "/{index}/_mapping/{type}", this);
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.recovery.RecoveryRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -37,8 +36,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
* REST handler to report on index recoveries.
|
||||
*/
|
||||
public class RestRecoveryAction extends BaseRestHandler {
|
||||
public RestRecoveryAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestRecoveryAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_recovery", this);
|
||||
controller.registerHandler(GET, "/{index}/_recovery", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -37,8 +36,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestRefreshAction extends BaseRestHandler {
|
||||
public RestRefreshAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestRefreshAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_refresh", this);
|
||||
controller.registerHandler(POST, "/{index}/_refresh", this);
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.support.ActiveShardCount;
|
|||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Booleans;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -40,8 +39,7 @@ public abstract class RestResizeHandler extends BaseRestHandler {
|
|||
private static final Logger logger = LogManager.getLogger(RestResizeHandler.class);
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
RestResizeHandler(final Settings settings) {
|
||||
super(settings);
|
||||
RestResizeHandler() {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,8 +78,7 @@ public abstract class RestResizeHandler extends BaseRestHandler {
|
|||
|
||||
public static class RestShrinkIndexAction extends RestResizeHandler {
|
||||
|
||||
public RestShrinkIndexAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestShrinkIndexAction(final RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_shrink/{target}", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_shrink/{target}", this);
|
||||
}
|
||||
|
@ -100,8 +97,7 @@ public abstract class RestResizeHandler extends BaseRestHandler {
|
|||
|
||||
public static class RestSplitIndexAction extends RestResizeHandler {
|
||||
|
||||
public RestSplitIndexAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestSplitIndexAction(final RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_split/{target}", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_split/{target}", this);
|
||||
}
|
||||
|
@ -120,8 +116,7 @@ public abstract class RestResizeHandler extends BaseRestHandler {
|
|||
|
||||
public static class RestCloneIndexAction extends RestResizeHandler {
|
||||
|
||||
public RestCloneIndexAction(final Settings settings, final RestController controller) {
|
||||
super(settings);
|
||||
public RestCloneIndexAction(final RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_clone/{target}", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_clone/{target}", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverRequest;
|
|||
import org.elasticsearch.action.support.ActiveShardCount;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -37,8 +36,8 @@ public class RestRolloverIndexAction extends BaseRestHandler {
|
|||
LogManager.getLogger(RestRolloverIndexAction.class));
|
||||
public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using include_type_name in rollover " +
|
||||
"index requests is deprecated. The parameter will be removed in the next major version.";
|
||||
public RestRolloverIndexAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestRolloverIndexAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_rollover", this);
|
||||
controller.registerHandler(RestRequest.Method.POST, "/{index}/_rollover/{new_index}", this);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.flush.SyncedFlushResponse;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
|
@ -39,8 +38,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestSyncedFlushAction extends BaseRestHandler {
|
||||
public RestSyncedFlushAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestSyncedFlushAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_flush/synced", this);
|
||||
controller.registerHandler(POST, "/{index}/_flush/synced", this);
|
||||
|
||||
|
|
|
@ -36,8 +36,7 @@ import static org.elasticsearch.client.Requests.updateSettingsRequest;
|
|||
|
||||
public class RestUpdateSettingsAction extends BaseRestHandler {
|
||||
|
||||
public RestUpdateSettingsAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestUpdateSettingsAction(RestController controller) {
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_settings", this);
|
||||
controller.registerHandler(RestRequest.Method.PUT, "/_settings", this);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -34,8 +33,8 @@ import java.io.IOException;
|
|||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestUpgradeAction extends BaseRestHandler {
|
||||
public RestUpgradeAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
||||
public RestUpgradeAction(RestController controller) {
|
||||
controller.registerHandler(POST, "/_upgrade", this);
|
||||
controller.registerHandler(POST, "/{index}/_upgrade", this);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequest;
|
|||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
|
@ -35,8 +34,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|||
|
||||
public class RestUpgradeStatusAction extends BaseRestHandler {
|
||||
|
||||
public RestUpgradeStatusAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
public RestUpgradeStatusAction(RestController controller) {
|
||||
controller.registerHandler(GET, "/_upgrade", this);
|
||||
controller.registerHandler(GET, "/{index}/_upgrade", this);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue