Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymode committed Feb 5, 2020
1 parent 2a1d841 commit 9167512
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.GET;

public class RestGetStatusAction extends BaseRestHandler {

@Override
public Map<String, List<Method>> handledMethodsAndPaths() {
return singletonMap("/_ilm/status", singletonList(POST));
return singletonMap("/_ilm/status", singletonList(GET));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.List;
import java.util.Map;

import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST;

public class RestOpenJobAction extends BaseRestHandler {

Expand All @@ -43,8 +43,8 @@ public Map<String, List<Method>> handledMethodsAndPaths() {
public List<ReplacedRestApi> replacedMethodsAndPaths() {
// TODO: remove deprecated endpoint in 8.0.0
return Collections.singletonList(
new ReplacedRestApi(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open",
GET, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open",
new ReplacedRestApi(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open",
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_open",
deprecationLogger)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public Map<String, List<Method>> handledMethodsAndPaths() {
public List<ReplacedRestApi> replacedMethodsAndPaths() {
// TODO: remove deprecated endpoint in 8.0.0
return Collections.singletonList(
new ReplacedRestApi(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/model_snapshots/{" +
new ReplacedRestApi(
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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public Map<String, List<Method>> handledMethodsAndPaths() {
public List<ReplacedRestApi> replacedMethodsAndPaths() {
// TODO: remove deprecated endpoint in 8.0.0
return Collections.unmodifiableList(Arrays.asList(
new ReplacedRestApi(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories/{"
new ReplacedRestApi(
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() + "}",
Expand All @@ -52,10 +53,12 @@ public List<ReplacedRestApi> replacedMethodsAndPaths() {
POST, MachineLearning.PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() +
"}/results/categories/{" + Request.CATEGORY_ID.getPreferredName() + "}",
deprecationLogger),
new ReplacedRestApi(GET, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories",
new ReplacedRestApi(
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),
new ReplacedRestApi(POST, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/results/categories",
new ReplacedRestApi(
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)
));
Expand Down

0 comments on commit 9167512

Please sign in to comment.