mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-24 17:09:48 +00:00
Remove DeprecationLogger from route objects (#52285)
This commit removes the need for DeprecatedRoute and ReplacedRoute to have an instance of a DeprecationLogger. Instead the RestController now has a DeprecationLogger that will be used for all deprecated and replaced route messages. Relates #51950 Backport of #52278
This commit is contained in:
parent
8c930a9960
commit
5bcc6fce5c
@ -84,7 +84,7 @@ public class TestDeprecationHeaderRestAction extends BaseRestHandler {
|
||||
@Override
|
||||
public List<DeprecatedRoute> deprecatedRoutes() {
|
||||
return singletonList(
|
||||
new DeprecatedRoute(GET, "/_test_cluster/deprecated_settings", DEPRECATED_ENDPOINT, deprecationLogger));
|
||||
new DeprecatedRoute(GET, "/_test_cluster/deprecated_settings", DEPRECATED_ENDPOINT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,6 +64,7 @@ import static org.elasticsearch.rest.RestStatus.OK;
|
||||
public class RestController implements HttpServerTransport.Dispatcher {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RestController.class);
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
private final PathTrie<MethodHandlers> handlers = new PathTrie<>(RestUtils.REST_DECODER);
|
||||
|
||||
@ -96,13 +97,11 @@ public class RestController implements HttpServerTransport.Dispatcher {
|
||||
* @param path Path to handle (e.g., "/{index}/{type}/_bulk")
|
||||
* @param handler The handler to actually execute
|
||||
* @param deprecationMessage The message to log and send as a header in the response
|
||||
* @param logger The existing deprecation logger to use
|
||||
*/
|
||||
protected void registerAsDeprecatedHandler(RestRequest.Method method, String path, RestHandler handler,
|
||||
String deprecationMessage, DeprecationLogger logger) {
|
||||
protected void registerAsDeprecatedHandler(RestRequest.Method method, String path, RestHandler handler, String deprecationMessage) {
|
||||
assert (handler instanceof DeprecationRestHandler) == false;
|
||||
|
||||
registerHandler(method, path, new DeprecationRestHandler(handler, deprecationMessage, logger));
|
||||
registerHandler(method, path, new DeprecationRestHandler(handler, deprecationMessage, deprecationLogger));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,17 +127,15 @@ public class RestController implements HttpServerTransport.Dispatcher {
|
||||
* @param handler The handler to actually execute
|
||||
* @param deprecatedMethod GET, POST, etc.
|
||||
* @param deprecatedPath <em>Deprecated</em> path to handle (e.g., "/_optimize")
|
||||
* @param logger The existing deprecation logger to use
|
||||
*/
|
||||
protected void registerWithDeprecatedHandler(RestRequest.Method method, String path, RestHandler handler,
|
||||
RestRequest.Method deprecatedMethod, String deprecatedPath,
|
||||
DeprecationLogger logger) {
|
||||
RestRequest.Method deprecatedMethod, String deprecatedPath) {
|
||||
// e.g., [POST /_optimize] is deprecated! Use [POST /_forcemerge] instead.
|
||||
final String deprecationMessage =
|
||||
"[" + deprecatedMethod.name() + " " + deprecatedPath + "] is deprecated! Use [" + method.name() + " " + path + "] instead.";
|
||||
|
||||
registerHandler(method, path, handler);
|
||||
registerAsDeprecatedHandler(deprecatedMethod, deprecatedPath, handler, deprecationMessage, logger);
|
||||
registerAsDeprecatedHandler(deprecatedMethod, deprecatedPath, handler, deprecationMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,9 +161,9 @@ public class RestController implements HttpServerTransport.Dispatcher {
|
||||
public void registerHandler(final RestHandler restHandler) {
|
||||
restHandler.routes().forEach(route -> registerHandler(route.getMethod(), route.getPath(), restHandler));
|
||||
restHandler.deprecatedRoutes().forEach(route ->
|
||||
registerAsDeprecatedHandler(route.getMethod(), route.getPath(), restHandler, route.getDeprecationMessage(), route.getLogger()));
|
||||
registerAsDeprecatedHandler(route.getMethod(), route.getPath(), restHandler, route.getDeprecationMessage()));
|
||||
restHandler.replacedRoutes().forEach(route -> registerWithDeprecatedHandler(route.getMethod(), route.getPath(),
|
||||
restHandler, route.getDeprecatedMethod(), route.getDeprecatedPath(), route.getLogger()));
|
||||
restHandler, route.getDeprecatedMethod(), route.getDeprecatedPath()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,7 +20,6 @@
|
||||
package org.elasticsearch.rest;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContent;
|
||||
import org.elasticsearch.rest.RestRequest.Method;
|
||||
|
||||
@ -115,21 +114,15 @@ public interface RestHandler {
|
||||
class DeprecatedRoute extends Route {
|
||||
|
||||
private final String deprecationMessage;
|
||||
private final DeprecationLogger logger;
|
||||
|
||||
public DeprecatedRoute(Method method, String path, String deprecationMessage, DeprecationLogger logger) {
|
||||
public DeprecatedRoute(Method method, String path, String deprecationMessage) {
|
||||
super(method, path);
|
||||
this.deprecationMessage = deprecationMessage;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public String getDeprecationMessage() {
|
||||
return deprecationMessage;
|
||||
}
|
||||
|
||||
public DeprecationLogger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,13 +133,11 @@ public interface RestHandler {
|
||||
|
||||
private final String deprecatedPath;
|
||||
private final Method deprecatedMethod;
|
||||
private final DeprecationLogger logger;
|
||||
|
||||
public ReplacedRoute(Method method, String path, Method deprecatedMethod, String deprecatedPath, DeprecationLogger logger) {
|
||||
public ReplacedRoute(Method method, String path, Method deprecatedMethod, String deprecatedPath) {
|
||||
super(method, path);
|
||||
this.deprecatedMethod = deprecatedMethod;
|
||||
this.deprecatedPath = deprecatedPath;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public String getDeprecatedPath() {
|
||||
@ -156,9 +147,5 @@ public interface RestHandler {
|
||||
public Method getDeprecatedMethod() {
|
||||
return deprecatedMethod;
|
||||
}
|
||||
|
||||
public DeprecationLogger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||
@ -179,12 +178,11 @@ public class RestControllerTests extends ESTestCase {
|
||||
String path = "/_" + randomAlphaOfLengthBetween(1, 6);
|
||||
RestHandler handler = mock(RestHandler.class);
|
||||
String deprecationMessage = randomAlphaOfLengthBetween(1, 10);
|
||||
DeprecationLogger logger = mock(DeprecationLogger.class);
|
||||
|
||||
// don't want to test everything -- just that it actually wraps the handler
|
||||
doCallRealMethod().when(controller).registerAsDeprecatedHandler(method, path, handler, deprecationMessage, logger);
|
||||
doCallRealMethod().when(controller).registerAsDeprecatedHandler(method, path, handler, deprecationMessage);
|
||||
|
||||
controller.registerAsDeprecatedHandler(method, path, handler, deprecationMessage, logger);
|
||||
controller.registerAsDeprecatedHandler(method, path, handler, deprecationMessage);
|
||||
|
||||
verify(controller).registerHandler(eq(method), eq(path), any(DeprecationRestHandler.class));
|
||||
}
|
||||
@ -197,18 +195,17 @@ public class RestControllerTests extends ESTestCase {
|
||||
final RestHandler handler = mock(RestHandler.class);
|
||||
final RestRequest.Method deprecatedMethod = randomFrom(RestRequest.Method.values());
|
||||
final String deprecatedPath = "/_" + randomAlphaOfLengthBetween(1, 6);
|
||||
final DeprecationLogger logger = mock(DeprecationLogger.class);
|
||||
|
||||
final String deprecationMessage = "[" + deprecatedMethod.name() + " " + deprecatedPath + "] is deprecated! Use [" +
|
||||
method.name() + " " + path + "] instead.";
|
||||
|
||||
// don't want to test everything -- just that it actually wraps the handlers
|
||||
doCallRealMethod().when(controller).registerWithDeprecatedHandler(method, path, handler, deprecatedMethod, deprecatedPath, logger);
|
||||
doCallRealMethod().when(controller).registerWithDeprecatedHandler(method, path, handler, deprecatedMethod, deprecatedPath);
|
||||
|
||||
controller.registerWithDeprecatedHandler(method, path, handler, deprecatedMethod, deprecatedPath, logger);
|
||||
controller.registerWithDeprecatedHandler(method, path, handler, deprecatedMethod, deprecatedPath);
|
||||
|
||||
verify(controller).registerHandler(method, path, handler);
|
||||
verify(controller).registerAsDeprecatedHandler(deprecatedMethod, deprecatedPath, handler, deprecationMessage, logger);
|
||||
verify(controller).registerAsDeprecatedHandler(deprecatedMethod, deprecatedPath, handler, deprecationMessage);
|
||||
}
|
||||
|
||||
public void testRegisterSecondMethodWithDifferentNamedWildcard() {
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,8 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteLicenseAction extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteLicenseAction.class));
|
||||
|
||||
RestDeleteLicenseAction() {}
|
||||
|
||||
@Override
|
||||
@ -34,7 +30,7 @@ public class RestDeleteLicenseAction extends XPackRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(DELETE, "/_license", DELETE, URI_BASE + "/license", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(DELETE, "/_license", DELETE, URI_BASE + "/license"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
import org.elasticsearch.xpack.core.XPackClient;
|
||||
@ -21,8 +19,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetBasicStatus extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetBasicStatus.class));
|
||||
|
||||
RestGetBasicStatus() {}
|
||||
|
||||
@Override
|
||||
@ -32,7 +28,7 @@ public class RestGetBasicStatus extends XPackRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/_license/basic_status", GET, URI_BASE + "/license/basic_status", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/_license/basic_status", GET, URI_BASE + "/license/basic_status"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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;
|
||||
@ -31,8 +29,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
|
||||
|
||||
public class RestGetLicenseAction extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetLicenseAction.class));
|
||||
|
||||
RestGetLicenseAction() {}
|
||||
|
||||
@Override
|
||||
@ -42,7 +38,7 @@ public class RestGetLicenseAction extends XPackRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/_license", GET, URI_BASE + "/license", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/_license", GET, URI_BASE + "/license"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
import org.elasticsearch.xpack.core.XPackClient;
|
||||
@ -21,8 +19,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetTrialStatus extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetTrialStatus.class));
|
||||
|
||||
RestGetTrialStatus() {}
|
||||
|
||||
@Override
|
||||
@ -32,7 +28,7 @@ public class RestGetTrialStatus extends XPackRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/_license/trial_status", GET, URI_BASE + "/license/trial_status", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/_license/trial_status", GET, URI_BASE + "/license/trial_status"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestStatusToXContentListener;
|
||||
import org.elasticsearch.xpack.core.XPackClient;
|
||||
@ -22,8 +20,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestPostStartBasicLicense extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartBasicLicense.class));
|
||||
|
||||
RestPostStartBasicLicense() {}
|
||||
|
||||
@Override
|
||||
@ -33,7 +29,7 @@ public class RestPostStartBasicLicense extends XPackRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(POST, "/_license/start_basic", POST, URI_BASE + "/license/start_basic", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(POST, "/_license/start_basic", POST, URI_BASE + "/license/start_basic"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -26,8 +24,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestPostStartTrialLicense extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPostStartTrialLicense.class));
|
||||
|
||||
RestPostStartTrialLicense() {}
|
||||
|
||||
@Override
|
||||
@ -37,7 +33,7 @@ public class RestPostStartTrialLicense extends XPackRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(POST, "/_license/start_trial", POST, URI_BASE + "/license/start_trial", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(POST, "/_license/start_trial", POST, URI_BASE + "/license/start_trial"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
package org.elasticsearch.license;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
import org.elasticsearch.xpack.core.XPackClient;
|
||||
@ -22,8 +20,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutLicenseAction extends XPackRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutLicenseAction.class));
|
||||
|
||||
RestPutLicenseAction() {}
|
||||
|
||||
@Override
|
||||
@ -35,8 +31,8 @@ public class RestPutLicenseAction extends XPackRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return unmodifiableList(asList(
|
||||
// TODO: remove POST endpoint?
|
||||
new ReplacedRoute(POST, "/_license", POST, URI_BASE + "/license", deprecationLogger),
|
||||
new ReplacedRoute(PUT, "/_license", PUT, URI_BASE + "/license", deprecationLogger)));
|
||||
new ReplacedRoute(POST, "/_license", POST, URI_BASE + "/license"),
|
||||
new ReplacedRoute(PUT, "/_license", PUT, URI_BASE + "/license")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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;
|
||||
@ -30,9 +28,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
*/
|
||||
public class RestGetCertificateInfoAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetCertificateInfoAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -40,7 +35,7 @@ public class RestGetCertificateInfoAction extends BaseRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/_ssl/certificates", GET, "/_xpack/ssl/certificates", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/_ssl/certificates", GET, "/_xpack/ssl/certificates"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,9 +37,8 @@ public class RestDeprecationInfoAction extends BaseRestHandler {
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return unmodifiableList(asList(
|
||||
new ReplacedRoute(GET, "/_migration/deprecations", GET, "/_xpack/migration/deprecations", deprecationLogger),
|
||||
new ReplacedRoute(
|
||||
GET, "/{index}/_migration/deprecations", GET, "/{index}/_xpack/migration/deprecations", deprecationLogger)));
|
||||
new ReplacedRoute(GET, "/_migration/deprecations", GET, "/_xpack/migration/deprecations"),
|
||||
new ReplacedRoute(GET, "/{index}/_migration/deprecations", GET, "/{index}/_xpack/migration/deprecations")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,14 +73,14 @@ public class RestGraphAction extends XPackRestHandler {
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return unmodifiableList(asList(
|
||||
new ReplacedRoute(GET, "/{index}/_graph/explore", GET, "/{index}" + URI_BASE + "/graph/_explore", deprecationLogger),
|
||||
new ReplacedRoute(POST, "/{index}/_graph/explore", POST, "/{index}" + URI_BASE + "/graph/_explore", deprecationLogger),
|
||||
new ReplacedRoute(GET, "/{index}/_graph/explore", GET, "/{index}" + URI_BASE + "/graph/_explore"),
|
||||
new ReplacedRoute(POST, "/{index}/_graph/explore", POST, "/{index}" + URI_BASE + "/graph/_explore"),
|
||||
new ReplacedRoute(
|
||||
GET, "/{index}/{type}/_graph/explore",
|
||||
GET, "/{index}/{type}" + URI_BASE + "/graph/_explore", deprecationLogger),
|
||||
GET, "/{index}/{type}" + URI_BASE + "/graph/_explore"),
|
||||
new ReplacedRoute(
|
||||
POST, "/{index}/{type}_graph/explore",
|
||||
POST, "/{index}/{type}" + URI_BASE + "/graph/_explore", deprecationLogger)));
|
||||
POST, "/{index}/{type}" + URI_BASE + "/graph/_explore")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -22,9 +20,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteExpiredDataAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteExpiredDataAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -35,8 +30,7 @@ public class RestDeleteExpiredDataAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "_delete_expired_data",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "_delete_expired_data",
|
||||
deprecationLogger)
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "_delete_expired_data")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -30,9 +28,6 @@ public class RestFindFileStructureAction extends BaseRestHandler {
|
||||
|
||||
private static final TimeValue DEFAULT_TIMEOUT = new TimeValue(25, TimeUnit.SECONDS);
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestFindFileStructureAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -43,8 +38,7 @@ public class RestFindFileStructureAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "find_file_structure",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "find_file_structure",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "find_file_structure")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -22,9 +20,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestMlInfoAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestMlInfoAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -35,8 +30,7 @@ public class RestMlInfoAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "info",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "info",
|
||||
deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "info")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -22,9 +20,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestSetUpgradeModeAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestSetUpgradeModeAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -35,8 +30,7 @@ public class RestSetUpgradeModeAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "set_upgrade_mode",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "set_upgrade_mode",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "set_upgrade_mode")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,9 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteCalendarAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteCalendarAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -36,7 +31,7 @@ public class RestDeleteCalendarAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}", deprecationLogger)
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteCalendarEventAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteCalendarEventAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,7 +34,7 @@ public class RestDeleteCalendarEventAction extends BaseRestHandler {
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events/{" +
|
||||
ScheduledEvent.EVENT_ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events/{" +
|
||||
ScheduledEvent.EVENT_ID.getPreferredName() + "}", deprecationLogger)
|
||||
ScheduledEvent.EVENT_ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteCalendarJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteCalendarJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,7 +34,7 @@ public class RestDeleteCalendarJobAction extends BaseRestHandler {
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/jobs/{" +
|
||||
Job.ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/jobs/{" +
|
||||
Job.ID.getPreferredName() + "}", deprecationLogger)
|
||||
Job.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -26,9 +24,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetCalendarEventsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetCalendarEventsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,7 +34,7 @@ public class RestGetCalendarEventsAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events", deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -28,9 +26,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestGetCalendarsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetCalendarsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -41,13 +36,13 @@ public class RestGetCalendarsAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}", deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "calendars/",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "calendars/", deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "calendars/"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}", deprecationLogger),
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "calendars/",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "calendars/", deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "calendars/")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestPostCalendarEventAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPostCalendarEventAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,7 +32,7 @@ public class RestPostCalendarEventAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events", deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/events")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutCalendarAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPutCalendarAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,7 +32,7 @@ public class RestPutCalendarAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(PUT, MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}",
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}", deprecationLogger)
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.calendar;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutCalendarJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPutCalendarJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -40,8 +35,7 @@ public class RestPutCalendarJobAction extends BaseRestHandler {
|
||||
MachineLearning.BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/jobs/{" + Job.ID.getPreferredName() + "}",
|
||||
PUT,
|
||||
MachineLearning.PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID.getPreferredName() + "}/jobs/{" +
|
||||
Job.ID.getPreferredName() + "}",
|
||||
deprecationLogger)
|
||||
Job.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteDatafeedAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteDatafeedAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,7 +32,7 @@ public class RestDeleteDatafeedAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}", deprecationLogger)
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -25,9 +23,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetDatafeedStatsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetDatafeedStatsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -38,10 +33,9 @@ public class RestGetDatafeedStatsAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_stats",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_stats",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_stats"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "datafeeds/_stats",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/_stats", deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/_stats")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetDatafeedsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetDatafeedsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,9 +32,9 @@ public class RestGetDatafeedsAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}", deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "datafeeds",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds", deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,9 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestPreviewDatafeedAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPreviewDatafeedAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -36,8 +31,7 @@ public class RestPreviewDatafeedAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_preview",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_preview",
|
||||
deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_preview")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutDatafeedAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPutDatafeedAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestPutDatafeedAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(PUT, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}",
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}",
|
||||
deprecationLogger)
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
@ -32,9 +30,6 @@ public class RestStartDatafeedAction extends BaseRestHandler {
|
||||
|
||||
private static final String DEFAULT_START = "0";
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestStartDatafeedAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -45,8 +40,7 @@ public class RestStartDatafeedAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_start",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_start",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_start")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
@ -30,9 +28,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestStopDatafeedAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestStopDatafeedAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -43,8 +38,7 @@ public class RestStopDatafeedAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_stop",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_stop",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_stop")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.datafeeds;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestUpdateDatafeedAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestUpdateDatafeedAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestUpdateDatafeedAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_update",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_update",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}/_update")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.filter;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,9 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteFilterAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteFilterAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -36,8 +31,7 @@ public class RestDeleteFilterAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "filters/{" + Request.FILTER_ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + Request.FILTER_ID.getPreferredName() + "}",
|
||||
deprecationLogger)
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + Request.FILTER_ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.filter;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestStatusToXContentListener;
|
||||
@ -26,9 +24,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetFiltersAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetFiltersAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,11 +34,9 @@ public class RestGetFiltersAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "filters/",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "filters/",
|
||||
deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "filters/")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.filter;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutFilterAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPutFilterAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestPutFilterAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(PUT, MachineLearning.BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}",
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}",
|
||||
deprecationLogger)
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.filter;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestUpdateFilterAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestUpdateFilterAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestUpdateFilterAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}/_update",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}/_update",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID.getPreferredName() + "}/_update")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -25,9 +23,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestCloseJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestCloseJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -38,7 +33,7 @@ public class RestCloseJobAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_close",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_close", deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_close")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -25,9 +23,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteForecastAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteForecastAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return singletonList(
|
||||
@ -41,7 +36,7 @@ public class RestDeleteForecastAction extends BaseRestHandler {
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
|
||||
"}/_forecast/{" + Forecast.FORECAST_ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
|
||||
"}/_forecast/{" + Forecast.FORECAST_ID.getPreferredName() + "}", deprecationLogger)
|
||||
"}/_forecast/{" + Forecast.FORECAST_ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
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;
|
||||
@ -29,9 +27,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -42,7 +37,7 @@ public class RestDeleteJobAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}", deprecationLogger)
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -30,9 +28,6 @@ public class RestFlushJobAction extends BaseRestHandler {
|
||||
private static final String DEFAULT_ADVANCE_TIME = "";
|
||||
private static final String DEFAULT_SKIP_TIME = "";
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestFlushJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -43,8 +38,7 @@ public class RestFlushJobAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_flush",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_flush",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_flush")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestForecastJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestForecastJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestForecastJobAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_forecast",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_forecast",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_forecast")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -26,9 +24,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetJobStatsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetJobStatsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,10 +34,9 @@ public class RestGetJobStatsAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_stats",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_stats",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_stats"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/_stats",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/_stats", deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/_stats")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -26,9 +24,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetJobsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetJobsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,10 +34,9 @@ public class RestGetJobsAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors", deprecationLogger)
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
@ -29,9 +27,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestOpenJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestOpenJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -42,8 +37,7 @@ public class RestOpenJobAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestStatusToXContentListener;
|
||||
@ -26,9 +24,6 @@ public class RestPostDataAction extends BaseRestHandler {
|
||||
private static final String DEFAULT_RESET_START = "";
|
||||
private static final String DEFAULT_RESET_END = "";
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPostDataAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,8 +34,7 @@ public class RestPostDataAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_data",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_data",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_data")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestPostJobUpdateAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPostJobUpdateAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestPostJobUpdateAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_update",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_update",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_update")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestPutJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -37,8 +32,7 @@ public class RestPutJobAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(PUT, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}",
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}",
|
||||
deprecationLogger)
|
||||
PUT, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.modelsnapshots;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -24,9 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteModelSnapshotAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteModelSnapshotAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -39,8 +34,7 @@ public class RestDeleteModelSnapshotAction extends BaseRestHandler {
|
||||
new ReplacedRoute(DELETE, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
|
||||
"}/model_snapshots/{" + ModelSnapshotField.SNAPSHOT_ID.getPreferredName() + "}",
|
||||
DELETE, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
|
||||
"}/model_snapshots/{" + ModelSnapshotField.SNAPSHOT_ID.getPreferredName() + "}",
|
||||
deprecationLogger)
|
||||
"}/model_snapshots/{" + ModelSnapshotField.SNAPSHOT_ID.getPreferredName() + "}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.modelsnapshots;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -38,9 +36,6 @@ public class RestGetModelSnapshotsAction extends BaseRestHandler {
|
||||
private static final String DEFAULT_END = null;
|
||||
private static final boolean DEFAULT_DESC_ORDER = true;
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetModelSnapshotsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -53,23 +48,19 @@ public class RestGetModelSnapshotsAction extends BaseRestHandler {
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + Request.SNAPSHOT_ID.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + Request.SNAPSHOT_ID.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + Request.SNAPSHOT_ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + Request.SNAPSHOT_ID.getPreferredName() + "}",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + Request.SNAPSHOT_ID.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + Request.SNAPSHOT_ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots",
|
||||
deprecationLogger),
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots",
|
||||
deprecationLogger)
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.modelsnapshots;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -26,9 +24,6 @@ public class RestRevertModelSnapshotAction extends BaseRestHandler {
|
||||
|
||||
private static final boolean DELETE_INTERVENING_DEFAULT = false;
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestRevertModelSnapshotAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -42,8 +37,7 @@ public class RestRevertModelSnapshotAction extends BaseRestHandler {
|
||||
POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/model_snapshots/{" +
|
||||
RevertModelSnapshotAction.Request.SNAPSHOT_ID.getPreferredName() + "}/_revert",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/model_snapshots/{" +
|
||||
RevertModelSnapshotAction.Request.SNAPSHOT_ID.getPreferredName() + "}/_revert",
|
||||
deprecationLogger)
|
||||
RevertModelSnapshotAction.Request.SNAPSHOT_ID.getPreferredName() + "}/_revert")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.modelsnapshots;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -25,9 +23,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestUpdateModelSnapshotAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestUpdateModelSnapshotAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -40,8 +35,7 @@ public class RestUpdateModelSnapshotAction extends BaseRestHandler {
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + ModelSnapshotField.SNAPSHOT_ID +"}/_update",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{"
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + ModelSnapshotField.SNAPSHOT_ID +"}/_update",
|
||||
deprecationLogger)
|
||||
+ Job.ID.getPreferredName() + "}/model_snapshots/{" + ModelSnapshotField.SNAPSHOT_ID +"}/_update")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.results;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -29,9 +27,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestGetBucketsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetBucketsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -44,23 +39,19 @@ public class RestGetBucketsAction extends BaseRestHandler {
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets/{" + Result.TIMESTAMP.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets/{" + Result.TIMESTAMP.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
+ "}/results/buckets/{" + Result.TIMESTAMP.getPreferredName() + "}"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets/{" + Result.TIMESTAMP.getPreferredName() + "}",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets/{" + Result.TIMESTAMP.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
+ "}/results/buckets/{" + Result.TIMESTAMP.getPreferredName() + "}"),
|
||||
new ReplacedRoute(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets",
|
||||
deprecationLogger),
|
||||
+ "}/results/buckets"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName()
|
||||
+ "}/results/buckets",
|
||||
deprecationLogger)
|
||||
+ "}/results/buckets")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.results;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -28,9 +26,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestGetCategoriesAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetCategoriesAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -44,21 +39,17 @@ public class RestGetCategoriesAction extends BaseRestHandler {
|
||||
GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories/{"
|
||||
+ Request.CATEGORY_ID.getPreferredName() + "}",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories/{"
|
||||
+ Request.CATEGORY_ID.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
+ Request.CATEGORY_ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
|
||||
"}/results/categories/{" + Request.CATEGORY_ID.getPreferredName() + "}",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
|
||||
"}/results/categories/{" + Request.CATEGORY_ID.getPreferredName() + "}",
|
||||
deprecationLogger),
|
||||
"}/results/categories/{" + Request.CATEGORY_ID.getPreferredName() + "}"),
|
||||
new ReplacedRoute(
|
||||
GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories"),
|
||||
new ReplacedRoute(
|
||||
POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.results;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -27,9 +25,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestGetInfluencersAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetInfluencersAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -41,12 +36,10 @@ public class RestGetInfluencersAction extends BaseRestHandler {
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(
|
||||
GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers"),
|
||||
new ReplacedRoute(
|
||||
POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/influencers")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.results;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -27,9 +25,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestGetOverallBucketsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetOverallBucketsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -41,12 +36,10 @@ public class RestGetOverallBucketsAction extends BaseRestHandler {
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(
|
||||
GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/overall_buckets",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/overall_buckets",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/overall_buckets"),
|
||||
new ReplacedRoute(
|
||||
POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/overall_buckets",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/overall_buckets",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/overall_buckets")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.results;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -27,9 +25,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestGetRecordsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetRecordsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -41,12 +36,10 @@ public class RestGetRecordsAction extends BaseRestHandler {
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(
|
||||
GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/records",
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/records",
|
||||
deprecationLogger),
|
||||
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/records"),
|
||||
new ReplacedRoute(
|
||||
POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/records",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/records",
|
||||
deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/records")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.validate;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -23,9 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestValidateDetectorAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestValidateDetectorAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -36,7 +31,7 @@ public class RestValidateDetectorAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/_validate/detector",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/_validate/detector", deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/_validate/detector")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.rest.validate;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -23,9 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestValidateJobConfigAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestValidateJobConfigAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return Collections.emptyList();
|
||||
@ -36,7 +31,7 @@ public class RestValidateJobConfigAction extends BaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, MachineLearning.BASE_PATH + "anomaly_detectors/_validate",
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/_validate", deprecationLogger)
|
||||
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/_validate")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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.common.Strings;
|
||||
import org.elasticsearch.common.collect.MapBuilder;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -40,8 +37,6 @@ public class RestMonitoringBulkAction extends XPackRestHandler {
|
||||
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 static final List<String> ALL_VERSIONS = asList(
|
||||
MonitoringTemplateUtils.TEMPLATE_VERSION,
|
||||
@ -65,10 +60,10 @@ public class RestMonitoringBulkAction extends XPackRestHandler {
|
||||
return unmodifiableList(asList(
|
||||
new ReplacedRoute(
|
||||
POST, "/_monitoring/bulk",
|
||||
POST, "/_xpack/monitoring/_bulk", deprecationLogger),
|
||||
POST, "/_xpack/monitoring/_bulk"),
|
||||
new ReplacedRoute(
|
||||
PUT, "/_monitoring/bulk",
|
||||
PUT, "/_xpack/monitoring/_bulk", deprecationLogger)));
|
||||
PUT, "/_xpack/monitoring/_bulk")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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.RestRequest;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
@ -24,8 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
|
||||
public class RestDeleteRollupJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteRollupJobAction.class));
|
||||
|
||||
public static final ParseField ID = new ParseField("id");
|
||||
|
||||
@Override
|
||||
@ -35,7 +31,7 @@ public class RestDeleteRollupJobAction extends BaseRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(DELETE, "/_rollup/job/{id}", DELETE, "/_xpack/rollup/job/{id}/", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(DELETE, "/_rollup/job/{id}", DELETE, "/_xpack/rollup/job/{id}/"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,8 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetRollupCapsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupCapsAction.class));
|
||||
|
||||
public static final ParseField ID = new ParseField("id");
|
||||
|
||||
@Override
|
||||
@ -34,7 +30,7 @@ public class RestGetRollupCapsAction extends BaseRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/_rollup/data/{id}", GET, "/_xpack/rollup/data/{id}/", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/_rollup/data/{id}", GET, "/_xpack/rollup/data/{id}/"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,12 +6,10 @@
|
||||
|
||||
package org.elasticsearch.xpack.rollup.rest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -25,9 +23,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetRollupIndexCapsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetRollupIndexCapsAction.class));
|
||||
|
||||
static final ParseField INDEX = new ParseField("index");
|
||||
|
||||
@Override
|
||||
@ -37,7 +32,7 @@ public class RestGetRollupIndexCapsAction extends BaseRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/{index}/_rollup/data", GET, "/{index}/_xpack/rollup/data", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/{index}/_rollup/data", GET, "/{index}/_xpack/rollup/data"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,8 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestGetRollupJobsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRollupJobsAction.class));
|
||||
|
||||
public static final ParseField ID = new ParseField("id");
|
||||
|
||||
@Override
|
||||
@ -34,7 +30,7 @@ public class RestGetRollupJobsAction extends BaseRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(GET, "/_rollup/job/{id}", GET, "/_xpack/rollup/job/{id}/", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(GET, "/_rollup/job/{id}", GET, "/_xpack/rollup/job/{id}/"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
package org.elasticsearch.xpack.rollup.rest;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,8 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestPutRollupJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutRollupJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -32,7 +28,7 @@ public class RestPutRollupJobAction extends BaseRestHandler {
|
||||
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(PUT, "/_rollup/job/{id}", PUT, "/_xpack/rollup/job/{id}", deprecationLogger));
|
||||
return singletonList(new ReplacedRoute(PUT, "/_rollup/job/{id}", PUT, "/_xpack/rollup/job/{id}"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
package org.elasticsearch.xpack.rollup.rest;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestToXContentListener;
|
||||
@ -23,8 +21,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestStartRollupJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestStartRollupJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -33,7 +29,7 @@ public class RestStartRollupJobAction extends BaseRestHandler {
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(
|
||||
new ReplacedRoute(POST, "/_rollup/job/{id}/_start", POST, "/_xpack/rollup/job/{id}/_start", deprecationLogger));
|
||||
new ReplacedRoute(POST, "/_rollup/job/{id}/_start", POST, "/_xpack/rollup/job/{id}/_start"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
package org.elasticsearch.xpack.rollup.rest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,8 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestStopRollupJobAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestStopRollupJobAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -34,7 +30,7 @@ public class RestStopRollupJobAction extends BaseRestHandler {
|
||||
@Override
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(
|
||||
new ReplacedRoute(POST, "/_rollup/job/{id}/_stop", POST, "/_xpack/rollup/job/{id}/_stop", deprecationLogger));
|
||||
new ReplacedRoute(POST, "/_rollup/job/{id}/_stop", POST, "/_xpack/rollup/job/{id}/_stop"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -32,7 +30,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
public class RestAuthenticateAction extends SecurityBaseRestHandler {
|
||||
|
||||
private final SecurityContext securityContext;
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestAuthenticateAction.class));
|
||||
|
||||
public RestAuthenticateAction(Settings settings, SecurityContext securityContext, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
@ -48,7 +45,7 @@ public class RestAuthenticateAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(new ReplacedRoute(GET, "/_security/_authenticate", GET,
|
||||
"/_xpack/security/_authenticate", deprecationLogger));
|
||||
"/_xpack/security/_authenticate"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,7 +5,6 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.oauth2;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ElasticsearchSecurityException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -13,7 +12,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.SecureString;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
@ -48,7 +46,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
*/
|
||||
public final class RestGetTokenAction extends TokenBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetTokenAction.class));
|
||||
static final ConstructingObjectParser<CreateTokenRequest, Void> PARSER = new ConstructingObjectParser<>("token_request",
|
||||
a -> new CreateTokenRequest((String) a[0], (String) a[1], (SecureString) a[2], (SecureString) a[3], (String) a[4],
|
||||
(String) a[5]));
|
||||
@ -78,7 +75,7 @@ public final class RestGetTokenAction extends TokenBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, "/_security/oauth2/token", POST, "/_xpack/security/oauth2/token", deprecationLogger)
|
||||
new ReplacedRoute(POST, "/_security/oauth2/token", POST, "/_xpack/security/oauth2/token")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.oauth2;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -35,7 +33,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
*/
|
||||
public final class RestInvalidateTokenAction extends TokenBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestInvalidateTokenAction.class));
|
||||
static final ConstructingObjectParser<InvalidateTokenRequest, Void> PARSER =
|
||||
new ConstructingObjectParser<>("invalidate_token", a -> {
|
||||
final String token = (String) a[0];
|
||||
@ -77,7 +74,7 @@ public final class RestInvalidateTokenAction extends TokenBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, "/_security/oauth2/token", DELETE, "/_xpack/security/oauth2/token", deprecationLogger)
|
||||
new ReplacedRoute(DELETE, "/_security/oauth2/token", DELETE, "/_xpack/security/oauth2/token")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.privilege;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -33,9 +31,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
*/
|
||||
public class RestDeletePrivilegesAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeletePrivilegesAction.class));
|
||||
|
||||
public RestDeletePrivilegesAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -49,7 +44,7 @@ public class RestDeletePrivilegesAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(new ReplacedRoute(DELETE, "/_security/privilege/{application}/{privilege}", DELETE,
|
||||
"/_xpack/security/privilege/{application}/{privilege}", deprecationLogger));
|
||||
"/_xpack/security/privilege/{application}/{privilege}"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.privilege;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.util.set.Sets;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -38,8 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
*/
|
||||
public class RestGetPrivilegesAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetPrivilegesAction.class));
|
||||
|
||||
public RestGetPrivilegesAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -53,11 +49,11 @@ public class RestGetPrivilegesAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, "/_security/privilege/", GET, "/_xpack/security/privilege/", deprecationLogger),
|
||||
new ReplacedRoute(GET, "/_security/privilege/", GET, "/_xpack/security/privilege/"),
|
||||
new ReplacedRoute(GET, "/_security/privilege/{application}",
|
||||
GET, "/_xpack/security/privilege/{application}", deprecationLogger),
|
||||
GET, "/_xpack/security/privilege/{application}"),
|
||||
new ReplacedRoute(GET, "/_security/privilege/{application}/{privilege}",
|
||||
GET, "/_xpack/security/privilege/{application}/{privilege}", deprecationLogger)
|
||||
GET, "/_xpack/security/privilege/{application}/{privilege}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.privilege;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -37,7 +35,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
* Rest endpoint to add one or more {@link ApplicationPrivilege} objects to the security index
|
||||
*/
|
||||
public class RestPutPrivilegesAction extends SecurityBaseRestHandler {
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutPrivilegesAction.class));
|
||||
|
||||
public RestPutPrivilegesAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
@ -52,8 +49,8 @@ public class RestPutPrivilegesAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(PUT, "/_security/privilege/", PUT, "/_xpack/security/privilege/", deprecationLogger),
|
||||
new ReplacedRoute(POST, "/_security/privilege/", POST, "/_xpack/security/privilege/", deprecationLogger)
|
||||
new ReplacedRoute(PUT, "/_security/privilege/", PUT, "/_xpack/security/privilege/"),
|
||||
new ReplacedRoute(POST, "/_security/privilege/", POST, "/_xpack/security/privilege/")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.realm;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,8 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public final class RestClearRealmCacheAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestClearRealmCacheAction.class));
|
||||
|
||||
public RestClearRealmCacheAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -40,7 +36,7 @@ public final class RestClearRealmCacheAction extends SecurityBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, "/_security/realm/{realms}/_clear_cache",
|
||||
POST, "/_xpack/security/realm/{realms}/_clear_cache", deprecationLogger)
|
||||
POST, "/_xpack/security/realm/{realms}/_clear_cache")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.role;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -24,8 +22,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public final class RestClearRolesCacheAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestClearRolesCacheAction.class));
|
||||
|
||||
public RestClearRolesCacheAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -39,7 +35,7 @@ public final class RestClearRolesCacheAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(new ReplacedRoute(POST, "/_security/role/{name}/_clear_cache", POST,
|
||||
"/_xpack/security/role/{name}/_clear_cache", deprecationLogger));
|
||||
"/_xpack/security/role/{name}/_clear_cache"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.role;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -31,8 +29,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
*/
|
||||
public class RestDeleteRoleAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteRoleAction.class));
|
||||
|
||||
public RestDeleteRoleAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -46,7 +42,7 @@ public class RestDeleteRoleAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(new ReplacedRoute(DELETE, "/_security/role/{name}", DELETE,
|
||||
"/_xpack/security/role/{name}", deprecationLogger));
|
||||
"/_xpack/security/role/{name}"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.role;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.license.XPackLicenseState;
|
||||
@ -34,8 +32,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
*/
|
||||
public class RestGetRolesAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRolesAction.class));
|
||||
|
||||
public RestGetRolesAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -49,8 +45,8 @@ public class RestGetRolesAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, "/_security/role/", GET, "/_xpack/security/role/", deprecationLogger),
|
||||
new ReplacedRoute(GET, "/_security/role/{name}", GET, "/_xpack/security/role/{name}", deprecationLogger)
|
||||
new ReplacedRoute(GET, "/_security/role/", GET, "/_xpack/security/role/"),
|
||||
new ReplacedRoute(GET, "/_security/role/{name}", GET, "/_xpack/security/role/{name}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.role;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -34,8 +32,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
*/
|
||||
public class RestPutRoleAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutRoleAction.class));
|
||||
|
||||
public RestPutRoleAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -49,8 +45,8 @@ public class RestPutRoleAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(POST, "/_security/role/{name}", POST, "/_xpack/security/role/{name}", deprecationLogger),
|
||||
new ReplacedRoute(PUT, "/_security/role/{name}", PUT, "/_xpack/security/role/{name}", deprecationLogger)
|
||||
new ReplacedRoute(POST, "/_security/role/{name}", POST, "/_xpack/security/role/{name}"),
|
||||
new ReplacedRoute(PUT, "/_security/role/{name}", PUT, "/_xpack/security/role/{name}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.rolemapping;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -31,9 +29,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
*/
|
||||
public class RestDeleteRoleMappingAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestDeleteRoleMappingAction.class));
|
||||
|
||||
public RestDeleteRoleMappingAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -47,7 +42,7 @@ public class RestDeleteRoleMappingAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, "/_security/role_mapping/{name}", DELETE, "/_xpack/security/role_mapping/{name}", deprecationLogger)
|
||||
new ReplacedRoute(DELETE, "/_security/role_mapping/{name}", DELETE, "/_xpack/security/role_mapping/{name}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.rolemapping;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -33,8 +31,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
*/
|
||||
public class RestGetRoleMappingsAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetRoleMappingsAction.class));
|
||||
|
||||
public RestGetRoleMappingsAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -48,8 +44,8 @@ public class RestGetRoleMappingsAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, "/_security/role_mapping/", GET, "/_xpack/security/role_mapping/", deprecationLogger),
|
||||
new ReplacedRoute(GET, "/_security/role_mapping/{name}", GET, "/_xpack/security/role_mapping/{name}", deprecationLogger)
|
||||
new ReplacedRoute(GET, "/_security/role_mapping/", GET, "/_xpack/security/role_mapping/"),
|
||||
new ReplacedRoute(GET, "/_security/role_mapping/{name}", GET, "/_xpack/security/role_mapping/{name}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.rolemapping;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -36,8 +34,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
*/
|
||||
public class RestPutRoleMappingAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutRoleMappingAction.class));
|
||||
|
||||
public RestPutRoleMappingAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -51,8 +47,8 @@ public class RestPutRoleMappingAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(POST, "/_security/role_mapping/{name}", POST, "/_xpack/security/role_mapping/{name}", deprecationLogger),
|
||||
new ReplacedRoute(PUT, "/_security/role_mapping/{name}", PUT, "/_xpack/security/role_mapping/{name}", deprecationLogger)
|
||||
new ReplacedRoute(POST, "/_security/role_mapping/{name}", POST, "/_xpack/security/role_mapping/{name}"),
|
||||
new ReplacedRoute(PUT, "/_security/role_mapping/{name}", PUT, "/_xpack/security/role_mapping/{name}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger;
|
||||
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.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -37,7 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
*/
|
||||
public class RestSamlAuthenticateAction extends SamlBaseRestHandler {
|
||||
private static final Logger logger = LogManager.getLogger();
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
static class Input {
|
||||
String content;
|
||||
@ -77,7 +75,7 @@ public class RestSamlAuthenticateAction extends SamlBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, "/_security/saml/authenticate",
|
||||
POST, "/_xpack/security/saml/authenticate", deprecationLogger)
|
||||
POST, "/_xpack/security/saml/authenticate")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.saml;
|
||||
|
||||
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.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -35,8 +33,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
*/
|
||||
public class RestSamlInvalidateSessionAction extends SamlBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestSamlInvalidateSessionAction.class));
|
||||
static final ObjectParser<SamlInvalidateSessionRequest, RestSamlInvalidateSessionAction> PARSER =
|
||||
new ObjectParser<>("saml_invalidate_session", SamlInvalidateSessionRequest::new);
|
||||
|
||||
@ -60,7 +56,7 @@ public class RestSamlInvalidateSessionAction extends SamlBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, "/_security/saml/invalidate",
|
||||
POST, "/_xpack/security/saml/invalidate", deprecationLogger)
|
||||
POST, "/_xpack/security/saml/invalidate")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.saml;
|
||||
|
||||
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.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -37,7 +35,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
*/
|
||||
public class RestSamlLogoutAction extends SamlBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSamlLogoutAction.class));
|
||||
static final ObjectParser<SamlLogoutRequest, Void> PARSER = new ObjectParser<>("saml_logout", SamlLogoutRequest::new);
|
||||
|
||||
static {
|
||||
@ -59,7 +56,7 @@ public class RestSamlLogoutAction extends SamlBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, "/_security/saml/logout",
|
||||
POST, "/_xpack/security/saml/logout", deprecationLogger)
|
||||
POST, "/_xpack/security/saml/logout")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.saml;
|
||||
|
||||
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.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -37,8 +35,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
*/
|
||||
public class RestSamlPrepareAuthenticationAction extends SamlBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestSamlPrepareAuthenticationAction.class));
|
||||
static final ObjectParser<SamlPrepareAuthenticationRequest, Void> PARSER = new ObjectParser<>("saml_prepare_authn",
|
||||
SamlPrepareAuthenticationRequest::new);
|
||||
|
||||
@ -62,7 +58,7 @@ public class RestSamlPrepareAuthenticationAction extends SamlBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(POST, "/_security/saml/prepare",
|
||||
POST, "/_xpack/security/saml/prepare", deprecationLogger)
|
||||
POST, "/_xpack/security/saml/prepare")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -36,7 +34,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
|
||||
public class RestChangePasswordAction extends SecurityBaseRestHandler implements RestRequestFilter {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestChangePasswordAction.class));
|
||||
private final SecurityContext securityContext;
|
||||
private final Hasher passwordHasher;
|
||||
|
||||
@ -56,13 +53,13 @@ public class RestChangePasswordAction extends SecurityBaseRestHandler implements
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(PUT, "/_security/user/{username}/_password",
|
||||
PUT, "/_xpack/security/user/{username}/_password", deprecationLogger),
|
||||
PUT, "/_xpack/security/user/{username}/_password"),
|
||||
new ReplacedRoute(POST, "/_security/user/{username}/_password",
|
||||
POST, "/_xpack/security/user/{username}/_password", deprecationLogger),
|
||||
POST, "/_xpack/security/user/{username}/_password"),
|
||||
new ReplacedRoute(PUT, "/_security/user/_password",
|
||||
PUT, "/_xpack/security/user/_password", deprecationLogger),
|
||||
PUT, "/_xpack/security/user/_password"),
|
||||
new ReplacedRoute(POST, "/_security/user/_password",
|
||||
POST, "/_xpack/security/user/_password", deprecationLogger)
|
||||
POST, "/_xpack/security/user/_password")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -31,8 +29,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
|
||||
*/
|
||||
public class RestDeleteUserAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestDeleteUserAction.class));
|
||||
|
||||
public RestDeleteUserAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -46,7 +42,7 @@ public class RestDeleteUserAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(DELETE, "/_security/user/{username}", DELETE, "/_xpack/security/user/{username}", deprecationLogger)
|
||||
new ReplacedRoute(DELETE, "/_security/user/{username}", DELETE, "/_xpack/security/user/{username}")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.ElasticsearchSecurityException;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -41,8 +39,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
public class RestGetUserPrivilegesAction extends SecurityBaseRestHandler {
|
||||
|
||||
private final SecurityContext securityContext;
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(RestGetUserPrivilegesAction.class));
|
||||
|
||||
public RestGetUserPrivilegesAction(Settings settings, SecurityContext securityContext, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
@ -58,7 +54,7 @@ public class RestGetUserPrivilegesAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.singletonList(
|
||||
new ReplacedRoute(GET, "/_security/user/_privileges", GET, "/_xpack/security/user/_privileges", deprecationLogger)
|
||||
new ReplacedRoute(GET, "/_security/user/_privileges", GET, "/_xpack/security/user/_privileges")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
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.license.XPackLicenseState;
|
||||
@ -34,8 +32,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
*/
|
||||
public class RestGetUsersAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestGetUsersAction.class));
|
||||
|
||||
public RestGetUsersAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -49,8 +45,8 @@ public class RestGetUsersAction extends SecurityBaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, "/_security/user/", GET, "/_xpack/security/user/", deprecationLogger),
|
||||
new ReplacedRoute(GET, "/_security/user/{username}", GET, "/_xpack/security/user/{username}", deprecationLogger)
|
||||
new ReplacedRoute(GET, "/_security/user/", GET, "/_xpack/security/user/"),
|
||||
new ReplacedRoute(GET, "/_security/user/{username}", GET, "/_xpack/security/user/{username}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,12 +5,10 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.ElasticsearchSecurityException;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -44,7 +42,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
public class RestHasPrivilegesAction extends SecurityBaseRestHandler {
|
||||
|
||||
private final SecurityContext securityContext;
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestHasPrivilegesAction.class));
|
||||
|
||||
public RestHasPrivilegesAction(Settings settings, SecurityContext securityContext, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
@ -61,13 +58,13 @@ public class RestHasPrivilegesAction extends SecurityBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(GET, "/_security/user/{username}/_has_privileges",
|
||||
GET, "/_xpack/security/user/{username}/_has_privileges", deprecationLogger),
|
||||
GET, "/_xpack/security/user/{username}/_has_privileges"),
|
||||
new ReplacedRoute(POST, "/_security/user/{username}/_has_privileges",
|
||||
POST, "/_xpack/security/user/{username}/_has_privileges", deprecationLogger),
|
||||
POST, "/_xpack/security/user/{username}/_has_privileges"),
|
||||
new ReplacedRoute(GET, "/_security/user/_has_privileges",
|
||||
GET, "/_xpack/security/user/_has_privileges", deprecationLogger),
|
||||
GET, "/_xpack/security/user/_has_privileges"),
|
||||
new ReplacedRoute(POST, "/_security/user/_has_privileges",
|
||||
POST, "/_xpack/security/user/_has_privileges", deprecationLogger)
|
||||
POST, "/_xpack/security/user/_has_privileges")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -40,7 +38,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
public class RestPutUserAction extends SecurityBaseRestHandler implements RestRequestFilter {
|
||||
|
||||
private final Hasher passwordHasher;
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestPutUserAction.class));
|
||||
|
||||
public RestPutUserAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
@ -57,9 +54,9 @@ public class RestPutUserAction extends SecurityBaseRestHandler implements RestRe
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(POST, "/_security/user/{username}",
|
||||
POST, "/_xpack/security/user/{username}", deprecationLogger),
|
||||
POST, "/_xpack/security/user/{username}"),
|
||||
new ReplacedRoute(PUT, "/_security/user/{username}",
|
||||
PUT, "/_xpack/security/user/{username}", deprecationLogger)
|
||||
PUT, "/_xpack/security/user/{username}")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.security.rest.action.user;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
@ -34,8 +32,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
|
||||
*/
|
||||
public class RestSetEnabledAction extends SecurityBaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSetEnabledAction.class));
|
||||
|
||||
public RestSetEnabledAction(Settings settings, XPackLicenseState licenseState) {
|
||||
super(settings, licenseState);
|
||||
}
|
||||
@ -50,13 +46,13 @@ public class RestSetEnabledAction extends SecurityBaseRestHandler {
|
||||
// TODO: remove deprecated endpoint in 8.0.0
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
new ReplacedRoute(POST, "/_security/user/{username}/_enable",
|
||||
POST, "/_xpack/security/user/{username}/_enable", deprecationLogger),
|
||||
POST, "/_xpack/security/user/{username}/_enable"),
|
||||
new ReplacedRoute(PUT, "/_security/user/{username}/_enable",
|
||||
PUT, "/_xpack/security/user/{username}/_enable", deprecationLogger),
|
||||
PUT, "/_xpack/security/user/{username}/_enable"),
|
||||
new ReplacedRoute(POST, "/_security/user/{username}/_disable",
|
||||
POST, "/_xpack/security/user/{username}/_disable", deprecationLogger),
|
||||
POST, "/_xpack/security/user/{username}/_disable"),
|
||||
new ReplacedRoute(PUT, "/_security/user/{username}/_disable",
|
||||
PUT, "/_xpack/security/user/{username}/_disable", deprecationLogger)
|
||||
PUT, "/_xpack/security/user/{username}/_disable")
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
package org.elasticsearch.xpack.sql.plugin;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -26,8 +24,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestSqlClearCursorAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlClearCursorAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -37,7 +33,7 @@ public class RestSqlClearCursorAction extends BaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(
|
||||
POST, Protocol.CLEAR_CURSOR_REST_ENDPOINT,
|
||||
POST, Protocol.CLEAR_CURSOR_DEPRECATED_REST_ENDPOINT, deprecationLogger));
|
||||
POST, Protocol.CLEAR_CURSOR_DEPRECATED_REST_ENDPOINT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
package org.elasticsearch.xpack.sql.plugin;
|
||||
|
||||
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.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
@ -36,8 +34,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
||||
public class RestSqlQueryAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlQueryAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -48,10 +44,10 @@ public class RestSqlQueryAction extends BaseRestHandler {
|
||||
return unmodifiableList(asList(
|
||||
new ReplacedRoute(
|
||||
GET, Protocol.SQL_QUERY_REST_ENDPOINT,
|
||||
GET, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT, deprecationLogger),
|
||||
GET, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT),
|
||||
new ReplacedRoute(
|
||||
POST, Protocol.SQL_QUERY_REST_ENDPOINT,
|
||||
POST, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT, deprecationLogger)));
|
||||
POST, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,7 @@
|
||||
|
||||
package org.elasticsearch.xpack.sql.plugin;
|
||||
|
||||
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.RestRequest;
|
||||
import org.elasticsearch.rest.action.RestActions;
|
||||
@ -22,8 +20,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
|
||||
|
||||
public class RestSqlStatsAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlStatsAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -33,7 +29,7 @@ public class RestSqlStatsAction extends BaseRestHandler {
|
||||
public List<ReplacedRoute> replacedRoutes() {
|
||||
return singletonList(new ReplacedRoute(
|
||||
GET, Protocol.SQL_STATS_REST_ENDPOINT,
|
||||
GET, Protocol.SQL_STATS_DEPRECATED_REST_ENDPOINT, deprecationLogger));
|
||||
GET, Protocol.SQL_STATS_DEPRECATED_REST_ENDPOINT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,9 +5,7 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.sql.plugin;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
@ -30,8 +28,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
*/
|
||||
public class RestSqlTranslateAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSqlTranslateAction.class));
|
||||
|
||||
@Override
|
||||
public List<Route> routes() {
|
||||
return emptyList();
|
||||
@ -42,10 +38,10 @@ public class RestSqlTranslateAction extends BaseRestHandler {
|
||||
return unmodifiableList(asList(
|
||||
new ReplacedRoute(
|
||||
GET, Protocol.SQL_TRANSLATE_REST_ENDPOINT,
|
||||
GET, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT, deprecationLogger),
|
||||
GET, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT),
|
||||
new ReplacedRoute(
|
||||
POST, Protocol.SQL_TRANSLATE_REST_ENDPOINT,
|
||||
POST, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT, deprecationLogger)));
|
||||
POST, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,7 +36,7 @@ public class RestDeleteTransformActionDeprecated extends BaseRestHandler {
|
||||
@Override
|
||||
public List<DeprecatedRoute> deprecatedRoutes() {
|
||||
return singletonList(new DeprecatedRoute(DELETE, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED,
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger));
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,9 +40,9 @@ public class RestGetTransformActionDeprecated extends BaseRestHandler {
|
||||
public List<DeprecatedRoute> deprecatedRoutes() {
|
||||
return unmodifiableList(asList(
|
||||
new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED,
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger),
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT),
|
||||
new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED,
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)));
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,9 +40,9 @@ public class RestGetTransformStatsActionDeprecated extends BaseRestHandler {
|
||||
public List<DeprecatedRoute> deprecatedRoutes() {
|
||||
return unmodifiableList(asList(
|
||||
new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_stats",
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger),
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT),
|
||||
new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stats",
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)));
|
||||
TransformMessages.REST_DEPRECATED_ENDPOINT)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user