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 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";

View File

@ -43,11 +43,11 @@ public class PrelertRestTestStateCleaner {
Map<String, Object> schedulerMap = (Map<String, Object>) 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<String, Object> 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);
}
}
}

View File

@ -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));

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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": {

View File

@ -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": {

View File

@ -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": {

View File

@ -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",

View File

@ -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": {

View File

@ -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": {

View File

@ -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",

View File

@ -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",

View File

@ -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": {

View File

@ -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": {

View File

@ -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": {

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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": {

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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": {

View File

@ -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": {

View File

@ -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": {

View File

@ -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": {

View File

@ -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"

View File

@ -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

View File

@ -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"}

View File

@ -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"}

View File

@ -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

View File

@ -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"}

View File

@ -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"

View File

@ -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:

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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: {}

View File

@ -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: >

View File

@ -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 }

View File

@ -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 }

View File

@ -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"

View File

@ -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",

View File

@ -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": [