Rename prelertresults- to .ml-anomalies (elastic/elasticsearch#607)

Original commit: elastic/x-pack-elasticsearch@ad3bb7c819
This commit is contained in:
David Kyle 2016-12-21 13:47:00 +00:00 committed by GitHub
parent 6de846d4c6
commit a47c5332d5
16 changed files with 63 additions and 59 deletions

View File

@ -9,7 +9,7 @@ package org.elasticsearch.xpack.prelert.job.persistence;
* Methods for handling index naming related functions * Methods for handling index naming related functions
*/ */
public final class AnomalyDetectorsIndex { public final class AnomalyDetectorsIndex {
private static final String RESULTS_INDEX_PREFIX = "prelertresults-"; private static final String RESULTS_INDEX_PREFIX = ".ml-anomalies-";
private static final String STATE_INDEX_NAME = ".ml-state"; private static final String STATE_INDEX_NAME = ".ml-state";
private AnomalyDetectorsIndex() { private AnomalyDetectorsIndex() {

View File

@ -10,6 +10,7 @@ import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException; import org.elasticsearch.client.ResponseException;
import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xpack.prelert.PrelertPlugin; import org.elasticsearch.xpack.prelert.PrelertPlugin;
import org.elasticsearch.xpack.prelert.job.persistence.AnomalyDetectorsIndex;
import org.junit.After; import org.junit.After;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -191,7 +192,8 @@ public class PrelertJobIT extends ESRestTestCase {
response = client().performRequest("get", "_aliases"); response = client().performRequest("get", "_aliases");
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
String responseAsString = responseEntityToString(response); String responseAsString = responseEntityToString(response);
assertThat(responseAsString, containsString("\"prelertresults-" + indexName + "\":{\"aliases\":{\"prelertresults-" + jobId + "\"")); assertThat(responseAsString, containsString("\"" + AnomalyDetectorsIndex.jobResultsIndexName(indexName)
+ "\":{\"aliases\":{\"" + AnomalyDetectorsIndex.jobResultsIndexName(jobId) + "\""));
response = client().performRequest("get", "_cat/indices"); response = client().performRequest("get", "_cat/indices");
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
@ -205,7 +207,7 @@ public class PrelertJobIT extends ESRestTestCase {
responseAsString = responseEntityToString(response); responseAsString = responseEntityToString(response);
assertThat(responseAsString, containsString("\"count\":2")); assertThat(responseAsString, containsString("\"count\":2"));
response = client().performRequest("get", "prelertresults-" + indexName + "/result/_search"); response = client().performRequest("get", AnomalyDetectorsIndex.jobResultsIndexName(indexName) + "/result/_search");
assertThat(response.getStatusLine().getStatusCode(), equalTo(200)); assertThat(response.getStatusLine().getStatusCode(), equalTo(200));
responseAsString = responseEntityToString(response); responseAsString = responseEntityToString(response);
assertThat(responseAsString, containsString("\"total\":2")); assertThat(responseAsString, containsString("\"total\":2"));
@ -222,7 +224,7 @@ public class PrelertJobIT extends ESRestTestCase {
response = client().performRequest("get", "_aliases"); response = client().performRequest("get", "_aliases");
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
responseAsString = responseEntityToString(response); responseAsString = responseEntityToString(response);
assertThat(responseAsString, not(containsString("prelertresults-" + jobId ))); assertThat(responseAsString, not(containsString(AnomalyDetectorsIndex.jobResultsIndexName(jobId))));
response = client().performRequest("get", "_cat/indices"); response = client().performRequest("get", "_cat/indices");
assertEquals(200, response.getStatusLine().getStatusCode()); assertEquals(200, response.getStatusLine().getStatusCode());
@ -232,7 +234,8 @@ public class PrelertJobIT extends ESRestTestCase {
private Response addBucketResult(String jobId, String timestamp, long bucketSpan) throws Exception { private Response addBucketResult(String jobId, String timestamp, long bucketSpan) throws Exception {
try { try {
client().performRequest("put", "prelertresults-" + jobId, Collections.emptyMap(), new StringEntity(RESULT_MAPPING)); client().performRequest("put", AnomalyDetectorsIndex.jobResultsIndexName(jobId),
Collections.emptyMap(), new StringEntity(RESULT_MAPPING));
} catch (ResponseException e) { } catch (ResponseException e) {
// it is ok: the index already exists // it is ok: the index already exists
assertThat(e.getMessage(), containsString("index_already_exists_exception")); assertThat(e.getMessage(), containsString("index_already_exists_exception"));
@ -244,13 +247,14 @@ public class PrelertJobIT extends ESRestTestCase {
jobId, timestamp, bucketSpan); jobId, timestamp, bucketSpan);
String id = String.format(Locale.ROOT, String id = String.format(Locale.ROOT,
"%s_%s_%s", jobId, timestamp, bucketSpan); "%s_%s_%s", jobId, timestamp, bucketSpan);
return client().performRequest("put", "prelertresults-" + jobId + "/result/" + id, return client().performRequest("put", AnomalyDetectorsIndex.jobResultsIndexName(jobId) + "/result/" + id,
Collections.singletonMap("refresh", "true"), new StringEntity(bucketResult)); Collections.singletonMap("refresh", "true"), new StringEntity(bucketResult));
} }
private Response addRecordResult(String jobId, String timestamp, long bucketSpan, int sequenceNum) throws Exception { private Response addRecordResult(String jobId, String timestamp, long bucketSpan, int sequenceNum) throws Exception {
try { try {
client().performRequest("put", "prelertresults-" + jobId, Collections.emptyMap(), new StringEntity(RESULT_MAPPING)); client().performRequest("put", AnomalyDetectorsIndex.jobResultsIndexName(jobId), Collections.emptyMap(),
new StringEntity(RESULT_MAPPING));
} catch (ResponseException e) { } catch (ResponseException e) {
// it is ok: the index already exists // it is ok: the index already exists
assertThat(e.getMessage(), containsString("index_already_exists_exception")); assertThat(e.getMessage(), containsString("index_already_exists_exception"));
@ -261,7 +265,7 @@ public class PrelertJobIT extends ESRestTestCase {
String.format(Locale.ROOT, String.format(Locale.ROOT,
"{\"job_id\":\"%s\", \"timestamp\": \"%s\", \"bucket_span\":%d, \"sequence_num\": %d, \"result_type\":\"record\"}", "{\"job_id\":\"%s\", \"timestamp\": \"%s\", \"bucket_span\":%d, \"sequence_num\": %d, \"result_type\":\"record\"}",
jobId, timestamp, bucketSpan, sequenceNum); jobId, timestamp, bucketSpan, sequenceNum);
return client().performRequest("put", "prelertresults-" + jobId + "/result/" + timestamp, return client().performRequest("put", AnomalyDetectorsIndex.jobResultsIndexName(jobId) + "/result/" + timestamp,
Collections.singletonMap("refresh", "true"), new StringEntity(recordResult)); Collections.singletonMap("refresh", "true"), new StringEntity(recordResult));
} }

View File

@ -30,7 +30,7 @@ import org.junit.Before;
import org.mockito.Mockito; import org.mockito.Mockito;
public class ElasticsearchBatchedDocumentsIteratorTests extends ESTestCase { public class ElasticsearchBatchedDocumentsIteratorTests extends ESTestCase {
private static final String INDEX_NAME = "prelertresults-foo"; private static final String INDEX_NAME = ".ml-anomalies-foo";
private static final String SCROLL_ID = "someScrollId"; private static final String SCROLL_ID = "someScrollId";
private Client client; private Client client;

View File

@ -37,8 +37,8 @@ public class JobResultsPersisterTests extends ESTestCase {
BulkResponse response = mock(BulkResponse.class); BulkResponse response = mock(BulkResponse.class);
String responseId = "abcXZY54321"; String responseId = "abcXZY54321";
MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME) MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME)
.prepareIndex("prelertresults-" + JOB_ID, Result.TYPE.getPreferredName(), responseId, captor) .prepareIndex(AnomalyDetectorsIndex.jobResultsIndexName(JOB_ID), Result.TYPE.getPreferredName(), responseId, captor)
.prepareIndex("prelertresults-" + JOB_ID, Result.TYPE.getPreferredName(), "", captor) .prepareIndex(AnomalyDetectorsIndex.jobResultsIndexName(JOB_ID), Result.TYPE.getPreferredName(), "", captor)
.prepareBulk(response); .prepareBulk(response);
Client client = clientBuilder.build(); Client client = clientBuilder.build();
@ -91,7 +91,7 @@ public class JobResultsPersisterTests extends ESTestCase {
ArgumentCaptor<XContentBuilder> captor = ArgumentCaptor.forClass(XContentBuilder.class); ArgumentCaptor<XContentBuilder> captor = ArgumentCaptor.forClass(XContentBuilder.class);
BulkResponse response = mock(BulkResponse.class); BulkResponse response = mock(BulkResponse.class);
MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME) MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME)
.prepareIndex("prelertresults-" + JOB_ID, Result.TYPE.getPreferredName(), "", captor) .prepareIndex(AnomalyDetectorsIndex.jobResultsIndexName(JOB_ID), Result.TYPE.getPreferredName(), "", captor)
.prepareBulk(response); .prepareBulk(response);
Client client = clientBuilder.build(); Client client = clientBuilder.build();
@ -152,7 +152,7 @@ public class JobResultsPersisterTests extends ESTestCase {
ArgumentCaptor<XContentBuilder> captor = ArgumentCaptor.forClass(XContentBuilder.class); ArgumentCaptor<XContentBuilder> captor = ArgumentCaptor.forClass(XContentBuilder.class);
BulkResponse response = mock(BulkResponse.class); BulkResponse response = mock(BulkResponse.class);
MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME) MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME)
.prepareIndex("prelertresults-" + JOB_ID, Result.TYPE.getPreferredName(), "", captor) .prepareIndex(AnomalyDetectorsIndex.jobResultsIndexName(JOB_ID), Result.TYPE.getPreferredName(), "", captor)
.prepareBulk(response); .prepareBulk(response);
Client client = clientBuilder.build(); Client client = clientBuilder.build();

View File

@ -54,7 +54,7 @@ public class UsagePersisterTests extends ESTestCase {
verify(updateRequestBuilder, times(2)).setRetryOnConflict(ElasticsearchScripts.UPDATE_JOB_RETRY_COUNT); verify(updateRequestBuilder, times(2)).setRetryOnConflict(ElasticsearchScripts.UPDATE_JOB_RETRY_COUNT);
verify(updateRequestBuilder, times(2)).get(); verify(updateRequestBuilder, times(2)).get();
assertEquals(Arrays.asList("prelert-usage", "prelertresults-job1"), indexCaptor.getAllValues()); assertEquals(Arrays.asList("prelert-usage", AnomalyDetectorsIndex.jobResultsIndexName("job1")), indexCaptor.getAllValues());
assertEquals(2, idCaptor.getAllValues().size()); assertEquals(2, idCaptor.getAllValues().size());
String id = idCaptor.getValue(); String id = idCaptor.getValue();
assertEquals(id, idCaptor.getAllValues().get(0)); assertEquals(id, idCaptor.getAllValues().get(0));
@ -62,7 +62,7 @@ public class UsagePersisterTests extends ESTestCase {
String timestamp = id.substring("usage-".length()); String timestamp = id.substring("usage-".length());
assertEquals("prelert-usage", indexCaptor.getAllValues().get(0)); assertEquals("prelert-usage", indexCaptor.getAllValues().get(0));
assertEquals("prelertresults-job1", indexCaptor.getAllValues().get(1)); assertEquals(AnomalyDetectorsIndex.jobResultsIndexName("job1"), indexCaptor.getAllValues().get(1));
Script script = updateScriptCaptor.getValue(); Script script = updateScriptCaptor.getValue();
assertEquals("ctx._source.inputBytes += params.bytes;ctx._source.inputFieldCount += params.fieldCount;ctx._source.inputRecordCount" assertEquals("ctx._source.inputBytes += params.bytes;ctx._source.inputFieldCount += params.fieldCount;ctx._source.inputRecordCount"

View File

@ -26,7 +26,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "foo1" id: "foo1"
body: > body: >
@ -63,7 +63,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "foo2" id: "foo2"
body: > body: >
@ -83,7 +83,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
--- ---
"Test delete snapshot missing snapshotId": "Test delete snapshot missing snapshotId":
@ -121,7 +121,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
- do: - do:
indices.refresh: indices.refresh:

View File

@ -1,7 +1,7 @@
setup: setup:
- do: - do:
indices.create: indices.create:
index: prelertresults-foo index: .ml-anomalies-foo
body: body:
mappings: mappings:
model_snapshot: model_snapshot:
@ -13,21 +13,21 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "1" id: "1"
body: { "job_id": "foo", "timestamp": "2016-06-02T00:00:00Z", "restore_priority": "1" } body: { "job_id": "foo", "timestamp": "2016-06-02T00:00:00Z", "restore_priority": "1" }
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "2" id: "2"
body: { "job_id": "foo", "timestamp": "2016-06-01T00:00:00Z", "restore_priority": "2" } body: { "job_id": "foo", "timestamp": "2016-06-01T00:00:00Z", "restore_priority": "2" }
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
--- ---
"Test get model snapshots API with no params": "Test get model snapshots API with no params":

View File

@ -20,7 +20,7 @@
- do: - do:
indices.get: indices.get:
index: "prelertresults-farequote" index: ".ml-anomalies-farequote"
- do: - do:
indices.get: indices.get:
@ -39,7 +39,7 @@
- do: - do:
indices.exists: indices.exists:
index: "prelertresults-farequote" index: ".ml-anomalies-farequote"
- is_false: '' - is_false: ''
--- ---

View File

@ -1,7 +1,7 @@
setup: setup:
- do: - do:
indices.create: indices.create:
index: prelertresults-farequote index: .ml-anomalies-farequote
body: body:
mappings: mappings:
results: results:
@ -15,21 +15,21 @@ setup:
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: result type: result
id: "farequote_1464739200000_1" id: "farequote_1464739200000_1"
body: { "job_id": "farequote", "result_type": "bucket", "timestamp": "2016-06-01T00:00:00Z", "bucket_span":1 } body: { "job_id": "farequote", "result_type": "bucket", "timestamp": "2016-06-01T00:00:00Z", "bucket_span":1 }
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: result type: result
id: "farequote_1464739200000_2" id: "farequote_1464739200000_2"
body: { "job_id": "farequote", "result_type": "bucket", "timestamp": "2016-08-01T00:00:00Z", "bucket_span":1 } body: { "job_id": "farequote", "result_type": "bucket", "timestamp": "2016-08-01T00:00:00Z", "bucket_span":1 }
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-farequote index: .ml-anomalies-farequote
--- ---
"Test result buckets api with time range": "Test result buckets api with time range":

View File

@ -1,26 +1,26 @@
setup: setup:
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: category_definition type: category_definition
id: 1 id: 1
body: { "job_id": "farequote", "category_id": 1 } body: { "job_id": "farequote", "category_id": 1 }
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: category_definition type: category_definition
id: 2 id: 2
body: { "job_id": "farequote", "category_id": 2 } body: { "job_id": "farequote", "category_id": 2 }
- do: - do:
index: index:
index: prelertresults-unrelated index: .ml-anomalies-unrelated
type: category_definition type: category_definition
id: 3 id: 3
body: { "job_id": "unrelated", "category_id": 1 } body: { "job_id": "unrelated", "category_id": 1 }
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-farequote index: .ml-anomalies-farequote
--- ---
"Test result categories api": "Test result categories api":

View File

@ -1,7 +1,7 @@
setup: setup:
- do: - do:
indices.create: indices.create:
index: prelertresults-farequote index: .ml-anomalies-farequote
body: body:
mappings: mappings:
result: result:
@ -16,7 +16,7 @@ setup:
type: keyword type: keyword
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: result type: result
id: farequote_1464739200000_1_1 id: farequote_1464739200000_1_1
body: body:
@ -33,7 +33,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: result type: result
id: farequote_1464825600000_1_2 id: farequote_1464825600000_1_2
body: body:
@ -49,7 +49,7 @@ setup:
} }
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-farequote index: .ml-anomalies-farequote
--- ---
"Test result influencers api": "Test result influencers api":

View File

@ -1,7 +1,7 @@
setup: setup:
- do: - do:
indices.create: indices.create:
index: prelertresults-farequote index: .ml-anomalies-farequote
body: body:
mappings: mappings:
record: record:
@ -29,7 +29,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: result type: result
id: farequote_1464739200000_1_1 id: farequote_1464739200000_1_1
body: body:
@ -44,7 +44,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: result type: result
id: farequote_1464825600000_1_2 id: farequote_1464825600000_1_2
body: body:
@ -59,7 +59,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-farequote index: .ml-anomalies-farequote
--- ---
"Test result records api": "Test result records api":

View File

@ -52,7 +52,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-job-stats-test index: .ml-anomalies-job-stats-test
type: result type: result
id: model_size_stats id: model_size_stats
body: { body: {

View File

@ -56,7 +56,7 @@ setup:
- do: - do:
get: get:
index: prelertresults-farequote index: .ml-anomalies-farequote
type: data_counts type: data_counts
id: farequote-data-counts id: farequote-data-counts

View File

@ -1,7 +1,7 @@
setup: setup:
- do: - do:
indices.create: indices.create:
index: prelertresults-foo index: .ml-anomalies-foo
body: body:
mappings: mappings:
model_snapshot: model_snapshot:
@ -13,7 +13,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "1" id: "1"
body: > body: >
@ -26,7 +26,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "2" id: "2"
body: > body: >
@ -40,7 +40,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
--- ---
"Test without description": "Test without description":
@ -78,7 +78,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
- do: - do:
xpack.prelert.get_model_snapshots: xpack.prelert.get_model_snapshots:

View File

@ -26,7 +26,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "1" id: "1"
body: > body: >
@ -42,7 +42,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: model_snapshot type: model_snapshot
id: "2" id: "2"
body: > body: >
@ -58,42 +58,42 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1464825600000_1" id: "foo_1464825600000_1"
body: { "job_id": "foo", "result_type": "bucket", "timestamp": "2016-06-02T00:00:00Z", "bucket_span":1 } body: { "job_id": "foo", "result_type": "bucket", "timestamp": "2016-06-02T00:00:00Z", "bucket_span":1 }
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1464782400000_1" id: "foo_1464782400000_1"
body: { "job_id": "foo", "result_type": "bucket", "timestamp": "2016-06-01T12:00:00Z", "bucket_span":1 } body: { "job_id": "foo", "result_type": "bucket", "timestamp": "2016-06-01T12:00:00Z", "bucket_span":1 }
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1462060800000_1" id: "foo_1462060800000_1"
body: { "job_id": "foo", "result_type": "bucket", "timestamp": "2016-05-01T00:00:00Z", "bucket_span":1 } body: { "job_id": "foo", "result_type": "bucket", "timestamp": "2016-05-01T00:00:00Z", "bucket_span":1 }
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1464825600000_1_1" id: "foo_1464825600000_1_1"
body: { "job_id": "foo", "result_type": "record", "timestamp": "2016-06-02T00:00:00Z", "bucket_span":1, "sequence_num":1 } body: { "job_id": "foo", "result_type": "record", "timestamp": "2016-06-02T00:00:00Z", "bucket_span":1, "sequence_num":1 }
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1462060800000_1_2" id: "foo_1462060800000_1_2"
body: { "job_id": "foo", "result_type": "record", "timestamp": "2016-05-01T00:00:00Z", "bucket_span":1, "sequence_num":2 } body: { "job_id": "foo", "result_type": "record", "timestamp": "2016-05-01T00:00:00Z", "bucket_span":1, "sequence_num":2 }
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1464825600000_1_3" id: "foo_1464825600000_1_3"
body: { body: {
@ -109,7 +109,7 @@ setup:
- do: - do:
index: index:
index: prelertresults-foo index: .ml-anomalies-foo
type: result type: result
id: "foo_1462060800000_1_4" id: "foo_1462060800000_1_4"
body: body:
@ -126,7 +126,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
- do: - do:
indices.refresh: indices.refresh:
@ -258,7 +258,7 @@ setup:
- do: - do:
indices.refresh: indices.refresh:
index: prelertresults-foo index: .ml-anomalies-foo
- do: - do:
xpack.prelert.get_buckets: xpack.prelert.get_buckets: