From c7cfa56aaf0975275e10cea669581702a47514c5 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Thu, 5 Jan 2017 08:18:43 +0000 Subject: [PATCH] Rename prelert to ml in endpoint base path (elastic/elasticsearch#639) Original commit: elastic/x-pack-elasticsearch@ff6745e545490902bc2ebc14aece4ed43f82fd84 --- .../xpack/prelert/PrelertPlugin.java | 2 +- .../PrelertRestTestStateCleaner.java | 8 ++-- .../prelert/integration/ScheduledJobIT.java | 2 +- ...close_job.json => xpack.ml.close_job.json} | 8 ++-- ...lete_job.json => xpack.ml.delete_job.json} | 6 +-- ...te_list.json => xpack.ml.delete_list.json} | 6 +-- ...on => xpack.ml.delete_model_snapshot.json} | 6 +-- ...er.json => xpack.ml.delete_scheduler.json} | 6 +-- ...flush_job.json => xpack.ml.flush_job.json} | 8 ++-- ...buckets.json => xpack.ml.get_buckets.json} | 8 ++-- ...ries.json => xpack.ml.get_categories.json} | 8 ++-- ...ers.json => xpack.ml.get_influencers.json} | 6 +-- ...t.get_jobs.json => xpack.ml.get_jobs.json} | 6 +-- ...tats.json => xpack.ml.get_jobs_stats.json} | 6 +-- ...get_lists.json => xpack.ml.get_lists.json} | 6 +-- ...json => xpack.ml.get_model_snapshots.json} | 6 +-- ...records.json => xpack.ml.get_records.json} | 6 +-- ...lers.json => xpack.ml.get_schedulers.json} | 6 +-- ...son => xpack.ml.get_schedulers_stats.json} | 6 +-- ...t.job_data.json => xpack.ml.job_data.json} | 6 +-- ...t.open_job.json => xpack.ml.open_job.json} | 6 +-- ...ert.put_job.json => xpack.ml.put_job.json} | 6 +-- ...t.put_list.json => xpack.ml.put_list.json} | 6 +-- ...ck.ml.put_model_snapshot_description.json} | 6 +-- ...duler.json => xpack.ml.put_scheduler.json} | 6 +-- ...on => xpack.ml.revert_model_snapshot.json} | 6 +-- ...ler.json => xpack.ml.start_scheduler.json} | 6 +-- ...uler.json => xpack.ml.stop_scheduler.json} | 6 +-- ...r.json => xpack.ml.validate_detector.json} | 6 +-- ....json => xpack.ml.validate_transform.json} | 6 +-- ...json => xpack.ml.validate_transforms.json} | 6 +-- .../test/delete_model_snapshot.yaml | 20 ++++----- .../test/get_model_snapshots.yaml | 10 ++--- .../rest-api-spec/test/get_schedulers.yaml | 16 +++---- .../test/get_schedulers_stats.yaml | 16 +++---- .../rest-api-spec/test/jobs_crud.yaml | 22 +++++----- .../rest-api-spec/test/jobs_get.yaml | 12 ++--- .../test/jobs_get_result_buckets.yaml | 22 +++++----- .../test/jobs_get_result_categories.yaml | 16 +++---- .../test/jobs_get_result_influencers.yaml | 4 +- .../test/jobs_get_result_records.yaml | 4 +- .../rest-api-spec/test/jobs_get_stats.yaml | 20 ++++----- .../rest-api-spec/test/list_crud.yaml | 36 +++++++-------- .../rest-api-spec/test/post_data.yaml | 44 +++++++++---------- .../test/put_model_snapshot_description.yaml | 12 ++--- .../test/revert_model_snapshot.yaml | 38 ++++++++-------- .../rest-api-spec/test/schedulers_crud.yaml | 24 +++++----- .../test/start_stop_scheduler.yaml | 34 +++++++------- .../rest-api-spec/test/validate_detector.yaml | 4 +- .../test/validate_transform.yaml | 8 ++-- 50 files changed, 275 insertions(+), 275 deletions(-) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.close_job.json => xpack.ml.close_job.json} (69%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.delete_job.json => xpack.ml.delete_job.json} (60%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.delete_list.json => xpack.ml.delete_list.json} (64%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.delete_model_snapshot.json => xpack.ml.delete_model_snapshot.json} (63%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.delete_scheduler.json => xpack.ml.delete_scheduler.json} (61%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.flush_job.json => xpack.ml.flush_job.json} (87%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_buckets.json => xpack.ml.get_buckets.json} (86%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_categories.json => xpack.ml.get_categories.json} (70%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_influencers.json => xpack.ml.get_influencers.json} (86%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_jobs.json => xpack.ml.get_jobs.json} (64%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_jobs_stats.json => xpack.ml.get_jobs_stats.json} (62%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_lists.json => xpack.ml.get_lists.json} (74%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_model_snapshots.json => xpack.ml.get_model_snapshots.json} (85%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_records.json => xpack.ml.get_records.json} (88%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_schedulers.json => xpack.ml.get_schedulers.json} (65%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.get_schedulers_stats.json => xpack.ml.get_schedulers_stats.json} (62%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.job_data.json => xpack.ml.job_data.json} (80%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.open_job.json => xpack.ml.open_job.json} (78%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.put_job.json => xpack.ml.put_job.json} (66%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.put_list.json => xpack.ml.put_list.json} (58%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.put_model_snapshot_description.json => xpack.ml.put_model_snapshot_description.json} (67%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.put_scheduler.json => xpack.ml.put_scheduler.json} (67%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.revert_model_snapshot.json => xpack.ml.revert_model_snapshot.json} (80%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.start_scheduler.json => xpack.ml.start_scheduler.json} (83%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.stop_scheduler.json => xpack.ml.stop_scheduler.json} (74%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.validate_detector.json => xpack.ml.validate_detector.json} (51%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.validate_transform.json => xpack.ml.validate_transform.json} (51%) rename elasticsearch/src/test/resources/rest-api-spec/api/{xpack.prelert.validate_transforms.json => xpack.ml.validate_transforms.json} (51%) diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/PrelertPlugin.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/PrelertPlugin.java index 5599252135e..cf96ea9a44c 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/PrelertPlugin.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/prelert/PrelertPlugin.java @@ -126,7 +126,7 @@ import java.util.List; public class PrelertPlugin extends Plugin implements ActionPlugin { public static final String NAME = "prelert"; - public static final String BASE_PATH = "/_xpack/prelert/"; + public static final String BASE_PATH = "/_xpack/ml/"; public static final String THREAD_POOL_NAME = NAME; public static final String SCHEDULED_RUNNER_THREAD_POOL_NAME = NAME + "_scheduled_runner"; public static final String AUTODETECT_PROCESS_THREAD_POOL_NAME = NAME + "_autodetect_process"; diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertRestTestStateCleaner.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertRestTestStateCleaner.java index 7cff9869b3b..473e49ba242 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertRestTestStateCleaner.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertRestTestStateCleaner.java @@ -43,11 +43,11 @@ public class PrelertRestTestStateCleaner { Map schedulerMap = (Map) scheduler.get("config"); String schedulerId = (String) schedulerMap.get("scheduler_id"); try { - client.performRequest("POST", "/_xpack/prelert/schedulers/" + schedulerId + "/_stop"); + client.performRequest("POST", "/_xpack/ml/schedulers/" + schedulerId + "/_stop"); } catch (Exception e) { // ignore } - client.performRequest("DELETE", "/_xpack/prelert/schedulers/" + schedulerId); + client.performRequest("DELETE", "/_xpack/ml/schedulers/" + schedulerId); } } @@ -64,11 +64,11 @@ public class PrelertRestTestStateCleaner { for (Map jobConfig : jobConfigs) { String jobId = (String) jobConfig.get("job_id"); try { - client.performRequest("POST", "/_xpack/prelert/anomaly_detectors/" + jobId + "/_close"); + client.performRequest("POST", "/_xpack/ml/anomaly_detectors/" + jobId + "/_close"); } catch (Exception e) { // ignore } - client.performRequest("DELETE", "/_xpack/prelert/anomaly_detectors/" + jobId); + client.performRequest("DELETE", "/_xpack/ml/anomaly_detectors/" + jobId); } } } diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/ScheduledJobIT.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/ScheduledJobIT.java index c8eff21fda8..63fb211e052 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/ScheduledJobIT.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/ScheduledJobIT.java @@ -82,7 +82,7 @@ public class ScheduledJobIT extends ESRestTestCase { assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); assertThat(responseEntityToString(response), equalTo("{\"acknowledged\":true}")); - client().performRequest("POST", "/_xpack/prelert/anomaly_detectors/" + jobId + "/_close"); + client().performRequest("POST", "/_xpack/ml/anomaly_detectors/" + jobId + "/_close"); response = client().performRequest("delete", PrelertPlugin.BASE_PATH + "schedulers/" + schedulerId); assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.close_job.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.close_job.json similarity index 69% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.close_job.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.close_job.json index c8033f20b8c..88ba9196920 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.close_job.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.close_job.json @@ -1,9 +1,9 @@ { - "xpack.prelert.close_job": { + "xpack.ml.close_job": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/_close", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/_close" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/_close", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/_close" ], "parts": { "job_id": { "type": "string", @@ -17,4 +17,4 @@ } } } -} \ No newline at end of file +} diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_job.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_job.json similarity index 60% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_job.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_job.json index db74554e1d7..2ad1706338f 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_job.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_job.json @@ -1,9 +1,9 @@ { - "xpack.prelert.delete_job": { + "xpack.ml.delete_job": { "methods": [ "DELETE" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_list.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_list.json similarity index 64% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_list.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_list.json index 5a04873453f..1afbe595728 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_list.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_list.json @@ -1,9 +1,9 @@ { - "xpack.prelert.delete_list": { + "xpack.ml.delete_list": { "methods": [ "DELETE" ], "url": { - "path": "/_xpack/prelert/lists/{list_id}", - "paths": [ "/_xpack/prelert/lists/{list_id}" ], + "path": "/_xpack/ml/lists/{list_id}", + "paths": [ "/_xpack/ml/lists/{list_id}" ], "parts": { "list_id": { "type" : "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_model_snapshot.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_model_snapshot.json similarity index 63% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_model_snapshot.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_model_snapshot.json index 2c90fc67db8..a3915198285 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_model_snapshot.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_model_snapshot.json @@ -1,9 +1,9 @@ { - "xpack.prelert.delete_model_snapshot": { + "xpack.ml.delete_model_snapshot": { "methods": [ "DELETE" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_scheduler.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_scheduler.json similarity index 61% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_scheduler.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_scheduler.json index 755431458e3..38005777896 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.delete_scheduler.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.delete_scheduler.json @@ -1,9 +1,9 @@ { - "xpack.prelert.delete_scheduler": { + "xpack.ml.delete_scheduler": { "methods": [ "DELETE" ], "url": { - "path": "/_xpack/prelert/schedulers/{scheduler_id}", - "paths": [ "/_xpack/prelert/schedulers/{scheduler_id}" ], + "path": "/_xpack/ml/schedulers/{scheduler_id}", + "paths": [ "/_xpack/ml/schedulers/{scheduler_id}" ], "parts": { "scheduler_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.flush_job.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.flush_job.json similarity index 87% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.flush_job.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.flush_job.json index 829db96be89..a928ad4e731 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.flush_job.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.flush_job.json @@ -1,12 +1,12 @@ { - "xpack.prelert.flush_job": { + "xpack.ml.flush_job": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/_flush", + "path": "/_xpack/ml/anomaly_detectors/{job_id}/_flush", "paths": [ - "/_xpack/prelert/anomaly_detectors/{job_id}/_flush" + "/_xpack/ml/anomaly_detectors/{job_id}/_flush" ], "parts": { "job_id": { @@ -38,4 +38,4 @@ "description": "Flush parameters" } } -} \ No newline at end of file +} diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_buckets.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_buckets.json similarity index 86% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_buckets.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_buckets.json index ef61ed93d08..f6ee2471d30 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_buckets.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_buckets.json @@ -1,11 +1,11 @@ { - "xpack.prelert.get_buckets": { + "xpack.ml.get_buckets": { "methods": [ "GET", "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/buckets/{timestamp}", + "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}", "paths": [ - "/_xpack/prelert/anomaly_detectors/{job_id}/results/buckets/{timestamp}", - "/_xpack/prelert/anomaly_detectors/{job_id}/results/buckets" + "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}", + "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets" ], "parts": { "job_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_categories.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_categories.json similarity index 70% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_categories.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_categories.json index b463a0a746b..9233504e1d7 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_categories.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_categories.json @@ -1,11 +1,11 @@ { - "xpack.prelert.get_categories": { + "xpack.ml.get_categories": { "methods": [ "GET", "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}", + "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}", "paths": [ - "/_xpack/prelert/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}", - "/_xpack/prelert/anomaly_detectors/{job_id}/results/categorydefinitions/" + "/_xpack/ml/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}", + "/_xpack/ml/anomaly_detectors/{job_id}/results/categorydefinitions/" ], "parts": { "job_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_influencers.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_influencers.json similarity index 86% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_influencers.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_influencers.json index bb025c19f41..b5a2e5f1e31 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_influencers.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_influencers.json @@ -1,9 +1,9 @@ { - "xpack.prelert.get_influencers": { + "xpack.ml.get_influencers": { "methods": [ "GET", "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/influencers", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/results/influencers" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/influencers", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/results/influencers" ], "parts": { "job_id": { "type" : "string", 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.ml.get_jobs.json similarity index 64% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_jobs.json index 922d716a6cb..38a79c56625 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.ml.get_jobs.json @@ -1,10 +1,10 @@ { - "xpack.prelert.get_jobs": { + "xpack.ml.get_jobs": { "methods": [ "GET"], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}", + "path": "/_xpack/ml/anomaly_detectors/{job_id}", "paths": [ - "/_xpack/prelert/anomaly_detectors/{job_id}" + "/_xpack/ml/anomaly_detectors/{job_id}" ], "parts": { "job_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs_stats.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_jobs_stats.json similarity index 62% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs_stats.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_jobs_stats.json index d46db318d46..8ccbf12ea9a 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_jobs_stats.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_jobs_stats.json @@ -1,10 +1,10 @@ { - "xpack.prelert.get_jobs_stats": { + "xpack.ml.get_jobs_stats": { "methods": [ "GET"], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/_stats", + "path": "/_xpack/ml/anomaly_detectors/{job_id}/_stats", "paths": [ - "/_xpack/prelert/anomaly_detectors/{job_id}/_stats" + "/_xpack/ml/anomaly_detectors/{job_id}/_stats" ], "parts": { "job_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_lists.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_lists.json similarity index 74% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_lists.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_lists.json index 8077e26494b..9ee2754dda5 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_lists.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_lists.json @@ -1,9 +1,9 @@ { - "xpack.prelert.get_lists": { + "xpack.ml.get_lists": { "methods": [ "GET" ], "url": { - "path": "/_xpack/prelert/lists/{list_id}", - "paths": [ "/_xpack/prelert/lists/", "/_xpack/prelert/lists/{list_id}" ], + "path": "/_xpack/ml/lists/{list_id}", + "paths": [ "/_xpack/ml/lists/", "/_xpack/ml/lists/{list_id}" ], "parts": { "list_id": { "type" : "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_model_snapshots.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_model_snapshots.json similarity index 85% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_model_snapshots.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_model_snapshots.json index 7511c9ebccf..98e0106beb9 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_model_snapshots.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_model_snapshots.json @@ -1,9 +1,9 @@ { - "xpack.prelert.get_model_snapshots": { + "xpack.ml.get_model_snapshots": { "methods": [ "GET", "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_records.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_records.json similarity index 88% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_records.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_records.json index f21967669e5..59169cf15bf 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_records.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_records.json @@ -1,10 +1,10 @@ { - "xpack.prelert.get_records": { + "xpack.ml.get_records": { "methods": ["GET", "POST"], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/records", + "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/records", "paths": [ - "/_xpack/prelert/anomaly_detectors/{job_id}/results/records" + "/_xpack/ml/anomaly_detectors/{job_id}/results/records" ], "parts": { "job_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_schedulers.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_schedulers.json similarity index 65% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_schedulers.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_schedulers.json index fc0fc692fb9..c45fe54864c 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_schedulers.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_schedulers.json @@ -1,10 +1,10 @@ { - "xpack.prelert.get_schedulers": { + "xpack.ml.get_schedulers": { "methods": [ "GET"], "url": { - "path": "/_xpack/prelert/schedulers/{scheduler_id}", + "path": "/_xpack/ml/schedulers/{scheduler_id}", "paths": [ - "/_xpack/prelert/schedulers/{scheduler_id}" + "/_xpack/ml/schedulers/{scheduler_id}" ], "parts": { "scheduler_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_schedulers_stats.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_schedulers_stats.json similarity index 62% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_schedulers_stats.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_schedulers_stats.json index 217d7415b62..f5e41df55cd 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.get_schedulers_stats.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.get_schedulers_stats.json @@ -1,10 +1,10 @@ { - "xpack.prelert.get_schedulers_stats": { + "xpack.ml.get_schedulers_stats": { "methods": [ "GET"], "url": { - "path": "/_xpack/prelert/schedulers/{scheduler_id}/_stats", + "path": "/_xpack/ml/schedulers/{scheduler_id}/_stats", "paths": [ - "/_xpack/prelert/schedulers/{scheduler_id}/_stats" + "/_xpack/ml/schedulers/{scheduler_id}/_stats" ], "parts": { "scheduler_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.job_data.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.job_data.json similarity index 80% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.job_data.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.job_data.json index ccece9af34a..7879d41d582 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.job_data.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.job_data.json @@ -1,9 +1,9 @@ { - "xpack.prelert.job_data": { + "xpack.ml.job_data": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/data", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/data" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/data", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/data" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.open_job.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.open_job.json similarity index 78% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.open_job.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.open_job.json index c35c4c6923a..ef15372d5ec 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.open_job.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.open_job.json @@ -1,9 +1,9 @@ { - "xpack.prelert.open_job": { + "xpack.ml.open_job": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/_open", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/_open" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/_open", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/_open" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_job.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_job.json similarity index 66% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_job.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_job.json index 2926466a0f2..a6f3d853fc5 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_job.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_job.json @@ -1,9 +1,9 @@ { - "xpack.prelert.put_job": { + "xpack.ml.put_job": { "methods": [ "PUT" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors", - "paths": [ "/_xpack/prelert/anomaly_detectors" ], + "path": "/_xpack/ml/anomaly_detectors", + "paths": [ "/_xpack/ml/anomaly_detectors" ], "params": { "overwrite": { "type": "boolean", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_list.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_list.json similarity index 58% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_list.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_list.json index d2e4ed32d4d..fb5bd40af33 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_list.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_list.json @@ -1,9 +1,9 @@ { - "xpack.prelert.put_list": { + "xpack.ml.put_list": { "methods": [ "PUT" ], "url": { - "path": "/_xpack/prelert/lists", - "paths": [ "/_xpack/prelert/lists" ], + "path": "/_xpack/ml/lists", + "paths": [ "/_xpack/ml/lists" ], "params": {} }, "body": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_model_snapshot_description.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_model_snapshot_description.json similarity index 67% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_model_snapshot_description.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_model_snapshot_description.json index 24cc30b4086..6c05aba619d 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_model_snapshot_description.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_model_snapshot_description.json @@ -1,9 +1,9 @@ { - "xpack.prelert.put_model_snapshot_description": { + "xpack.ml.put_model_snapshot_description": { "methods": [ "PUT" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_scheduler.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_scheduler.json similarity index 67% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_scheduler.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_scheduler.json index 4ad0e62a767..aefa5ee6d5b 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.put_scheduler.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.put_scheduler.json @@ -1,9 +1,9 @@ { - "xpack.prelert.put_scheduler": { + "xpack.ml.put_scheduler": { "methods": [ "PUT" ], "url": { - "path": "/_xpack/prelert/schedulers/{scheduler_id}", - "paths": [ "/_xpack/prelert/schedulers/{scheduler_id}" ], + "path": "/_xpack/ml/schedulers/{scheduler_id}", + "paths": [ "/_xpack/ml/schedulers/{scheduler_id}" ], "parts": { "scheduler_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.revert_model_snapshot.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.revert_model_snapshot.json similarity index 80% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.revert_model_snapshot.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.revert_model_snapshot.json index 883ad1de914..798d49225af 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.revert_model_snapshot.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.revert_model_snapshot.json @@ -1,9 +1,9 @@ { - "xpack.prelert.revert_model_snapshot": { + "xpack.ml.revert_model_snapshot": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/_revert", - "paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/_revert" ], + "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/_revert", + "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/_revert" ], "parts": { "job_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.start_scheduler.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.start_scheduler.json similarity index 83% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.start_scheduler.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.start_scheduler.json index 30ab4ecaca4..559599202af 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.start_scheduler.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.start_scheduler.json @@ -1,9 +1,9 @@ { - "xpack.prelert.start_scheduler": { + "xpack.ml.start_scheduler": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/schedulers/{scheduler_id}/_start", - "paths": [ "/_xpack/prelert/schedulers/{scheduler_id}/_start" ], + "path": "/_xpack/ml/schedulers/{scheduler_id}/_start", + "paths": [ "/_xpack/ml/schedulers/{scheduler_id}/_start" ], "parts": { "scheduler_id": { "type": "string", diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.stop_scheduler.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.stop_scheduler.json similarity index 74% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.stop_scheduler.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.stop_scheduler.json index 486e1c78ffd..5bb3f4a3bc2 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.stop_scheduler.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.stop_scheduler.json @@ -1,12 +1,12 @@ { - "xpack.prelert.stop_scheduler": { + "xpack.ml.stop_scheduler": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/schedulers/{scheduler_id}/_stop", + "path": "/_xpack/ml/schedulers/{scheduler_id}/_stop", "paths": [ - "/_xpack/prelert/schedulers/{scheduler_id}/_stop" + "/_xpack/ml/schedulers/{scheduler_id}/_stop" ], "parts": { "scheduler_id": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_detector.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_detector.json similarity index 51% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_detector.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_detector.json index 7c85d34bbfe..ceaf18c92fd 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_detector.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_detector.json @@ -1,9 +1,9 @@ { - "xpack.prelert.validate_detector": { + "xpack.ml.validate_detector": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/_validate/detector", - "paths": [ "/_xpack/prelert/_validate/detector" ], + "path": "/_xpack/ml/_validate/detector", + "paths": [ "/_xpack/ml/_validate/detector" ], "params": {} }, "body": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_transform.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_transform.json similarity index 51% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_transform.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_transform.json index b2cf6a18787..156beff82b7 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_transform.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_transform.json @@ -1,9 +1,9 @@ { - "xpack.prelert.validate_transform": { + "xpack.ml.validate_transform": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/_validate/transform", - "paths": [ "/_xpack/prelert/_validate/transform" ], + "path": "/_xpack/ml/_validate/transform", + "paths": [ "/_xpack/ml/_validate/transform" ], "params": {} }, "body": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_transforms.json b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_transforms.json similarity index 51% rename from elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_transforms.json rename to elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_transforms.json index 612d8006325..65f72f6e7bf 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/api/xpack.prelert.validate_transforms.json +++ b/elasticsearch/src/test/resources/rest-api-spec/api/xpack.ml.validate_transforms.json @@ -1,9 +1,9 @@ { - "xpack.prelert.validate_transforms": { + "xpack.ml.validate_transforms": { "methods": [ "POST" ], "url": { - "path": "/_xpack/prelert/_validate/transforms", - "paths": [ "/_xpack/prelert/_validate/transforms" ], + "path": "/_xpack/ml/_validate/transforms", + "paths": [ "/_xpack/ml/_validate/transforms" ], "params": {} }, "body": { diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/delete_model_snapshot.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/delete_model_snapshot.yaml index 418a2b4ea8b..c8003e9e6cb 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/delete_model_snapshot.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/delete_model_snapshot.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id": "foo", @@ -17,11 +17,11 @@ setup: } - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: foo - do: - xpack.prelert.close_job: + xpack.ml.close_job: job_id: foo - do: @@ -89,20 +89,20 @@ setup: "Test delete snapshot missing snapshotId": - do: catch: param - xpack.prelert.delete_model_snapshot: + xpack.ml.delete_model_snapshot: job_id: "foo" --- "Test delete snapshot missing job_id": - do: catch: param - xpack.prelert.delete_model_snapshot: + xpack.ml.delete_model_snapshot: snapshot_id: "foo" --- "Test valid delete snapshot": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" - match: { count: 2 } @@ -114,7 +114,7 @@ setup: - match: { count: 2 } - do: - xpack.prelert.delete_model_snapshot: + xpack.ml.delete_model_snapshot: job_id: "foo" snapshot_id: "foo1" - match: { acknowledged: true } @@ -128,7 +128,7 @@ setup: index: .ml-state - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" - match: { count: 1 } - match: { model_snapshots.0.snapshot_id: "foo2"} @@ -143,12 +143,12 @@ setup: --- "Test delete with in-use model": - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" snapshot_id: "foo2" - do: catch: request - xpack.prelert.delete_model_snapshot: + xpack.ml.delete_model_snapshot: job_id: "foo" snapshot_id: "foo2" diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/get_model_snapshots.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/get_model_snapshots.yaml index 033fb005228..81b2de0ac45 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/get_model_snapshots.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/get_model_snapshots.yaml @@ -32,7 +32,7 @@ setup: --- "Test get model snapshots API with no params": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" @@ -43,7 +43,7 @@ setup: --- "Test get model snapshots API with start/end": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" start: "2016-05-01T00:00:00Z" end: "2016-07-01T00:00:00Z" @@ -56,7 +56,7 @@ setup: --- "Test get model snapshots API with ascending": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" desc: false @@ -68,7 +68,7 @@ setup: --- "Test get model snapshots API with size": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" size: 1 @@ -81,7 +81,7 @@ setup: --- "Test get model snapshots API with from": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" from: 1 diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers.yaml index 9978871b411..bac572c5596 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-1", @@ -16,7 +16,7 @@ setup: } - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-2", @@ -32,7 +32,7 @@ setup: } - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: scheduler-1 body: > { @@ -42,7 +42,7 @@ setup: } - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: scheduler-2 body: > { @@ -56,20 +56,20 @@ setup: - do: catch: missing - xpack.prelert.get_schedulers: + xpack.ml.get_schedulers: scheduler_id: missing-scheduler --- "Test get single scheduler": - do: - xpack.prelert.get_schedulers: + xpack.ml.get_schedulers: scheduler_id: scheduler-1 - match: { schedulers.0.scheduler_id: "scheduler-1"} - match: { schedulers.0.job_id: "job-1"} - do: - xpack.prelert.get_schedulers: + xpack.ml.get_schedulers: scheduler_id: scheduler-2 - match: { schedulers.0.scheduler_id: "scheduler-2"} - match: { schedulers.0.job_id: "job-2"} @@ -78,7 +78,7 @@ setup: "Test get all schedulers": - do: - xpack.prelert.get_schedulers: + xpack.ml.get_schedulers: scheduler_id: _all - match: { count: 2 } - match: { schedulers.0.scheduler_id: "scheduler-1"} diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers_stats.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers_stats.yaml index 8eabeddf0bf..5a16b8f9c39 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers_stats.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/get_schedulers_stats.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-1", @@ -16,7 +16,7 @@ setup: } - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-2", @@ -32,7 +32,7 @@ setup: } - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: scheduler-1 body: > { @@ -42,7 +42,7 @@ setup: } - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: scheduler-2 body: > { @@ -56,20 +56,20 @@ setup: - do: catch: missing - xpack.prelert.get_schedulers_stats: + xpack.ml.get_schedulers_stats: scheduler_id: missing-scheduler --- "Test get single scheduler stats": - do: - xpack.prelert.get_schedulers_stats: + xpack.ml.get_schedulers_stats: scheduler_id: scheduler-1 - match: { schedulers.0.scheduler_id: "scheduler-1"} - match: { schedulers.0.status: "STOPPED"} - do: - xpack.prelert.get_schedulers_stats: + xpack.ml.get_schedulers_stats: scheduler_id: scheduler-2 - match: { schedulers.0.scheduler_id: "scheduler-2"} - match: { schedulers.0.status: "STOPPED"} @@ -78,7 +78,7 @@ setup: "Test get all schedulers stats": - do: - xpack.prelert.get_schedulers_stats: + xpack.ml.get_schedulers_stats: scheduler_id: _all - match: { count: 2 } - match: { schedulers.0.scheduler_id: "scheduler-1"} diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_crud.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_crud.yaml index 8c9d196bd11..c09c297208b 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_crud.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_crud.yaml @@ -1,7 +1,7 @@ --- "Test job crud apis": - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote", @@ -27,13 +27,13 @@ index: ".ml-state" - do: - xpack.prelert.get_jobs: + xpack.ml.get_jobs: job_id: "farequote" - match: { count: 1 } - match: { jobs.0.job_id: "farequote" } - do: - xpack.prelert.delete_job: + xpack.ml.delete_job: job_id: "farequote" - match: { acknowledged: true } @@ -46,13 +46,13 @@ "Test get job API with non existing job id": - do: catch: missing - xpack.prelert.get_jobs: + xpack.ml.get_jobs: job_id: "non-existing" --- "Test put job with id that is already taken": - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote", @@ -71,7 +71,7 @@ - do: catch: /resource_already_exists_exception/ - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote", @@ -88,7 +88,7 @@ } - do: catch: /The job cannot be created with the Id 'farequote'. The Id is already used./ - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote", @@ -105,7 +105,7 @@ } - do: catch: param - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote", @@ -124,7 +124,7 @@ --- "Test delete job that is referred by a scheduler": - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"scheduler-job", @@ -142,7 +142,7 @@ - match: { job_id: "scheduler-job" } - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -154,5 +154,5 @@ - do: catch: /Cannot delete job \[scheduler-job\] while scheduler \[test-scheduler-1\] refers to it/ - xpack.prelert.delete_job: + xpack.ml.delete_job: job_id: scheduler-job diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get.yaml index 085995402c2..5d092059b7d 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-1", @@ -17,7 +17,7 @@ setup: } - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-2", @@ -38,20 +38,20 @@ setup: - do: catch: missing - xpack.prelert.get_jobs: + xpack.ml.get_jobs: job_id: missing-job --- "Test get single job": - do: - xpack.prelert.get_jobs: + xpack.ml.get_jobs: job_id: job-1 - match: { jobs.0.job_id: "job-1"} - match: { jobs.0.description: "Job 1"} - do: - xpack.prelert.get_jobs: + xpack.ml.get_jobs: job_id: job-2 - match: { jobs.0.job_id: "job-2"} - match: { jobs.0.description: "Job 2"} @@ -60,7 +60,7 @@ setup: "Test get all jobs": - do: - xpack.prelert.get_jobs: + xpack.ml.get_jobs: job_id: _all - match: { count: 2 } - match: { jobs.0.job_id: "job-1"} diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_buckets.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_buckets.yaml index aaad63cb413..ec1c9b3206a 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_buckets.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_buckets.yaml @@ -34,7 +34,7 @@ setup: --- "Test result buckets api with time range": - do: - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" start: "2016-05-01T00:00:00Z" end: "2016-07-01T00:00:00Z" @@ -47,7 +47,7 @@ setup: --- "Test result buckets api": - do: - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" - match: { count: 2 } @@ -61,7 +61,7 @@ setup: --- "Test result single bucket api": - do: - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" timestamp: "2016-06-01T00:00:00Z" @@ -73,28 +73,28 @@ setup: "Test mutually-exclusive params": - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" timestamp: "2016-06-01T00:00:00Z" start: "2016-05-01T00:00:00Z" - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" timestamp: "2016-06-01T00:00:00Z" end: "2016-05-01T00:00:00Z" - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" timestamp: "2016-06-01T00:00:00Z" from: "2016-05-01T00:00:00Z" - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" timestamp: "2016-06-01T00:00:00Z" end: "2016-05-01T00:00:00Z" @@ -103,7 +103,7 @@ setup: "Test mutually-exclusive params (via body)": - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" body: timestamp: "2016-06-01T00:00:00Z" @@ -111,7 +111,7 @@ setup: - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" body: timestamp: "2016-06-01T00:00:00Z" @@ -119,7 +119,7 @@ setup: - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" body: timestamp: "2016-06-01T00:00:00Z" @@ -127,7 +127,7 @@ setup: - do: catch: request - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "farequote" body: timestamp: "2016-06-01T00:00:00Z" diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_categories.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_categories.yaml index 3542422c21b..bfa9aabd4ce 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_categories.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_categories.yaml @@ -25,7 +25,7 @@ setup: --- "Test result categories api": - do: - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" - match: { count: 2 } @@ -37,7 +37,7 @@ setup: --- "Test result category api": - do: - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" @@ -48,21 +48,21 @@ setup: "Test with invalid param combinations": - do: catch: request - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" from: 0 - do: catch: request - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" size: 1 - do: catch: request - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" from: 0 @@ -72,7 +72,7 @@ setup: "Test with invalid param combinations (via body)": - do: catch: request - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" body: @@ -80,7 +80,7 @@ setup: - do: catch: request - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" body: @@ -88,7 +88,7 @@ setup: - do: catch: request - xpack.prelert.get_categories: + xpack.ml.get_categories: job_id: "farequote" category_id: "1" body: diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_influencers.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_influencers.yaml index 619f7a7eff8..18d74700fc2 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_influencers.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_influencers.yaml @@ -54,7 +54,7 @@ setup: --- "Test result influencers api": - do: - xpack.prelert.get_influencers: + xpack.ml.get_influencers: job_id: "farequote" - match: { count: 2 } @@ -64,7 +64,7 @@ setup: --- "Test result influencers api with time range": - do: - xpack.prelert.get_influencers: + xpack.ml.get_influencers: job_id: "farequote" start: "2016-06-01T00:00:00Z" end: "2016-06-01T01:00:00Z" diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_records.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_records.yaml index bc1f700b8cf..89634807e88 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_records.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_result_records.yaml @@ -64,7 +64,7 @@ setup: --- "Test result records api": - do: - xpack.prelert.get_records: + xpack.ml.get_records: job_id: "farequote" - match: { count: 2 } @@ -78,7 +78,7 @@ setup: --- "Test result records api with time range": - do: - xpack.prelert.get_records: + xpack.ml.get_records: job_id: "farequote" start: "2016-05-01T00:00:00Z" end: "2016-06-01T01:00:00Z" diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml index 2b51c2f7eff..101385aa8fb 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/jobs_get_stats.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-stats-test", @@ -17,11 +17,11 @@ setup: } - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: job-stats-test - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"scheduled-job", @@ -37,11 +37,11 @@ setup: } } - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: scheduled-job - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: scheduler-1 body: > { @@ -68,20 +68,20 @@ setup: "Test get job stats after uploading data prompting the creation of some stats": - do: - xpack.prelert.job_data: + xpack.ml.job_data: job_id: job-stats-test body: > {"airline":"AAL","responsetime":"132.2046","time":"1403481600"} {"airline":"JZA","responsetime":"990.4628","time":"1403481600"} - do: - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: job-stats-test - match: { acknowledged: true } - do: - xpack.prelert.get_jobs_stats: + xpack.ml.get_jobs_stats: job_id: job-stats-test - match: { jobs.0.job_id : job-stats-test } - match: { jobs.0.data_counts.processed_record_count: 2 } @@ -94,7 +94,7 @@ setup: "Test get job stats of scheduled job that has not received and data": - do: - xpack.prelert.get_jobs_stats: + xpack.ml.get_jobs_stats: job_id: scheduled-job - match: { jobs.0.job_id : scheduled-job } - match: { jobs.0.data_counts.processed_record_count: 0 } @@ -106,5 +106,5 @@ setup: - do: catch: missing - xpack.prelert.get_jobs_stats: + xpack.ml.get_jobs_stats: job_id: unknown-job diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/list_crud.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/list_crud.yaml index e9fe816cbf4..a112db5a9f5 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/list_crud.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/list_crud.yaml @@ -1,7 +1,7 @@ --- setup: - do: - xpack.prelert.put_list: + xpack.ml.put_list: body: > { "id": "foo", @@ -9,7 +9,7 @@ setup: } - do: - xpack.prelert.put_list: + xpack.ml.put_list: body: > { "id": "foo2", @@ -24,14 +24,14 @@ setup: - do: catch: missing - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "do_not_exist" --- "Test get list API": - do: - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo" - match: { count: 1 } @@ -44,7 +44,7 @@ setup: "Test get lists API": - do: - xpack.prelert.get_lists: {} + xpack.ml.get_lists: {} - match: { count: 2 } - match: @@ -58,7 +58,7 @@ setup: items: ["123", "lmnop"] - do: - xpack.prelert.get_lists: + xpack.ml.get_lists: from: 1 size: 1 @@ -69,26 +69,26 @@ setup: - do: catch: request - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo" from: 0 - do: catch: request - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo" size: 1 - do: catch: request - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo" from: 0 size: 1 --- "Test create list api": - do: - xpack.prelert.put_list: + xpack.ml.put_list: body: > { "id": "foo2", @@ -98,7 +98,7 @@ setup: - match: { acknowledged: true } - do: - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo2" - match: { count: 1 } @@ -111,7 +111,7 @@ setup: "Test create list api without ID": - do: catch: /illegal_argument_exception/ - xpack.prelert.put_list: + xpack.ml.put_list: body: > { "items": ["abc", "xyz"] @@ -120,7 +120,7 @@ setup: --- "Test delete in-use list": - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote2", @@ -147,21 +147,21 @@ setup: } - do: catch: conflict - xpack.prelert.delete_list: + xpack.ml.delete_list: list_id: "foo" --- "Test non-existing list": - do: catch: missing - xpack.prelert.delete_list: + xpack.ml.delete_list: list_id: "does_not_exist" --- "Test valid delete list": - do: - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo" - match: { count: 1 } @@ -171,10 +171,10 @@ setup: items: ["abc", "xyz"] - do: - xpack.prelert.delete_list: + xpack.ml.delete_list: list_id: "foo" - do: catch: missing - xpack.prelert.get_lists: + xpack.ml.get_lists: list_id: "foo" diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/post_data.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/post_data.yaml index 80bd39601d1..6f1fadeb75d 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/post_data.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/post_data.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"farequote", @@ -17,7 +17,7 @@ setup: } - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"closed_job", @@ -31,13 +31,13 @@ setup: } - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: farequote --- "Test POST data job api, flush, close and verify DataCounts doc": - do: - xpack.prelert.job_data: + xpack.ml.job_data: job_id: farequote body: > {"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"} @@ -54,17 +54,17 @@ setup: - match: { latest_record_timestamp: 1403481700000} - do: - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: farequote - match: { acknowledged: true } - do: - xpack.prelert.close_job: + xpack.ml.close_job: job_id: farequote - match: { acknowledged: true } - do: - xpack.prelert.get_jobs_stats: + xpack.ml.get_jobs_stats: job_id: farequote - match: { jobs.0.status: "CLOSED" } @@ -87,17 +87,17 @@ setup: --- "Test flush and close job WITHOUT sending any data": - do: - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: farequote - match: { acknowledged: true } - do: - xpack.prelert.close_job: + xpack.ml.close_job: job_id: farequote - match: { acknowledged: true } - do: - xpack.prelert.get_jobs_stats: + xpack.ml.get_jobs_stats: job_id: farequote - match: { jobs.0.status: "CLOSED" } @@ -105,13 +105,13 @@ setup: "Test POST data with invalid parameters": - do: catch: missing - xpack.prelert.job_data: + xpack.ml.job_data: job_id: not_a_job body: {} - do: catch: /parse_exception/ - xpack.prelert.job_data: + xpack.ml.job_data: job_id: farequote reset_start: not_a_date body: > @@ -120,7 +120,7 @@ setup: - do: catch: /parse_exception/ - xpack.prelert.job_data: + xpack.ml.job_data: job_id: farequote reset_end: end_not_a_date body: > @@ -131,24 +131,24 @@ setup: "Test Flush data with invalid parameters": - do: catch: missing - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: not_a_job - do: catch: /parse_exception/ - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: farequote start: not_a_date - do: catch: /parse_exception/ - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: farequote end: end_not_a_date - do: catch: /parse_exception/ - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: farequote advance_time: advance_time_not_a_date @@ -156,28 +156,28 @@ setup: "Test open and close with non-existent job id": - do: catch: missing - xpack.prelert.open_job: + xpack.ml.open_job: job_id: not_a_job - do: catch: missing - xpack.prelert.close_job: + xpack.ml.close_job: job_id: not_a_job --- "Test flushing, posting and closing a closed job": - do: catch: /illegal_argument_exception/ - xpack.prelert.flush_job: + xpack.ml.flush_job: job_id: closed_job - do: catch: /illegal_argument_exception/ - xpack.prelert.close_job: + xpack.ml.close_job: job_id: closed_job - do: catch: /illegal_argument_exception/ - xpack.prelert.job_data: + xpack.ml.job_data: job_id: closed_job body: {} diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/put_model_snapshot_description.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/put_model_snapshot_description.yaml index 170456b6e71..55bf3a4208d 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/put_model_snapshot_description.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/put_model_snapshot_description.yaml @@ -46,7 +46,7 @@ setup: "Test without description": - do: catch: request - xpack.prelert.put_model_snapshot_description: + xpack.ml.put_model_snapshot_description: job_id: "foo" snapshot_id: "foo" body: > @@ -57,7 +57,7 @@ setup: --- "Test with valid description": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" description: "new_description" @@ -65,7 +65,7 @@ setup: - length: { model_snapshots: 0 } - do: - xpack.prelert.put_model_snapshot_description: + xpack.ml.put_model_snapshot_description: job_id: "foo" snapshot_id: "foo" body: > @@ -81,7 +81,7 @@ setup: index: .ml-anomalies-foo - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" description: "new_description" @@ -92,7 +92,7 @@ setup: --- "Test with conflict against existing description": - do: - xpack.prelert.get_model_snapshots: + xpack.ml.get_model_snapshots: job_id: "foo" description: "bar" @@ -103,7 +103,7 @@ setup: - do: catch: request - xpack.prelert.put_model_snapshot_description: + xpack.ml.put_model_snapshot_description: job_id: "foo" snapshot_id: "foo" body: > diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/revert_model_snapshot.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/revert_model_snapshot.yaml index c858d012280..3e45ae86f69 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/revert_model_snapshot.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/revert_model_snapshot.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"foo", @@ -17,11 +17,11 @@ setup: } - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: foo - do: - xpack.prelert.close_job: + xpack.ml.close_job: job_id: foo - do: @@ -135,14 +135,14 @@ setup: "Test revert model with only job_id": - do: catch: request - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" --- "Test revert model with invalid time": - do: catch: request - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" time: "foo" @@ -150,7 +150,7 @@ setup: "Test revert model with invalid snapshotId": - do: catch: /resource_not_found_exception/ - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" snapshot_id: "not_exist" @@ -158,14 +158,14 @@ setup: "Test revert model with invalid description": - do: catch: /resource_not_found_exception/ - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" description: "foo" --- "Test revert model with valid snapshotId": - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" snapshot_id: "foo1" @@ -177,7 +177,7 @@ setup: - match: { model.snapshot_doc_count: 0 } - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" snapshot_id: "foo2" @@ -191,7 +191,7 @@ setup: --- "Test revert model with valid time": - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" time: "2016-06-02T01:00:00Z" @@ -203,7 +203,7 @@ setup: - match: { model.snapshot_doc_count: 0 } - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" time: "2016-06-01T01:00:00Z" @@ -217,7 +217,7 @@ setup: --- "Test revert model with valid description": - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" description: "first" @@ -229,7 +229,7 @@ setup: - match: { model.snapshot_doc_count: 0 } - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" description: "second" @@ -243,7 +243,7 @@ setup: --- "Test revert model with deleteInterveningResults": - do: - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "foo" start: "2016-01-01T00:00:00Z" end: "2016-12-01T00:00:00Z" @@ -251,7 +251,7 @@ setup: - match: { count: 3 } - do: - xpack.prelert.revert_model_snapshot: + xpack.ml.revert_model_snapshot: job_id: "foo" snapshot_id: "foo2" delete_intervening_results: true @@ -261,7 +261,7 @@ setup: index: .ml-anomalies-foo - do: - xpack.prelert.get_buckets: + xpack.ml.get_buckets: job_id: "foo" start: "2016-01-01T00:00:00Z" end: "2016-12-01T00:00:00Z" @@ -271,7 +271,7 @@ setup: - match: { buckets.0.timestamp: 1462060800000 } - do: - xpack.prelert.get_records: + xpack.ml.get_records: job_id: "foo" start: "2016-01-01T00:00:00Z" end: "2016-12-01T00:00:00Z" @@ -281,7 +281,7 @@ setup: - match: { records.0.timestamp: 1462060800000 } - do: - xpack.prelert.get_influencers: + xpack.ml.get_influencers: job_id: "foo" start: "2016-01-01T00:00:00Z" end: "2016-12-01T01:00:00Z" @@ -291,7 +291,7 @@ setup: - match: { influencers.0.timestamp: 1462060800000 } - do: - xpack.prelert.get_jobs_stats: + xpack.ml.get_jobs_stats: job_id: foo - match: { jobs.0.data_counts.latest_record_timestamp: 1464739200000 } diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/schedulers_crud.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/schedulers_crud.yaml index b7dd35b111f..326e51c3af5 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/schedulers_crud.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/schedulers_crud.yaml @@ -1,6 +1,6 @@ setup: - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-1", @@ -16,7 +16,7 @@ setup: } - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"job-2", @@ -34,7 +34,7 @@ setup: "Test put scheduler referring to missing job_id": - do: catch: /resource_not_found_exception/ - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -46,7 +46,7 @@ setup: --- "Test put scheduler referring to existing job_id": - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -59,7 +59,7 @@ setup: --- "Test put scheduler whose id is already taken": - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -71,7 +71,7 @@ setup: - do: catch: /resource_already_exists_exception/ - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -83,7 +83,7 @@ setup: --- "Test put scheduler with job_id that is already used by another scheduler": - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -95,7 +95,7 @@ setup: - do: catch: /A scheduler \[test-scheduler-1\] already exists for job \[job-1\]/ - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-2 body: > { @@ -108,7 +108,7 @@ setup: "Test put scheduler with invalid query": - do: catch: /parsing_exception/ - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -122,13 +122,13 @@ setup: "Test delete scheduler with missing id": - do: catch: /resource_not_found_exception/ - xpack.prelert.delete_scheduler: + xpack.ml.delete_scheduler: scheduler_id: a-missing-scheduler --- "Test delete scheduler": - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: test-scheduler-1 body: > { @@ -139,6 +139,6 @@ setup: - match: { scheduler_id: "test-scheduler-1" } - do: - xpack.prelert.delete_scheduler: + xpack.ml.delete_scheduler: scheduler_id: test-scheduler-1 - match: { acknowledged: true } diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/start_stop_scheduler.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/start_stop_scheduler.yaml index dd3a20d92b5..d59246e8512 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/start_stop_scheduler.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/start_stop_scheduler.yaml @@ -4,7 +4,7 @@ setup: index: airline-data - do: - xpack.prelert.put_job: + xpack.ml.put_job: body: > { "job_id":"scheduled-job", @@ -20,7 +20,7 @@ setup: } } - do: - xpack.prelert.put_scheduler: + xpack.ml.put_scheduler: scheduler_id: scheduler-1 body: > { @@ -31,28 +31,28 @@ setup: --- "Test start and stop scheduler happy path": - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: "scheduled-job" - do: - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "scheduler-1" "start": 0 - do: - xpack.prelert.get_schedulers_stats: + xpack.ml.get_schedulers_stats: scheduler_id: "scheduler-1" - match: { schedulers.0.status: STARTED } - do: - xpack.prelert.stop_scheduler: + xpack.ml.stop_scheduler: "scheduler_id": "scheduler-1" - do: - xpack.prelert.get_schedulers_stats: + xpack.ml.get_schedulers_stats: scheduler_id: "scheduler-1" - match: { schedulers.0.status: STOPPED } --- "Test start non existing scheduler": - do: catch: missing - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "non-existing-scheduler" "start": 0 @@ -60,33 +60,33 @@ setup: "Test start scheduled job, but not open": - do: catch: conflict - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "scheduler-1" "start": 0 - do: catch: /cannot start scheduler, expected job status \[OPENED\], but got \[CLOSED\]/ - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "scheduler-1" "start": 0 --- "Test start already started scheduled job": - do: - xpack.prelert.open_job: + xpack.ml.open_job: job_id: "scheduled-job" - do: - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "scheduler-1" "start": 0 - do: catch: conflict - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "scheduler-1" "start": 0 - do: catch: /scheduler already started, expected scheduler status \[STOPPED\], but got \[STARTED\]/ - xpack.prelert.start_scheduler: + xpack.ml.start_scheduler: "scheduler_id": "scheduler-1" "start": 0 @@ -94,16 +94,16 @@ setup: "Test stop non existing scheduler": - do: catch: missing - xpack.prelert.stop_scheduler: + xpack.ml.stop_scheduler: "scheduler_id": "non-existing-scheduler" --- "Test stop already stopped scheduled job": - do: catch: conflict - xpack.prelert.stop_scheduler: + xpack.ml.stop_scheduler: "scheduler_id": "scheduler-1" - do: catch: /scheduler already stopped, expected scheduler status \[STARTED\], but got \[STOPPED\]/ - xpack.prelert.stop_scheduler: + xpack.ml.stop_scheduler: "scheduler_id": "scheduler-1" diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/validate_detector.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/validate_detector.yaml index 30c20721202..709e98f77d9 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/validate_detector.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/validate_detector.yaml @@ -1,7 +1,7 @@ --- "Test valid detector": - do: - xpack.prelert.validate_detector: + xpack.ml.validate_detector: body: > { "function":"count", @@ -13,7 +13,7 @@ "Test invalid detector": - do: catch: /field_name must be set when the 'mean' function is used/ - xpack.prelert.validate_detector: + xpack.ml.validate_detector: body: > { "function":"mean", diff --git a/elasticsearch/src/test/resources/rest-api-spec/test/validate_transform.yaml b/elasticsearch/src/test/resources/rest-api-spec/test/validate_transform.yaml index 74f177786d3..d6e37dbefe6 100644 --- a/elasticsearch/src/test/resources/rest-api-spec/test/validate_transform.yaml +++ b/elasticsearch/src/test/resources/rest-api-spec/test/validate_transform.yaml @@ -1,7 +1,7 @@ --- "Test valid transform": - do: - xpack.prelert.validate_transform: + xpack.ml.validate_transform: body: > { "transform":"concat", @@ -14,7 +14,7 @@ "Test invalid transform": - do: catch: /Transform type concat expected \[2‥\+∞\) input\(s\), got 1/ - xpack.prelert.validate_transform: + xpack.ml.validate_transform: body: > { "transform":"concat", @@ -24,7 +24,7 @@ --- "Test valid transforms": - do: - xpack.prelert.validate_transforms: + xpack.ml.validate_transforms: body: > { "transforms": [ @@ -45,7 +45,7 @@ "Test invalid transforms": - do: catch: /Transform type concat with inputs \[one, two\] has a circular dependency/ - xpack.prelert.validate_transforms: + xpack.ml.validate_transforms: body: > { "transforms": [