diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/rest/job/RestGetJobsAction.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/rest/job/RestGetJobsAction.java index fa5d1e6c0e0..d5e5d3f957a 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/rest/job/RestGetJobsAction.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/rest/job/RestGetJobsAction.java @@ -38,14 +38,14 @@ public class RestGetJobsAction extends BaseRestHandler { controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats", this); controller.registerHandler(RestRequest.Method.GET, - PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/{metric}/_stats", this); + PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats/{metric}", this); controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "jobs/_stats", this); // POSTs controller.registerHandler(RestRequest.Method.POST, PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats", this); controller.registerHandler(RestRequest.Method.POST, - PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/{metric}/_stats", this); + PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats/{metric}", this); controller.registerHandler(RestRequest.Method.POST, PrelertPlugin.BASE_PATH + "jobs/_stats", this); } diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json index 79a124fac7f..dce1f3ee5b1 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json @@ -6,7 +6,7 @@ "paths": [ "/_xpack/prelert/jobs/_stats", "/_xpack/prelert/jobs/{job_id}/_stats", - "/_xpack/prelert/jobs/{job_id}/{metric}/_stats" + "/_xpack/prelert/jobs/{job_id}/_stats/{metric}" ], "parts": { "job_id": {