Skip to content

Commit

Permalink
Rename ILM, ILM endpoints and drop _xpack (#32564)
Browse files Browse the repository at this point in the history
This commit does the following:
 - renames index-lifecycle plugin to ilm
 - modifies the endpoints to ilm instead of index_lifecycle
 - drops _xpack from the endpoints
 - drops a few duplicate endpoints
  • Loading branch information
jasontedor committed Aug 17, 2018
1 parent 2cb3d45 commit 276b2f7
Show file tree
Hide file tree
Showing 94 changed files with 204 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void testSetIndexLifecyclePolicy() throws Exception {
" }\n" +
"}";
HttpEntity entity = new NStringEntity(jsonString, ContentType.APPLICATION_JSON);
Request request = new Request("PUT", "/_xpack/index_lifecycle/" + policy);
Request request = new Request("PUT", "/_ilm/" + policy);
request.setEntity(entity);
client().performRequest(request);

Expand Down
2 changes: 1 addition & 1 deletion x-pack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ subprojects {
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-core:${version}": xpackModule('core')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-deprecation:${version}": xpackModule('deprecation')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-graph:${version}": xpackModule('graph')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-index-lifecycle:${version}": xpackModule('index-lifecycle')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ilm:${version}": xpackModule('ilm')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-logstash:${version}": xpackModule('logstash')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ml:${version}": xpackModule('ml')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-monitoring:${version}": xpackModule('monitoring')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.core;

import org.elasticsearch.common.network.NetworkModule;
Expand Down Expand Up @@ -74,7 +75,7 @@ private XPackSettings() {
/**
* Setting for enabling or disabling the index lifecycle extension. Defaults to true.
*/
public static final Setting<Boolean> INDEX_LIFECYCLE_ENABLED = Setting.boolSetting("xpack.index_lifecycle.enabled", true,
public static final Setting<Boolean> INDEX_LIFECYCLE_ENABLED = Setting.boolSetting("xpack.ilm.enabled", true,
Setting.Property.NodeScope);

/** Setting for enabling or disabling TLS. Defaults to false. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.core.indexlifecycle.action;

import org.elasticsearch.action.Action;
Expand All @@ -19,7 +20,7 @@

public class DeleteLifecycleAction extends Action<DeleteLifecycleAction.Response> {
public static final DeleteLifecycleAction INSTANCE = new DeleteLifecycleAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/delete";
public static final String NAME = "cluster:admin/ilm/delete";

protected DeleteLifecycleAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class ExplainLifecycleAction extends Action<ExplainLifecycleAction.Response> {
public static final ExplainLifecycleAction INSTANCE = new ExplainLifecycleAction();
public static final String NAME = "indices:admin/xpack/index_lifecycle/explain";
public static final String NAME = "indices:admin/ilm/explain";

protected ExplainLifecycleAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.core.indexlifecycle.action;

import org.elasticsearch.action.Action;
Expand All @@ -23,7 +24,7 @@

public class GetLifecycleAction extends Action<GetLifecycleAction.Response> {
public static final GetLifecycleAction INSTANCE = new GetLifecycleAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/get";
public static final String NAME = "cluster:admin/ilm/get";

protected GetLifecycleAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.core.indexlifecycle.action;

import org.elasticsearch.action.Action;
Expand All @@ -21,7 +22,7 @@

public class GetStatusAction extends Action<GetStatusAction.Response> {
public static final GetStatusAction INSTANCE = new GetStatusAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/operation_mode/get";
public static final String NAME = "cluster:admin/ilm/operation_mode/get";

protected GetStatusAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class MoveToStepAction extends Action<MoveToStepAction.Response> {
public static final MoveToStepAction INSTANCE = new MoveToStepAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/_move/post";
public static final String NAME = "cluster:admin/ilm/_move/post";

protected MoveToStepAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class PutLifecycleAction extends Action<PutLifecycleAction.Response> {
public static final PutLifecycleAction INSTANCE = new PutLifecycleAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/put";
public static final String NAME = "cluster:admin/ilm/put";

protected PutLifecycleAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.core.indexlifecycle.action;

import org.elasticsearch.action.Action;
Expand All @@ -19,7 +20,7 @@

public class PutOperationModeAction extends Action<PutOperationModeAction.Response> {
public static final PutOperationModeAction INSTANCE = new PutOperationModeAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/operation_mode/set";
public static final String NAME = "cluster:admin/ilm/operation_mode/set";

protected PutOperationModeAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

public class RemovePolicyForIndexAction extends Action<RemovePolicyForIndexAction.Response> {
public static final RemovePolicyForIndexAction INSTANCE = new RemovePolicyForIndexAction();
public static final String NAME = "indices:admin/xpack/index_lifecycle/remove_policy";
public static final String NAME = "indices:admin/ilm/remove_policy";

protected RemovePolicyForIndexAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*
*/

package org.elasticsearch.xpack.core.indexlifecycle.action;

import org.elasticsearch.action.Action;
Expand All @@ -23,7 +23,7 @@

public class RetryAction extends Action<RetryAction.Response> {
public static final RetryAction INSTANCE = new RetryAction();
public static final String NAME = "indices:admin/xpack/index_lifecycle/retry";
public static final String NAME = "indices:admin/ilm/retry";

protected RetryAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class SetIndexLifecyclePolicyAction extends Action<SetIndexLifecyclePolicyResponse> {

public static final SetIndexLifecyclePolicyAction INSTANCE = new SetIndexLifecyclePolicyAction();
public static final String NAME = "indices:admin/xpack/index_lifecycle/set_index_policy";
public static final String NAME = "indices:admin/ilm/set_index_policy";

protected SetIndexLifecyclePolicyAction() {
super(NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'

esplugin {
name 'x-pack-index-lifecycle'
description 'Elasticsearch Expanded Pack Plugin - Index Lifecycle'
name 'x-pack-ilm'
description 'Elasticsearch Expanded Pack Plugin - Index Lifecycle Management'
classname 'org.elasticsearch.xpack.indexlifecycle.IndexLifecycle'
extendedPlugins = ['x-pack-core']
hasNativeController false
requiresKeystore true
}
archivesBaseName = 'x-pack-index-lifecycle'
archivesBaseName = 'x-pack-ilm'

dependencies {
compileOnly project(path: xpackModule('core'), configuration: 'shadow')
Expand All @@ -19,12 +19,12 @@ dependencies {

integTestCluster {
numNodes = 2
clusterName = 'index-lifecycle'
clusterName = 'ilm'
setting 'xpack.security.enabled', 'false'
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'
setting 'xpack.index_lifecycle.enabled', 'true'
setting 'xpack.ilm.enabled', 'true'
setting 'indices.lifecycle.poll_interval', '500ms'
module project(xpackModule('core'))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle;

import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@

public class IndexLifecycle extends Plugin implements ActionPlugin {
public static final String NAME = "index_lifecycle";
public static final String BASE_PATH = "/_xpack/index_lifecycle/";
private final SetOnce<IndexLifecycleService> indexLifecycleInitialisationService = new SetOnce<>();
private Settings settings;
private boolean enabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package org.elasticsearch.xpack.indexlifecycle;

import com.carrotsearch.hppc.cursors.ObjectCursor;

import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.support.TransportAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle;

import org.elasticsearch.ElasticsearchException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle;

import org.elasticsearch.common.unit.TimeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle.action;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -12,21 +13,19 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.indexlifecycle.action.DeleteLifecycleAction;
import org.elasticsearch.xpack.indexlifecycle.IndexLifecycle;

import java.io.IOException;

public class RestDeleteLifecycleAction extends BaseRestHandler {

public RestDeleteLifecycleAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.DELETE,
IndexLifecycle.BASE_PATH + "{name}", this);
controller.registerHandler(RestRequest.Method.DELETE, "/_ilm/{name}", this);
}

@Override
public String getName() {
return "xpack_lifecycle_delete_action";
return "ilm_delete_action";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle.action;

import org.elasticsearch.action.support.IndicesOptions;
Expand All @@ -14,21 +15,19 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.indexlifecycle.action.ExplainLifecycleAction;
import org.elasticsearch.xpack.indexlifecycle.IndexLifecycle;

import java.io.IOException;

public class RestExplainLifecycleAction extends BaseRestHandler {

public RestExplainLifecycleAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET, "_" + IndexLifecycle.NAME + "/explain", this);
controller.registerHandler(RestRequest.Method.GET, "{index}/_" + IndexLifecycle.NAME + "/explain", this);
controller.registerHandler(RestRequest.Method.GET, "/{index}/_ilm/explain", this);
}

@Override
public String getName() {
return "xpack_lifecycle_explain_action";
return "ilm_explain_action";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle.action;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -13,21 +14,20 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.indexlifecycle.action.GetLifecycleAction;
import org.elasticsearch.xpack.indexlifecycle.IndexLifecycle;

import java.io.IOException;

public class RestGetLifecycleAction extends BaseRestHandler {

public RestGetLifecycleAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET, IndexLifecycle.BASE_PATH, this);
controller.registerHandler(RestRequest.Method.GET, IndexLifecycle.BASE_PATH + "{name}", this);
controller.registerHandler(RestRequest.Method.GET, "/_ilm", this);
controller.registerHandler(RestRequest.Method.GET, "/_ilm/{name}", this);
}

@Override
public String getName() {
return "xpack_lifecycle_get_action";
return "ilm_get_action";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.indexlifecycle.action;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -12,19 +13,17 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.indexlifecycle.action.GetStatusAction;
import org.elasticsearch.xpack.indexlifecycle.IndexLifecycle;

public class RestGetStatusAction extends BaseRestHandler {

public RestGetStatusAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET,
IndexLifecycle.BASE_PATH + "_status", this);
controller.registerHandler(RestRequest.Method.GET, "/_ilm/status", this);
}

@Override
public String getName() {
return "xpack_lifecycle_get_operation_mode_action";
return "ilm_get_operation_mode_action";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*
*/

package org.elasticsearch.xpack.indexlifecycle.action;

import org.elasticsearch.client.node.NodeClient;
Expand All @@ -14,20 +15,19 @@
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.indexlifecycle.action.MoveToStepAction;
import org.elasticsearch.xpack.indexlifecycle.IndexLifecycle;

import java.io.IOException;

public class RestMoveToStepAction extends BaseRestHandler {

public RestMoveToStepAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.POST, IndexLifecycle.BASE_PATH + "_move/{name}", this);
controller.registerHandler(RestRequest.Method.POST,"/_ilm/move/{name}", this);
}

@Override
public String getName() {
return "xpack_lifecycle_move_to_step_action";
return "ilm_move_to_step_action";
}

@Override
Expand Down
Loading

0 comments on commit 276b2f7

Please sign in to comment.