|
@@ -5,9 +5,13 @@
|
|
|
*/
|
|
|
package org.elasticsearch.xpack.upgrade.rest;
|
|
|
|
|
|
+
|
|
|
+import org.apache.logging.log4j.LogManager;
|
|
|
+import org.apache.logging.log4j.Logger;
|
|
|
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.protocol.xpack.migration.IndexUpgradeInfoRequest;
|
|
|
import org.elasticsearch.rest.BaseRestHandler;
|
|
@@ -18,22 +22,31 @@ import org.elasticsearch.xpack.core.upgrade.actions.IndexUpgradeInfoAction;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
+import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|
|
+
|
|
|
public class RestIndexUpgradeInfoAction extends BaseRestHandler {
|
|
|
+ private static final Logger logger = LogManager.getLogger(RestIndexUpgradeInfoAction.class);
|
|
|
+ private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
|
|
|
|
|
public RestIndexUpgradeInfoAction(Settings settings, RestController controller) {
|
|
|
super(settings);
|
|
|
- controller.registerHandler(RestRequest.Method.GET, "/_xpack/migration/assistance", this);
|
|
|
- controller.registerHandler(RestRequest.Method.GET, "/_xpack/migration/assistance/{index}", this);
|
|
|
+ controller.registerWithDeprecatedHandler(
|
|
|
+ GET, "_migration/assistance", this,
|
|
|
+ GET, "/_xpack/migration/assistance", deprecationLogger);
|
|
|
+
|
|
|
+ controller.registerWithDeprecatedHandler(
|
|
|
+ GET, "_migration/assistance/{index}", this,
|
|
|
+ GET, "/_xpack/migration/assistance/{index}", deprecationLogger);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getName() {
|
|
|
- return "xpack_migration_assistance";
|
|
|
+ return "migration_assistance";
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
|
|
|
- if (request.method().equals(RestRequest.Method.GET)) {
|
|
|
+ if (request.method().equals(GET)) {
|
|
|
return handleGet(request, client);
|
|
|
} else {
|
|
|
throw new IllegalArgumentException("illegal method [" + request.method() + "] for request [" + request.path() + "]");
|