Rename prelert to ml in endpoint base path (elastic/elasticsearch#639)

Original commit: elastic/x-pack-elasticsearch@ff6745e545
This commit is contained in:
David Roberts 2017-01-05 08:18:43 +00:00 committed by GitHub
parent f98b4a967c
commit c7cfa56aaf
50 changed files with 275 additions and 275 deletions

View File

@ -126,7 +126,7 @@ import java.util.List;
public class PrelertPlugin extends Plugin implements ActionPlugin { public class PrelertPlugin extends Plugin implements ActionPlugin {
public static final String NAME = "prelert"; 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 THREAD_POOL_NAME = NAME;
public static final String SCHEDULED_RUNNER_THREAD_POOL_NAME = NAME + "_scheduled_runner"; public static final String SCHEDULED_RUNNER_THREAD_POOL_NAME = NAME + "_scheduled_runner";
public static final String AUTODETECT_PROCESS_THREAD_POOL_NAME = NAME + "_autodetect_process"; public static final String AUTODETECT_PROCESS_THREAD_POOL_NAME = NAME + "_autodetect_process";

View File

@ -43,11 +43,11 @@ public class PrelertRestTestStateCleaner {
Map<String, Object> schedulerMap = (Map<String, Object>) scheduler.get("config"); Map<String, Object> schedulerMap = (Map<String, Object>) scheduler.get("config");
String schedulerId = (String) schedulerMap.get("scheduler_id"); String schedulerId = (String) schedulerMap.get("scheduler_id");
try { try {
client.performRequest("POST", "/_xpack/prelert/schedulers/" + schedulerId + "/_stop"); client.performRequest("POST", "/_xpack/ml/schedulers/" + schedulerId + "/_stop");
} catch (Exception e) { } catch (Exception e) {
// ignore // ignore
} }
client.performRequest("DELETE", "/_xpack/prelert/schedulers/" + schedulerId); client.performRequest("DELETE", "/_xpack/ml/schedulers/" + schedulerId);
} }
} }
@ -64,11 +64,11 @@ public class PrelertRestTestStateCleaner {
for (Map<String, Object> jobConfig : jobConfigs) { for (Map<String, Object> jobConfig : jobConfigs) {
String jobId = (String) jobConfig.get("job_id"); String jobId = (String) jobConfig.get("job_id");
try { try {
client.performRequest("POST", "/_xpack/prelert/anomaly_detectors/" + jobId + "/_close"); client.performRequest("POST", "/_xpack/ml/anomaly_detectors/" + jobId + "/_close");
} catch (Exception e) { } catch (Exception e) {
// ignore // ignore
} }
client.performRequest("DELETE", "/_xpack/prelert/anomaly_detectors/" + jobId); client.performRequest("DELETE", "/_xpack/ml/anomaly_detectors/" + jobId);
} }
} }
} }

View File

@ -82,7 +82,7 @@ public class ScheduledJobIT extends ESRestTestCase {
assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); assertThat(response.getStatusLine().getStatusCode(), equalTo(200));
assertThat(responseEntityToString(response), equalTo("{\"acknowledged\":true}")); 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); response = client().performRequest("delete", PrelertPlugin.BASE_PATH + "schedulers/" + schedulerId);
assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); assertThat(response.getStatusLine().getStatusCode(), equalTo(200));

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.close_job": { "xpack.ml.close_job": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/_close", "path": "/_xpack/ml/anomaly_detectors/{job_id}/_close",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/_close" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/_close" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",
@ -17,4 +17,4 @@
} }
} }
} }
} }

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.delete_job": { "xpack.ml.delete_job": {
"methods": [ "DELETE" ], "methods": [ "DELETE" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}", "path": "/_xpack/ml/anomaly_detectors/{job_id}",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.delete_list": { "xpack.ml.delete_list": {
"methods": [ "DELETE" ], "methods": [ "DELETE" ],
"url": { "url": {
"path": "/_xpack/prelert/lists/{list_id}", "path": "/_xpack/ml/lists/{list_id}",
"paths": [ "/_xpack/prelert/lists/{list_id}" ], "paths": [ "/_xpack/ml/lists/{list_id}" ],
"parts": { "parts": {
"list_id": { "list_id": {
"type" : "string", "type" : "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.delete_model_snapshot": { "xpack.ml.delete_model_snapshot": {
"methods": [ "DELETE" ], "methods": [ "DELETE" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}", "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.delete_scheduler": { "xpack.ml.delete_scheduler": {
"methods": [ "DELETE" ], "methods": [ "DELETE" ],
"url": { "url": {
"path": "/_xpack/prelert/schedulers/{scheduler_id}", "path": "/_xpack/ml/schedulers/{scheduler_id}",
"paths": [ "/_xpack/prelert/schedulers/{scheduler_id}" ], "paths": [ "/_xpack/ml/schedulers/{scheduler_id}" ],
"parts": { "parts": {
"scheduler_id": { "scheduler_id": {
"type": "string", "type": "string",

View File

@ -1,12 +1,12 @@
{ {
"xpack.prelert.flush_job": { "xpack.ml.flush_job": {
"methods": [ "methods": [
"POST" "POST"
], ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/_flush", "path": "/_xpack/ml/anomaly_detectors/{job_id}/_flush",
"paths": [ "paths": [
"/_xpack/prelert/anomaly_detectors/{job_id}/_flush" "/_xpack/ml/anomaly_detectors/{job_id}/_flush"
], ],
"parts": { "parts": {
"job_id": { "job_id": {
@ -38,4 +38,4 @@
"description": "Flush parameters" "description": "Flush parameters"
} }
} }
} }

View File

@ -1,11 +1,11 @@
{ {
"xpack.prelert.get_buckets": { "xpack.ml.get_buckets": {
"methods": [ "GET", "POST" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/buckets/{timestamp}", "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}",
"paths": [ "paths": [
"/_xpack/prelert/anomaly_detectors/{job_id}/results/buckets/{timestamp}", "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}",
"/_xpack/prelert/anomaly_detectors/{job_id}/results/buckets" "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets"
], ],
"parts": { "parts": {
"job_id": { "job_id": {

View File

@ -1,11 +1,11 @@
{ {
"xpack.prelert.get_categories": { "xpack.ml.get_categories": {
"methods": [ "GET", "POST" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}", "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}",
"paths": [ "paths": [
"/_xpack/prelert/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}", "/_xpack/ml/anomaly_detectors/{job_id}/results/categorydefinitions/{category_id}",
"/_xpack/prelert/anomaly_detectors/{job_id}/results/categorydefinitions/" "/_xpack/ml/anomaly_detectors/{job_id}/results/categorydefinitions/"
], ],
"parts": { "parts": {
"job_id": { "job_id": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.get_influencers": { "xpack.ml.get_influencers": {
"methods": [ "GET", "POST" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/influencers", "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/influencers",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/results/influencers" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/results/influencers" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type" : "string", "type" : "string",

View File

@ -1,10 +1,10 @@
{ {
"xpack.prelert.get_jobs": { "xpack.ml.get_jobs": {
"methods": [ "GET"], "methods": [ "GET"],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}", "path": "/_xpack/ml/anomaly_detectors/{job_id}",
"paths": [ "paths": [
"/_xpack/prelert/anomaly_detectors/{job_id}" "/_xpack/ml/anomaly_detectors/{job_id}"
], ],
"parts": { "parts": {
"job_id": { "job_id": {

View File

@ -1,10 +1,10 @@
{ {
"xpack.prelert.get_jobs_stats": { "xpack.ml.get_jobs_stats": {
"methods": [ "GET"], "methods": [ "GET"],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/_stats", "path": "/_xpack/ml/anomaly_detectors/{job_id}/_stats",
"paths": [ "paths": [
"/_xpack/prelert/anomaly_detectors/{job_id}/_stats" "/_xpack/ml/anomaly_detectors/{job_id}/_stats"
], ],
"parts": { "parts": {
"job_id": { "job_id": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.get_lists": { "xpack.ml.get_lists": {
"methods": [ "GET" ], "methods": [ "GET" ],
"url": { "url": {
"path": "/_xpack/prelert/lists/{list_id}", "path": "/_xpack/ml/lists/{list_id}",
"paths": [ "/_xpack/prelert/lists/", "/_xpack/prelert/lists/{list_id}" ], "paths": [ "/_xpack/ml/lists/", "/_xpack/ml/lists/{list_id}" ],
"parts": { "parts": {
"list_id": { "list_id": {
"type" : "string", "type" : "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.get_model_snapshots": { "xpack.ml.get_model_snapshots": {
"methods": [ "GET", "POST" ], "methods": [ "GET", "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots", "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,10 +1,10 @@
{ {
"xpack.prelert.get_records": { "xpack.ml.get_records": {
"methods": ["GET", "POST"], "methods": ["GET", "POST"],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/results/records", "path": "/_xpack/ml/anomaly_detectors/{job_id}/results/records",
"paths": [ "paths": [
"/_xpack/prelert/anomaly_detectors/{job_id}/results/records" "/_xpack/ml/anomaly_detectors/{job_id}/results/records"
], ],
"parts": { "parts": {
"job_id": { "job_id": {

View File

@ -1,10 +1,10 @@
{ {
"xpack.prelert.get_schedulers": { "xpack.ml.get_schedulers": {
"methods": [ "GET"], "methods": [ "GET"],
"url": { "url": {
"path": "/_xpack/prelert/schedulers/{scheduler_id}", "path": "/_xpack/ml/schedulers/{scheduler_id}",
"paths": [ "paths": [
"/_xpack/prelert/schedulers/{scheduler_id}" "/_xpack/ml/schedulers/{scheduler_id}"
], ],
"parts": { "parts": {
"scheduler_id": { "scheduler_id": {

View File

@ -1,10 +1,10 @@
{ {
"xpack.prelert.get_schedulers_stats": { "xpack.ml.get_schedulers_stats": {
"methods": [ "GET"], "methods": [ "GET"],
"url": { "url": {
"path": "/_xpack/prelert/schedulers/{scheduler_id}/_stats", "path": "/_xpack/ml/schedulers/{scheduler_id}/_stats",
"paths": [ "paths": [
"/_xpack/prelert/schedulers/{scheduler_id}/_stats" "/_xpack/ml/schedulers/{scheduler_id}/_stats"
], ],
"parts": { "parts": {
"scheduler_id": { "scheduler_id": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.job_data": { "xpack.ml.job_data": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/data", "path": "/_xpack/ml/anomaly_detectors/{job_id}/data",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/data" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/data" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.open_job": { "xpack.ml.open_job": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/_open", "path": "/_xpack/ml/anomaly_detectors/{job_id}/_open",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/_open" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/_open" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.put_job": { "xpack.ml.put_job": {
"methods": [ "PUT" ], "methods": [ "PUT" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors", "path": "/_xpack/ml/anomaly_detectors",
"paths": [ "/_xpack/prelert/anomaly_detectors" ], "paths": [ "/_xpack/ml/anomaly_detectors" ],
"params": { "params": {
"overwrite": { "overwrite": {
"type": "boolean", "type": "boolean",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.put_list": { "xpack.ml.put_list": {
"methods": [ "PUT" ], "methods": [ "PUT" ],
"url": { "url": {
"path": "/_xpack/prelert/lists", "path": "/_xpack/ml/lists",
"paths": [ "/_xpack/prelert/lists" ], "paths": [ "/_xpack/ml/lists" ],
"params": {} "params": {}
}, },
"body": { "body": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.put_model_snapshot_description": { "xpack.ml.put_model_snapshot_description": {
"methods": [ "PUT" ], "methods": [ "PUT" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description", "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/{snapshot_id}/description" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.put_scheduler": { "xpack.ml.put_scheduler": {
"methods": [ "PUT" ], "methods": [ "PUT" ],
"url": { "url": {
"path": "/_xpack/prelert/schedulers/{scheduler_id}", "path": "/_xpack/ml/schedulers/{scheduler_id}",
"paths": [ "/_xpack/prelert/schedulers/{scheduler_id}" ], "paths": [ "/_xpack/ml/schedulers/{scheduler_id}" ],
"parts": { "parts": {
"scheduler_id": { "scheduler_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.revert_model_snapshot": { "xpack.ml.revert_model_snapshot": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/_revert", "path": "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/_revert",
"paths": [ "/_xpack/prelert/anomaly_detectors/{job_id}/modelsnapshots/_revert" ], "paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/modelsnapshots/_revert" ],
"parts": { "parts": {
"job_id": { "job_id": {
"type": "string", "type": "string",

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.start_scheduler": { "xpack.ml.start_scheduler": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/schedulers/{scheduler_id}/_start", "path": "/_xpack/ml/schedulers/{scheduler_id}/_start",
"paths": [ "/_xpack/prelert/schedulers/{scheduler_id}/_start" ], "paths": [ "/_xpack/ml/schedulers/{scheduler_id}/_start" ],
"parts": { "parts": {
"scheduler_id": { "scheduler_id": {
"type": "string", "type": "string",

View File

@ -1,12 +1,12 @@
{ {
"xpack.prelert.stop_scheduler": { "xpack.ml.stop_scheduler": {
"methods": [ "methods": [
"POST" "POST"
], ],
"url": { "url": {
"path": "/_xpack/prelert/schedulers/{scheduler_id}/_stop", "path": "/_xpack/ml/schedulers/{scheduler_id}/_stop",
"paths": [ "paths": [
"/_xpack/prelert/schedulers/{scheduler_id}/_stop" "/_xpack/ml/schedulers/{scheduler_id}/_stop"
], ],
"parts": { "parts": {
"scheduler_id": { "scheduler_id": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.validate_detector": { "xpack.ml.validate_detector": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/_validate/detector", "path": "/_xpack/ml/_validate/detector",
"paths": [ "/_xpack/prelert/_validate/detector" ], "paths": [ "/_xpack/ml/_validate/detector" ],
"params": {} "params": {}
}, },
"body": { "body": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.validate_transform": { "xpack.ml.validate_transform": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/_validate/transform", "path": "/_xpack/ml/_validate/transform",
"paths": [ "/_xpack/prelert/_validate/transform" ], "paths": [ "/_xpack/ml/_validate/transform" ],
"params": {} "params": {}
}, },
"body": { "body": {

View File

@ -1,9 +1,9 @@
{ {
"xpack.prelert.validate_transforms": { "xpack.ml.validate_transforms": {
"methods": [ "POST" ], "methods": [ "POST" ],
"url": { "url": {
"path": "/_xpack/prelert/_validate/transforms", "path": "/_xpack/ml/_validate/transforms",
"paths": [ "/_xpack/prelert/_validate/transforms" ], "paths": [ "/_xpack/ml/_validate/transforms" ],
"params": {} "params": {}
}, },
"body": { "body": {

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id": "foo", "job_id": "foo",
@ -17,11 +17,11 @@ setup:
} }
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: foo job_id: foo
- do: - do:
xpack.prelert.close_job: xpack.ml.close_job:
job_id: foo job_id: foo
- do: - do:
@ -89,20 +89,20 @@ setup:
"Test delete snapshot missing snapshotId": "Test delete snapshot missing snapshotId":
- do: - do:
catch: param catch: param
xpack.prelert.delete_model_snapshot: xpack.ml.delete_model_snapshot:
job_id: "foo" job_id: "foo"
--- ---
"Test delete snapshot missing job_id": "Test delete snapshot missing job_id":
- do: - do:
catch: param catch: param
xpack.prelert.delete_model_snapshot: xpack.ml.delete_model_snapshot:
snapshot_id: "foo" snapshot_id: "foo"
--- ---
"Test valid delete snapshot": "Test valid delete snapshot":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
- match: { count: 2 } - match: { count: 2 }
@ -114,7 +114,7 @@ setup:
- match: { count: 2 } - match: { count: 2 }
- do: - do:
xpack.prelert.delete_model_snapshot: xpack.ml.delete_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "foo1" snapshot_id: "foo1"
- match: { acknowledged: true } - match: { acknowledged: true }
@ -128,7 +128,7 @@ setup:
index: .ml-state index: .ml-state
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
- match: { count: 1 } - match: { count: 1 }
- match: { model_snapshots.0.snapshot_id: "foo2"} - match: { model_snapshots.0.snapshot_id: "foo2"}
@ -143,12 +143,12 @@ setup:
--- ---
"Test delete with in-use model": "Test delete with in-use model":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "foo2" snapshot_id: "foo2"
- do: - do:
catch: request catch: request
xpack.prelert.delete_model_snapshot: xpack.ml.delete_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "foo2" snapshot_id: "foo2"

View File

@ -32,7 +32,7 @@ setup:
--- ---
"Test get model snapshots API with no params": "Test get model snapshots API with no params":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
@ -43,7 +43,7 @@ setup:
--- ---
"Test get model snapshots API with start/end": "Test get model snapshots API with start/end":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-07-01T00:00:00Z" end: "2016-07-01T00:00:00Z"
@ -56,7 +56,7 @@ setup:
--- ---
"Test get model snapshots API with ascending": "Test get model snapshots API with ascending":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
desc: false desc: false
@ -68,7 +68,7 @@ setup:
--- ---
"Test get model snapshots API with size": "Test get model snapshots API with size":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
size: 1 size: 1
@ -81,7 +81,7 @@ setup:
--- ---
"Test get model snapshots API with from": "Test get model snapshots API with from":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
from: 1 from: 1

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-1", "job_id":"job-1",
@ -16,7 +16,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-2", "job_id":"job-2",
@ -32,7 +32,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: scheduler-1 scheduler_id: scheduler-1
body: > body: >
{ {
@ -42,7 +42,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: scheduler-2 scheduler_id: scheduler-2
body: > body: >
{ {
@ -56,20 +56,20 @@ setup:
- do: - do:
catch: missing catch: missing
xpack.prelert.get_schedulers: xpack.ml.get_schedulers:
scheduler_id: missing-scheduler scheduler_id: missing-scheduler
--- ---
"Test get single scheduler": "Test get single scheduler":
- do: - do:
xpack.prelert.get_schedulers: xpack.ml.get_schedulers:
scheduler_id: scheduler-1 scheduler_id: scheduler-1
- match: { schedulers.0.scheduler_id: "scheduler-1"} - match: { schedulers.0.scheduler_id: "scheduler-1"}
- match: { schedulers.0.job_id: "job-1"} - match: { schedulers.0.job_id: "job-1"}
- do: - do:
xpack.prelert.get_schedulers: xpack.ml.get_schedulers:
scheduler_id: scheduler-2 scheduler_id: scheduler-2
- match: { schedulers.0.scheduler_id: "scheduler-2"} - match: { schedulers.0.scheduler_id: "scheduler-2"}
- match: { schedulers.0.job_id: "job-2"} - match: { schedulers.0.job_id: "job-2"}
@ -78,7 +78,7 @@ setup:
"Test get all schedulers": "Test get all schedulers":
- do: - do:
xpack.prelert.get_schedulers: xpack.ml.get_schedulers:
scheduler_id: _all scheduler_id: _all
- match: { count: 2 } - match: { count: 2 }
- match: { schedulers.0.scheduler_id: "scheduler-1"} - match: { schedulers.0.scheduler_id: "scheduler-1"}

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-1", "job_id":"job-1",
@ -16,7 +16,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-2", "job_id":"job-2",
@ -32,7 +32,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: scheduler-1 scheduler_id: scheduler-1
body: > body: >
{ {
@ -42,7 +42,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: scheduler-2 scheduler_id: scheduler-2
body: > body: >
{ {
@ -56,20 +56,20 @@ setup:
- do: - do:
catch: missing catch: missing
xpack.prelert.get_schedulers_stats: xpack.ml.get_schedulers_stats:
scheduler_id: missing-scheduler scheduler_id: missing-scheduler
--- ---
"Test get single scheduler stats": "Test get single scheduler stats":
- do: - do:
xpack.prelert.get_schedulers_stats: xpack.ml.get_schedulers_stats:
scheduler_id: scheduler-1 scheduler_id: scheduler-1
- match: { schedulers.0.scheduler_id: "scheduler-1"} - match: { schedulers.0.scheduler_id: "scheduler-1"}
- match: { schedulers.0.status: "STOPPED"} - match: { schedulers.0.status: "STOPPED"}
- do: - do:
xpack.prelert.get_schedulers_stats: xpack.ml.get_schedulers_stats:
scheduler_id: scheduler-2 scheduler_id: scheduler-2
- match: { schedulers.0.scheduler_id: "scheduler-2"} - match: { schedulers.0.scheduler_id: "scheduler-2"}
- match: { schedulers.0.status: "STOPPED"} - match: { schedulers.0.status: "STOPPED"}
@ -78,7 +78,7 @@ setup:
"Test get all schedulers stats": "Test get all schedulers stats":
- do: - do:
xpack.prelert.get_schedulers_stats: xpack.ml.get_schedulers_stats:
scheduler_id: _all scheduler_id: _all
- match: { count: 2 } - match: { count: 2 }
- match: { schedulers.0.scheduler_id: "scheduler-1"} - match: { schedulers.0.scheduler_id: "scheduler-1"}

View File

@ -1,7 +1,7 @@
--- ---
"Test job crud apis": "Test job crud apis":
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote", "job_id":"farequote",
@ -27,13 +27,13 @@
index: ".ml-state" index: ".ml-state"
- do: - do:
xpack.prelert.get_jobs: xpack.ml.get_jobs:
job_id: "farequote" job_id: "farequote"
- match: { count: 1 } - match: { count: 1 }
- match: { jobs.0.job_id: "farequote" } - match: { jobs.0.job_id: "farequote" }
- do: - do:
xpack.prelert.delete_job: xpack.ml.delete_job:
job_id: "farequote" job_id: "farequote"
- match: { acknowledged: true } - match: { acknowledged: true }
@ -46,13 +46,13 @@
"Test get job API with non existing job id": "Test get job API with non existing job id":
- do: - do:
catch: missing catch: missing
xpack.prelert.get_jobs: xpack.ml.get_jobs:
job_id: "non-existing" job_id: "non-existing"
--- ---
"Test put job with id that is already taken": "Test put job with id that is already taken":
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote", "job_id":"farequote",
@ -71,7 +71,7 @@
- do: - do:
catch: /resource_already_exists_exception/ catch: /resource_already_exists_exception/
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote", "job_id":"farequote",
@ -88,7 +88,7 @@
} }
- do: - do:
catch: /The job cannot be created with the Id 'farequote'. The Id is already used./ catch: /The job cannot be created with the Id 'farequote'. The Id is already used./
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote", "job_id":"farequote",
@ -105,7 +105,7 @@
} }
- do: - do:
catch: param catch: param
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote", "job_id":"farequote",
@ -124,7 +124,7 @@
--- ---
"Test delete job that is referred by a scheduler": "Test delete job that is referred by a scheduler":
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"scheduler-job", "job_id":"scheduler-job",
@ -142,7 +142,7 @@
- match: { job_id: "scheduler-job" } - match: { job_id: "scheduler-job" }
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -154,5 +154,5 @@
- do: - do:
catch: /Cannot delete job \[scheduler-job\] while scheduler \[test-scheduler-1\] refers to it/ 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 job_id: scheduler-job

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-1", "job_id":"job-1",
@ -17,7 +17,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-2", "job_id":"job-2",
@ -38,20 +38,20 @@ setup:
- do: - do:
catch: missing catch: missing
xpack.prelert.get_jobs: xpack.ml.get_jobs:
job_id: missing-job job_id: missing-job
--- ---
"Test get single job": "Test get single job":
- do: - do:
xpack.prelert.get_jobs: xpack.ml.get_jobs:
job_id: job-1 job_id: job-1
- match: { jobs.0.job_id: "job-1"} - match: { jobs.0.job_id: "job-1"}
- match: { jobs.0.description: "Job 1"} - match: { jobs.0.description: "Job 1"}
- do: - do:
xpack.prelert.get_jobs: xpack.ml.get_jobs:
job_id: job-2 job_id: job-2
- match: { jobs.0.job_id: "job-2"} - match: { jobs.0.job_id: "job-2"}
- match: { jobs.0.description: "Job 2"} - match: { jobs.0.description: "Job 2"}
@ -60,7 +60,7 @@ setup:
"Test get all jobs": "Test get all jobs":
- do: - do:
xpack.prelert.get_jobs: xpack.ml.get_jobs:
job_id: _all job_id: _all
- match: { count: 2 } - match: { count: 2 }
- match: { jobs.0.job_id: "job-1"} - match: { jobs.0.job_id: "job-1"}

View File

@ -34,7 +34,7 @@ setup:
--- ---
"Test result buckets api with time range": "Test result buckets api with time range":
- do: - do:
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-07-01T00:00:00Z" end: "2016-07-01T00:00:00Z"
@ -47,7 +47,7 @@ setup:
--- ---
"Test result buckets api": "Test result buckets api":
- do: - do:
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
- match: { count: 2 } - match: { count: 2 }
@ -61,7 +61,7 @@ setup:
--- ---
"Test result single bucket api": "Test result single bucket api":
- do: - do:
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
@ -73,28 +73,28 @@ setup:
"Test mutually-exclusive params": "Test mutually-exclusive params":
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
end: "2016-05-01T00:00:00Z" end: "2016-05-01T00:00:00Z"
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
from: "2016-05-01T00:00:00Z" from: "2016-05-01T00:00:00Z"
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
end: "2016-05-01T00:00:00Z" end: "2016-05-01T00:00:00Z"
@ -103,7 +103,7 @@ setup:
"Test mutually-exclusive params (via body)": "Test mutually-exclusive params (via body)":
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
body: body:
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
@ -111,7 +111,7 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
body: body:
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
@ -119,7 +119,7 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
body: body:
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"
@ -127,7 +127,7 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "farequote" job_id: "farequote"
body: body:
timestamp: "2016-06-01T00:00:00Z" timestamp: "2016-06-01T00:00:00Z"

View File

@ -25,7 +25,7 @@ setup:
--- ---
"Test result categories api": "Test result categories api":
- do: - do:
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
- match: { count: 2 } - match: { count: 2 }
@ -37,7 +37,7 @@ setup:
--- ---
"Test result category api": "Test result category api":
- do: - do:
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
@ -48,21 +48,21 @@ setup:
"Test with invalid param combinations": "Test with invalid param combinations":
- do: - do:
catch: request catch: request
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
from: 0 from: 0
- do: - do:
catch: request catch: request
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
size: 1 size: 1
- do: - do:
catch: request catch: request
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
from: 0 from: 0
@ -72,7 +72,7 @@ setup:
"Test with invalid param combinations (via body)": "Test with invalid param combinations (via body)":
- do: - do:
catch: request catch: request
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
body: body:
@ -80,7 +80,7 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
body: body:
@ -88,7 +88,7 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.get_categories: xpack.ml.get_categories:
job_id: "farequote" job_id: "farequote"
category_id: "1" category_id: "1"
body: body:

View File

@ -54,7 +54,7 @@ setup:
--- ---
"Test result influencers api": "Test result influencers api":
- do: - do:
xpack.prelert.get_influencers: xpack.ml.get_influencers:
job_id: "farequote" job_id: "farequote"
- match: { count: 2 } - match: { count: 2 }
@ -64,7 +64,7 @@ setup:
--- ---
"Test result influencers api with time range": "Test result influencers api with time range":
- do: - do:
xpack.prelert.get_influencers: xpack.ml.get_influencers:
job_id: "farequote" job_id: "farequote"
start: "2016-06-01T00:00:00Z" start: "2016-06-01T00:00:00Z"
end: "2016-06-01T01:00:00Z" end: "2016-06-01T01:00:00Z"

View File

@ -64,7 +64,7 @@ setup:
--- ---
"Test result records api": "Test result records api":
- do: - do:
xpack.prelert.get_records: xpack.ml.get_records:
job_id: "farequote" job_id: "farequote"
- match: { count: 2 } - match: { count: 2 }
@ -78,7 +78,7 @@ setup:
--- ---
"Test result records api with time range": "Test result records api with time range":
- do: - do:
xpack.prelert.get_records: xpack.ml.get_records:
job_id: "farequote" job_id: "farequote"
start: "2016-05-01T00:00:00Z" start: "2016-05-01T00:00:00Z"
end: "2016-06-01T01:00:00Z" end: "2016-06-01T01:00:00Z"

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-stats-test", "job_id":"job-stats-test",
@ -17,11 +17,11 @@ setup:
} }
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: job-stats-test job_id: job-stats-test
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"scheduled-job", "job_id":"scheduled-job",
@ -37,11 +37,11 @@ setup:
} }
} }
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: scheduled-job job_id: scheduled-job
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: scheduler-1 scheduler_id: scheduler-1
body: > body: >
{ {
@ -68,20 +68,20 @@ setup:
"Test get job stats after uploading data prompting the creation of some stats": "Test get job stats after uploading data prompting the creation of some stats":
- do: - do:
xpack.prelert.job_data: xpack.ml.job_data:
job_id: job-stats-test job_id: job-stats-test
body: > body: >
{"airline":"AAL","responsetime":"132.2046","time":"1403481600"} {"airline":"AAL","responsetime":"132.2046","time":"1403481600"}
{"airline":"JZA","responsetime":"990.4628","time":"1403481600"} {"airline":"JZA","responsetime":"990.4628","time":"1403481600"}
- do: - do:
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: job-stats-test job_id: job-stats-test
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.get_jobs_stats: xpack.ml.get_jobs_stats:
job_id: job-stats-test job_id: job-stats-test
- match: { jobs.0.job_id : job-stats-test } - match: { jobs.0.job_id : job-stats-test }
- match: { jobs.0.data_counts.processed_record_count: 2 } - 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": "Test get job stats of scheduled job that has not received and data":
- do: - do:
xpack.prelert.get_jobs_stats: xpack.ml.get_jobs_stats:
job_id: scheduled-job job_id: scheduled-job
- match: { jobs.0.job_id : scheduled-job } - match: { jobs.0.job_id : scheduled-job }
- match: { jobs.0.data_counts.processed_record_count: 0 } - match: { jobs.0.data_counts.processed_record_count: 0 }
@ -106,5 +106,5 @@ setup:
- do: - do:
catch: missing catch: missing
xpack.prelert.get_jobs_stats: xpack.ml.get_jobs_stats:
job_id: unknown-job job_id: unknown-job

View File

@ -1,7 +1,7 @@
--- ---
setup: setup:
- do: - do:
xpack.prelert.put_list: xpack.ml.put_list:
body: > body: >
{ {
"id": "foo", "id": "foo",
@ -9,7 +9,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_list: xpack.ml.put_list:
body: > body: >
{ {
"id": "foo2", "id": "foo2",
@ -24,14 +24,14 @@ setup:
- do: - do:
catch: missing catch: missing
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "do_not_exist" list_id: "do_not_exist"
--- ---
"Test get list API": "Test get list API":
- do: - do:
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo" list_id: "foo"
- match: { count: 1 } - match: { count: 1 }
@ -44,7 +44,7 @@ setup:
"Test get lists API": "Test get lists API":
- do: - do:
xpack.prelert.get_lists: {} xpack.ml.get_lists: {}
- match: { count: 2 } - match: { count: 2 }
- match: - match:
@ -58,7 +58,7 @@ setup:
items: ["123", "lmnop"] items: ["123", "lmnop"]
- do: - do:
xpack.prelert.get_lists: xpack.ml.get_lists:
from: 1 from: 1
size: 1 size: 1
@ -69,26 +69,26 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo" list_id: "foo"
from: 0 from: 0
- do: - do:
catch: request catch: request
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo" list_id: "foo"
size: 1 size: 1
- do: - do:
catch: request catch: request
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo" list_id: "foo"
from: 0 from: 0
size: 1 size: 1
--- ---
"Test create list api": "Test create list api":
- do: - do:
xpack.prelert.put_list: xpack.ml.put_list:
body: > body: >
{ {
"id": "foo2", "id": "foo2",
@ -98,7 +98,7 @@ setup:
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo2" list_id: "foo2"
- match: { count: 1 } - match: { count: 1 }
@ -111,7 +111,7 @@ setup:
"Test create list api without ID": "Test create list api without ID":
- do: - do:
catch: /illegal_argument_exception/ catch: /illegal_argument_exception/
xpack.prelert.put_list: xpack.ml.put_list:
body: > body: >
{ {
"items": ["abc", "xyz"] "items": ["abc", "xyz"]
@ -120,7 +120,7 @@ setup:
--- ---
"Test delete in-use list": "Test delete in-use list":
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote2", "job_id":"farequote2",
@ -147,21 +147,21 @@ setup:
} }
- do: - do:
catch: conflict catch: conflict
xpack.prelert.delete_list: xpack.ml.delete_list:
list_id: "foo" list_id: "foo"
--- ---
"Test non-existing list": "Test non-existing list":
- do: - do:
catch: missing catch: missing
xpack.prelert.delete_list: xpack.ml.delete_list:
list_id: "does_not_exist" list_id: "does_not_exist"
--- ---
"Test valid delete list": "Test valid delete list":
- do: - do:
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo" list_id: "foo"
- match: { count: 1 } - match: { count: 1 }
@ -171,10 +171,10 @@ setup:
items: ["abc", "xyz"] items: ["abc", "xyz"]
- do: - do:
xpack.prelert.delete_list: xpack.ml.delete_list:
list_id: "foo" list_id: "foo"
- do: - do:
catch: missing catch: missing
xpack.prelert.get_lists: xpack.ml.get_lists:
list_id: "foo" list_id: "foo"

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"farequote", "job_id":"farequote",
@ -17,7 +17,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"closed_job", "job_id":"closed_job",
@ -31,13 +31,13 @@ setup:
} }
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: farequote job_id: farequote
--- ---
"Test POST data job api, flush, close and verify DataCounts doc": "Test POST data job api, flush, close and verify DataCounts doc":
- do: - do:
xpack.prelert.job_data: xpack.ml.job_data:
job_id: farequote job_id: farequote
body: > body: >
{"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"} {"airline":"AAL","responsetime":"132.2046","sourcetype":"farequote","time":"1403481600"}
@ -54,17 +54,17 @@ setup:
- match: { latest_record_timestamp: 1403481700000} - match: { latest_record_timestamp: 1403481700000}
- do: - do:
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: farequote job_id: farequote
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.close_job: xpack.ml.close_job:
job_id: farequote job_id: farequote
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.get_jobs_stats: xpack.ml.get_jobs_stats:
job_id: farequote job_id: farequote
- match: { jobs.0.status: "CLOSED" } - match: { jobs.0.status: "CLOSED" }
@ -87,17 +87,17 @@ setup:
--- ---
"Test flush and close job WITHOUT sending any data": "Test flush and close job WITHOUT sending any data":
- do: - do:
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: farequote job_id: farequote
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.close_job: xpack.ml.close_job:
job_id: farequote job_id: farequote
- match: { acknowledged: true } - match: { acknowledged: true }
- do: - do:
xpack.prelert.get_jobs_stats: xpack.ml.get_jobs_stats:
job_id: farequote job_id: farequote
- match: { jobs.0.status: "CLOSED" } - match: { jobs.0.status: "CLOSED" }
@ -105,13 +105,13 @@ setup:
"Test POST data with invalid parameters": "Test POST data with invalid parameters":
- do: - do:
catch: missing catch: missing
xpack.prelert.job_data: xpack.ml.job_data:
job_id: not_a_job job_id: not_a_job
body: {} body: {}
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.job_data: xpack.ml.job_data:
job_id: farequote job_id: farequote
reset_start: not_a_date reset_start: not_a_date
body: > body: >
@ -120,7 +120,7 @@ setup:
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.job_data: xpack.ml.job_data:
job_id: farequote job_id: farequote
reset_end: end_not_a_date reset_end: end_not_a_date
body: > body: >
@ -131,24 +131,24 @@ setup:
"Test Flush data with invalid parameters": "Test Flush data with invalid parameters":
- do: - do:
catch: missing catch: missing
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: not_a_job job_id: not_a_job
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: farequote job_id: farequote
start: not_a_date start: not_a_date
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: farequote job_id: farequote
end: end_not_a_date end: end_not_a_date
- do: - do:
catch: /parse_exception/ catch: /parse_exception/
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: farequote job_id: farequote
advance_time: advance_time_not_a_date advance_time: advance_time_not_a_date
@ -156,28 +156,28 @@ setup:
"Test open and close with non-existent job id": "Test open and close with non-existent job id":
- do: - do:
catch: missing catch: missing
xpack.prelert.open_job: xpack.ml.open_job:
job_id: not_a_job job_id: not_a_job
- do: - do:
catch: missing catch: missing
xpack.prelert.close_job: xpack.ml.close_job:
job_id: not_a_job job_id: not_a_job
--- ---
"Test flushing, posting and closing a closed job": "Test flushing, posting and closing a closed job":
- do: - do:
catch: /illegal_argument_exception/ catch: /illegal_argument_exception/
xpack.prelert.flush_job: xpack.ml.flush_job:
job_id: closed_job job_id: closed_job
- do: - do:
catch: /illegal_argument_exception/ catch: /illegal_argument_exception/
xpack.prelert.close_job: xpack.ml.close_job:
job_id: closed_job job_id: closed_job
- do: - do:
catch: /illegal_argument_exception/ catch: /illegal_argument_exception/
xpack.prelert.job_data: xpack.ml.job_data:
job_id: closed_job job_id: closed_job
body: {} body: {}

View File

@ -46,7 +46,7 @@ setup:
"Test without description": "Test without description":
- do: - do:
catch: request catch: request
xpack.prelert.put_model_snapshot_description: xpack.ml.put_model_snapshot_description:
job_id: "foo" job_id: "foo"
snapshot_id: "foo" snapshot_id: "foo"
body: > body: >
@ -57,7 +57,7 @@ setup:
--- ---
"Test with valid description": "Test with valid description":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
description: "new_description" description: "new_description"
@ -65,7 +65,7 @@ setup:
- length: { model_snapshots: 0 } - length: { model_snapshots: 0 }
- do: - do:
xpack.prelert.put_model_snapshot_description: xpack.ml.put_model_snapshot_description:
job_id: "foo" job_id: "foo"
snapshot_id: "foo" snapshot_id: "foo"
body: > body: >
@ -81,7 +81,7 @@ setup:
index: .ml-anomalies-foo index: .ml-anomalies-foo
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
description: "new_description" description: "new_description"
@ -92,7 +92,7 @@ setup:
--- ---
"Test with conflict against existing description": "Test with conflict against existing description":
- do: - do:
xpack.prelert.get_model_snapshots: xpack.ml.get_model_snapshots:
job_id: "foo" job_id: "foo"
description: "bar" description: "bar"
@ -103,7 +103,7 @@ setup:
- do: - do:
catch: request catch: request
xpack.prelert.put_model_snapshot_description: xpack.ml.put_model_snapshot_description:
job_id: "foo" job_id: "foo"
snapshot_id: "foo" snapshot_id: "foo"
body: > body: >

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"foo", "job_id":"foo",
@ -17,11 +17,11 @@ setup:
} }
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: foo job_id: foo
- do: - do:
xpack.prelert.close_job: xpack.ml.close_job:
job_id: foo job_id: foo
- do: - do:
@ -135,14 +135,14 @@ setup:
"Test revert model with only job_id": "Test revert model with only job_id":
- do: - do:
catch: request catch: request
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
--- ---
"Test revert model with invalid time": "Test revert model with invalid time":
- do: - do:
catch: request catch: request
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
time: "foo" time: "foo"
@ -150,7 +150,7 @@ setup:
"Test revert model with invalid snapshotId": "Test revert model with invalid snapshotId":
- do: - do:
catch: /resource_not_found_exception/ catch: /resource_not_found_exception/
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "not_exist" snapshot_id: "not_exist"
@ -158,14 +158,14 @@ setup:
"Test revert model with invalid description": "Test revert model with invalid description":
- do: - do:
catch: /resource_not_found_exception/ catch: /resource_not_found_exception/
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
description: "foo" description: "foo"
--- ---
"Test revert model with valid snapshotId": "Test revert model with valid snapshotId":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "foo1" snapshot_id: "foo1"
@ -177,7 +177,7 @@ setup:
- match: { model.snapshot_doc_count: 0 } - match: { model.snapshot_doc_count: 0 }
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "foo2" snapshot_id: "foo2"
@ -191,7 +191,7 @@ setup:
--- ---
"Test revert model with valid time": "Test revert model with valid time":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
time: "2016-06-02T01:00:00Z" time: "2016-06-02T01:00:00Z"
@ -203,7 +203,7 @@ setup:
- match: { model.snapshot_doc_count: 0 } - match: { model.snapshot_doc_count: 0 }
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
time: "2016-06-01T01:00:00Z" time: "2016-06-01T01:00:00Z"
@ -217,7 +217,7 @@ setup:
--- ---
"Test revert model with valid description": "Test revert model with valid description":
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
description: "first" description: "first"
@ -229,7 +229,7 @@ setup:
- match: { model.snapshot_doc_count: 0 } - match: { model.snapshot_doc_count: 0 }
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
description: "second" description: "second"
@ -243,7 +243,7 @@ setup:
--- ---
"Test revert model with deleteInterveningResults": "Test revert model with deleteInterveningResults":
- do: - do:
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "foo" job_id: "foo"
start: "2016-01-01T00:00:00Z" start: "2016-01-01T00:00:00Z"
end: "2016-12-01T00:00:00Z" end: "2016-12-01T00:00:00Z"
@ -251,7 +251,7 @@ setup:
- match: { count: 3 } - match: { count: 3 }
- do: - do:
xpack.prelert.revert_model_snapshot: xpack.ml.revert_model_snapshot:
job_id: "foo" job_id: "foo"
snapshot_id: "foo2" snapshot_id: "foo2"
delete_intervening_results: true delete_intervening_results: true
@ -261,7 +261,7 @@ setup:
index: .ml-anomalies-foo index: .ml-anomalies-foo
- do: - do:
xpack.prelert.get_buckets: xpack.ml.get_buckets:
job_id: "foo" job_id: "foo"
start: "2016-01-01T00:00:00Z" start: "2016-01-01T00:00:00Z"
end: "2016-12-01T00:00:00Z" end: "2016-12-01T00:00:00Z"
@ -271,7 +271,7 @@ setup:
- match: { buckets.0.timestamp: 1462060800000 } - match: { buckets.0.timestamp: 1462060800000 }
- do: - do:
xpack.prelert.get_records: xpack.ml.get_records:
job_id: "foo" job_id: "foo"
start: "2016-01-01T00:00:00Z" start: "2016-01-01T00:00:00Z"
end: "2016-12-01T00:00:00Z" end: "2016-12-01T00:00:00Z"
@ -281,7 +281,7 @@ setup:
- match: { records.0.timestamp: 1462060800000 } - match: { records.0.timestamp: 1462060800000 }
- do: - do:
xpack.prelert.get_influencers: xpack.ml.get_influencers:
job_id: "foo" job_id: "foo"
start: "2016-01-01T00:00:00Z" start: "2016-01-01T00:00:00Z"
end: "2016-12-01T01:00:00Z" end: "2016-12-01T01:00:00Z"
@ -291,7 +291,7 @@ setup:
- match: { influencers.0.timestamp: 1462060800000 } - match: { influencers.0.timestamp: 1462060800000 }
- do: - do:
xpack.prelert.get_jobs_stats: xpack.ml.get_jobs_stats:
job_id: foo job_id: foo
- match: { jobs.0.data_counts.latest_record_timestamp: 1464739200000 } - match: { jobs.0.data_counts.latest_record_timestamp: 1464739200000 }

View File

@ -1,6 +1,6 @@
setup: setup:
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-1", "job_id":"job-1",
@ -16,7 +16,7 @@ setup:
} }
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"job-2", "job_id":"job-2",
@ -34,7 +34,7 @@ setup:
"Test put scheduler referring to missing job_id": "Test put scheduler referring to missing job_id":
- do: - do:
catch: /resource_not_found_exception/ catch: /resource_not_found_exception/
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -46,7 +46,7 @@ setup:
--- ---
"Test put scheduler referring to existing job_id": "Test put scheduler referring to existing job_id":
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -59,7 +59,7 @@ setup:
--- ---
"Test put scheduler whose id is already taken": "Test put scheduler whose id is already taken":
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -71,7 +71,7 @@ setup:
- do: - do:
catch: /resource_already_exists_exception/ catch: /resource_already_exists_exception/
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -83,7 +83,7 @@ setup:
--- ---
"Test put scheduler with job_id that is already used by another scheduler": "Test put scheduler with job_id that is already used by another scheduler":
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -95,7 +95,7 @@ setup:
- do: - do:
catch: /A scheduler \[test-scheduler-1\] already exists for job \[job-1\]/ 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 scheduler_id: test-scheduler-2
body: > body: >
{ {
@ -108,7 +108,7 @@ setup:
"Test put scheduler with invalid query": "Test put scheduler with invalid query":
- do: - do:
catch: /parsing_exception/ catch: /parsing_exception/
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -122,13 +122,13 @@ setup:
"Test delete scheduler with missing id": "Test delete scheduler with missing id":
- do: - do:
catch: /resource_not_found_exception/ catch: /resource_not_found_exception/
xpack.prelert.delete_scheduler: xpack.ml.delete_scheduler:
scheduler_id: a-missing-scheduler scheduler_id: a-missing-scheduler
--- ---
"Test delete scheduler": "Test delete scheduler":
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
body: > body: >
{ {
@ -139,6 +139,6 @@ setup:
- match: { scheduler_id: "test-scheduler-1" } - match: { scheduler_id: "test-scheduler-1" }
- do: - do:
xpack.prelert.delete_scheduler: xpack.ml.delete_scheduler:
scheduler_id: test-scheduler-1 scheduler_id: test-scheduler-1
- match: { acknowledged: true } - match: { acknowledged: true }

View File

@ -4,7 +4,7 @@ setup:
index: airline-data index: airline-data
- do: - do:
xpack.prelert.put_job: xpack.ml.put_job:
body: > body: >
{ {
"job_id":"scheduled-job", "job_id":"scheduled-job",
@ -20,7 +20,7 @@ setup:
} }
} }
- do: - do:
xpack.prelert.put_scheduler: xpack.ml.put_scheduler:
scheduler_id: scheduler-1 scheduler_id: scheduler-1
body: > body: >
{ {
@ -31,28 +31,28 @@ setup:
--- ---
"Test start and stop scheduler happy path": "Test start and stop scheduler happy path":
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: "scheduled-job" job_id: "scheduled-job"
- do: - do:
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
"start": 0 "start": 0
- do: - do:
xpack.prelert.get_schedulers_stats: xpack.ml.get_schedulers_stats:
scheduler_id: "scheduler-1" scheduler_id: "scheduler-1"
- match: { schedulers.0.status: STARTED } - match: { schedulers.0.status: STARTED }
- do: - do:
xpack.prelert.stop_scheduler: xpack.ml.stop_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
- do: - do:
xpack.prelert.get_schedulers_stats: xpack.ml.get_schedulers_stats:
scheduler_id: "scheduler-1" scheduler_id: "scheduler-1"
- match: { schedulers.0.status: STOPPED } - match: { schedulers.0.status: STOPPED }
--- ---
"Test start non existing scheduler": "Test start non existing scheduler":
- do: - do:
catch: missing catch: missing
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "non-existing-scheduler" "scheduler_id": "non-existing-scheduler"
"start": 0 "start": 0
@ -60,33 +60,33 @@ setup:
"Test start scheduled job, but not open": "Test start scheduled job, but not open":
- do: - do:
catch: conflict catch: conflict
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
"start": 0 "start": 0
- do: - do:
catch: /cannot start scheduler, expected job status \[OPENED\], but got \[CLOSED\]/ catch: /cannot start scheduler, expected job status \[OPENED\], but got \[CLOSED\]/
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
"start": 0 "start": 0
--- ---
"Test start already started scheduled job": "Test start already started scheduled job":
- do: - do:
xpack.prelert.open_job: xpack.ml.open_job:
job_id: "scheduled-job" job_id: "scheduled-job"
- do: - do:
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
"start": 0 "start": 0
- do: - do:
catch: conflict catch: conflict
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
"start": 0 "start": 0
- do: - do:
catch: /scheduler already started, expected scheduler status \[STOPPED\], but got \[STARTED\]/ catch: /scheduler already started, expected scheduler status \[STOPPED\], but got \[STARTED\]/
xpack.prelert.start_scheduler: xpack.ml.start_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
"start": 0 "start": 0
@ -94,16 +94,16 @@ setup:
"Test stop non existing scheduler": "Test stop non existing scheduler":
- do: - do:
catch: missing catch: missing
xpack.prelert.stop_scheduler: xpack.ml.stop_scheduler:
"scheduler_id": "non-existing-scheduler" "scheduler_id": "non-existing-scheduler"
--- ---
"Test stop already stopped scheduled job": "Test stop already stopped scheduled job":
- do: - do:
catch: conflict catch: conflict
xpack.prelert.stop_scheduler: xpack.ml.stop_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"
- do: - do:
catch: /scheduler already stopped, expected scheduler status \[STARTED\], but got \[STOPPED\]/ catch: /scheduler already stopped, expected scheduler status \[STARTED\], but got \[STOPPED\]/
xpack.prelert.stop_scheduler: xpack.ml.stop_scheduler:
"scheduler_id": "scheduler-1" "scheduler_id": "scheduler-1"

View File

@ -1,7 +1,7 @@
--- ---
"Test valid detector": "Test valid detector":
- do: - do:
xpack.prelert.validate_detector: xpack.ml.validate_detector:
body: > body: >
{ {
"function":"count", "function":"count",
@ -13,7 +13,7 @@
"Test invalid detector": "Test invalid detector":
- do: - do:
catch: /field_name must be set when the 'mean' function is used/ catch: /field_name must be set when the 'mean' function is used/
xpack.prelert.validate_detector: xpack.ml.validate_detector:
body: > body: >
{ {
"function":"mean", "function":"mean",

View File

@ -1,7 +1,7 @@
--- ---
"Test valid transform": "Test valid transform":
- do: - do:
xpack.prelert.validate_transform: xpack.ml.validate_transform:
body: > body: >
{ {
"transform":"concat", "transform":"concat",
@ -14,7 +14,7 @@
"Test invalid transform": "Test invalid transform":
- do: - do:
catch: /Transform type concat expected \[2‥\+∞\) input\(s\), got 1/ catch: /Transform type concat expected \[2‥\+∞\) input\(s\), got 1/
xpack.prelert.validate_transform: xpack.ml.validate_transform:
body: > body: >
{ {
"transform":"concat", "transform":"concat",
@ -24,7 +24,7 @@
--- ---
"Test valid transforms": "Test valid transforms":
- do: - do:
xpack.prelert.validate_transforms: xpack.ml.validate_transforms:
body: > body: >
{ {
"transforms": [ "transforms": [
@ -45,7 +45,7 @@
"Test invalid transforms": "Test invalid transforms":
- do: - do:
catch: /Transform type concat with inputs \[one, two\] has a circular dependency/ catch: /Transform type concat with inputs \[one, two\] has a circular dependency/
xpack.prelert.validate_transforms: xpack.ml.validate_transforms:
body: > body: >
{ {
"transforms": [ "transforms": [