|
|
@@ -18,7 +18,6 @@ import org.elasticsearch.xpack.core.ml.job.config.Job;
|
|
|
import org.elasticsearch.xpack.ml.MachineLearning;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
import static org.elasticsearch.rest.RestRequest.Method.GET;
|
|
|
@@ -37,28 +36,14 @@ public class RestGetModelSnapshotsAction extends BaseRestHandler {
|
|
|
|
|
|
@Override
|
|
|
public List<Route> routes() {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<ReplacedRoute> replacedRoutes() {
|
|
|
- // TODO: remove deprecated endpoint in 8.0.0
|
|
|
return List.of(
|
|
|
- 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/{"
|
|
|
+ new Route(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
|
|
+ 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/{"
|
|
|
+ new Route(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
|
|
+ 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/{"
|
|
|
+ new Route(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
|
|
+ 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/{"
|
|
|
+ new Route(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{"
|
|
|
+ Job.ID.getPreferredName() + "}/model_snapshots")
|
|
|
);
|
|
|
}
|