From 14f43af81850bf4aa2ecddc1bc21f13467da707a Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 6 Dec 2016 21:35:00 +0100 Subject: [PATCH] moved metric part to be the suffix of the path Original commit: elastic/x-pack-elasticsearch@6fc1b861edb1f08301c28382d01a0e5e11353139 --- .../xpack/prelert/rest/job/RestGetJobsAction.java | 4 ++-- .../resources/rest-api-spec/api/xpack.prelert.get_jobs.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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": {