Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove deprecated endpoints containing _xpack. #48170

Merged
merged 5 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/reference/migration/migrate_8_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ Indices created in Elasticsearch 6.x or before will need to be reindexed with
Elasticsearch 7.x in order to be readable by Elasticsearch 8.x.

=========================================

[float]
==== REST endpoints containing `_xpack`

In 7.0, we deprecated REST endpoints that contain `_xpack` in their path. These
endpoints are now removed in 8.0. Each endpoint that was deprecated and removed
is replaced with a new endpoint that does not contain `_xpack`. As an example,
`/{index}/_xpack/graph/_explore` is replaced by `/{index}/_graph/explore`.


// end::notable-breaking-changes[]

include::migrate_8_0/analysis.asciidoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
Expand All @@ -21,13 +19,8 @@

public class RestDeleteLicenseAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteLicenseAction.class));

RestDeleteLicenseAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
DELETE, "/_license", this,
DELETE, "/_xpack/license", deprecationLogger);
controller.registerHandler(DELETE, "/_license", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -18,13 +16,8 @@

public class RestGetBasicStatus extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetBasicStatus.class));

RestGetBasicStatus(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
GET, "/_license/basic_status", this,
GET, "/_xpack/license/basic_status", deprecationLogger);
controller.registerHandler(GET, "/_license/basic_status", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.protocol.xpack.license.GetLicenseRequest;
Expand All @@ -29,13 +27,8 @@

public class RestGetLicenseAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetLicenseAction.class));

RestGetLicenseAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
GET, "/_license", this,
GET, "/_xpack/license", deprecationLogger);
controller.registerHandler(GET, "/_license", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -18,13 +16,8 @@

public class RestGetTrialStatus extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetTrialStatus.class));

RestGetTrialStatus(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
GET, "/_license/trial_status", this,
GET, "/_xpack/license/trial_status", deprecationLogger);
controller.registerHandler(GET, "/_license/trial_status", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -20,13 +18,8 @@

public class RestPostStartBasicLicense extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartBasicLicense.class));

RestPostStartBasicLicense(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
POST, "/_license/start_basic", this,
POST, "/_xpack/license/start_basic", deprecationLogger);
controller.registerHandler(POST, "/_license/start_basic", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
Expand All @@ -24,13 +22,8 @@

public class RestPostStartTrialLicense extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartTrialLicense.class));

RestPostStartTrialLicense(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
POST, "/_license/start_trial", this,
POST, "/_xpack/license/start_trial", deprecationLogger);
controller.registerHandler(POST, "/_license/start_trial", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

package org.elasticsearch.license;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -21,18 +19,10 @@

public class RestPutLicenseAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutLicenseAction.class));

RestPutLicenseAction(RestController controller) {
// TODO: remove POST endpoint?
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
POST, "/_license", this,
POST, "/_xpack/license", deprecationLogger);
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
PUT, "/_license", this,
PUT, "/_xpack/license", deprecationLogger);
controller.registerHandler(POST, "/_license", this);
controller.registerHandler(PUT, "/_license", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
*/
package org.elasticsearch.xpack.core.ssl.rest;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
Expand All @@ -27,14 +25,8 @@
*/
public class RestGetCertificateInfoAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(LogManager.getLogger(RestGetCertificateInfoAction.class));

public RestGetCertificateInfoAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
GET, "/_ssl/certificates", this,
GET, "/_xpack/ssl/certificates", deprecationLogger);
controller.registerHandler(GET, "/_ssl/certificates", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.apache.logging.log4j.Logger;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -21,15 +20,10 @@

public class RestDeprecationInfoAction extends BaseRestHandler {
private static final Logger logger = LogManager.getLogger(RestDeprecationInfoAction.class);
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);

public RestDeprecationInfoAction(RestController controller) {
controller.registerWithDeprecatedHandler(
RestRequest.Method.GET, "/_migration/deprecations", this,
RestRequest.Method.GET, "/_xpack/migration/deprecations", deprecationLogger);
controller.registerWithDeprecatedHandler(
RestRequest.Method.GET, "/{index}/_migration/deprecations", this,
RestRequest.Method.GET, "/{index}/_xpack/migration/deprecations", deprecationLogger);
controller.registerHandler(RestRequest.Method.GET, "/_migration/deprecations", this);
controller.registerHandler(RestRequest.Method.GET, "/{index}/_migration/deprecations", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

package org.elasticsearch.xpack.graph.rest.action;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest;
Expand All @@ -39,8 +37,6 @@
*/
public class RestGraphAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGraphAction.class));

public static final ParseField TIMEOUT_FIELD = new ParseField("timeout");
public static final ParseField SIGNIFICANCE_FIELD = new ParseField("use_significance");
public static final ParseField RETURN_DETAILED_INFO = new ParseField("return_detailed_stats");
Expand All @@ -61,14 +57,8 @@ public class RestGraphAction extends BaseRestHandler {
public static final ParseField TERM_FIELD = new ParseField("term");

public RestGraphAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
GET, "/{index}/_graph/explore", this,
GET, "/{index}/_xpack/graph/_explore", deprecationLogger);
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
POST, "/{index}/_graph/explore", this,
POST, "/{index}/_xpack/graph/_explore", deprecationLogger);
controller.registerHandler(GET, "/{index}/_graph/explore", this);
controller.registerHandler(POST, "/{index}/_graph/explore", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
*/
package org.elasticsearch.xpack.monitoring.rest.action;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
Expand Down Expand Up @@ -39,16 +36,11 @@ public class RestMonitoringBulkAction extends BaseRestHandler {
public static final String MONITORING_ID = "system_id";
public static final String MONITORING_VERSION = "system_api_version";
public static final String INTERVAL = "interval";
private static final Logger logger = LogManager.getLogger(RestMonitoringBulkAction.class);
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
private final Map<MonitoredSystem, List<String>> supportedApiVersions;

public RestMonitoringBulkAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(POST, "/_monitoring/bulk", this,
POST, "/_xpack/monitoring/_bulk", deprecationLogger);
controller.registerWithDeprecatedHandler(PUT, "/_monitoring/bulk", this,
PUT, "/_xpack/monitoring/_bulk", deprecationLogger);
controller.registerHandler(POST, "/_monitoring/bulk", this);
controller.registerHandler(PUT, "/_monitoring/bulk", this);

final List<String> allVersions = Arrays.asList(
MonitoringTemplateUtils.TEMPLATE_VERSION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

package org.elasticsearch.xpack.rollup.rest;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -21,15 +19,10 @@

public class RestDeleteRollupJobAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteRollupJobAction.class));

public static final ParseField ID = new ParseField("id");

public RestDeleteRollupJobAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
DELETE, "/_rollup/job/{id}", this,
DELETE, "/_xpack/rollup/job/{id}/", deprecationLogger);
controller.registerHandler(DELETE, "/_rollup/job/{id}", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

package org.elasticsearch.xpack.rollup.rest;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
Expand All @@ -20,15 +18,10 @@

public class RestGetRollupCapsAction extends BaseRestHandler {

private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupCapsAction.class));

public static final ParseField ID = new ParseField("id");

public RestGetRollupCapsAction(RestController controller) {
// TODO: remove deprecated endpoint in 8.0.0
controller.registerWithDeprecatedHandler(
GET, "/_rollup/data/{id}", this,
GET, "/_xpack/rollup/data/{id}/", deprecationLogger);
controller.registerHandler(GET, "/_rollup/data/{id}", this);
}

@Override
Expand Down
Loading