moved metric part to be the suffix of the path

Original commit: elastic/x-pack-elasticsearch@6fc1b861ed
This commit is contained in:
Martijn van Groningen 2016-12-06 21:35:00 +01:00
parent e396e8aa68
commit 14f43af818
2 changed files with 3 additions and 3 deletions

View File

@ -38,14 +38,14 @@ public class RestGetJobsAction extends BaseRestHandler {
controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats", controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats",
this); this);
controller.registerHandler(RestRequest.Method.GET, 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); controller.registerHandler(RestRequest.Method.GET, PrelertPlugin.BASE_PATH + "jobs/_stats", this);
// POSTs // POSTs
controller.registerHandler(RestRequest.Method.POST, PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats", controller.registerHandler(RestRequest.Method.POST, PrelertPlugin.BASE_PATH + "jobs/{" + Job.ID.getPreferredName() + "}/_stats",
this); this);
controller.registerHandler(RestRequest.Method.POST, 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); controller.registerHandler(RestRequest.Method.POST, PrelertPlugin.BASE_PATH + "jobs/_stats", this);
} }

View File

@ -6,7 +6,7 @@
"paths": [ "paths": [
"/_xpack/prelert/jobs/_stats", "/_xpack/prelert/jobs/_stats",
"/_xpack/prelert/jobs/{job_id}/_stats", "/_xpack/prelert/jobs/{job_id}/_stats",
"/_xpack/prelert/jobs/{job_id}/{metric}/_stats" "/_xpack/prelert/jobs/{job_id}/_stats/{metric}"
], ],
"parts": { "parts": {
"job_id": { "job_id": {