forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ml_anomalies_default_mappings.yml
107 lines (96 loc) · 3.34 KB
/
ml_anomalies_default_mappings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
setup:
- skip:
features: headers
---
"Test new fields are mapped as keyword":
- do:
xpack.ml.put_job:
job_id: ml-anomalies-default-mappings-job
body: >
{
"analysis_config" : {
"bucket_span": "1h",
"detectors" :[{"function":"count","by_field_name":"foo"}]
},
"data_description" : {
"time_field":"time"
}
}
- match: { job_id: "ml-anomalies-default-mappings-job" }
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
Content-Type: application/json
index:
index: .ml-anomalies-shared
type: doc
id: "new_doc"
body: >
{
"new_field": "bar"
}
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
indices.refresh:
index: .ml-anomalies-shared
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
indices.get_field_mapping:
index: .ml-anomalies-shared
type: doc
fields: new_field
- match: {\.ml-anomalies-shared.mappings.doc.new_field.mapping.new_field.type: keyword}
---
"Test _meta exists when two jobs share an index":
- do:
xpack.ml.put_job:
job_id: ml-anomalies-shared-mappings-job1
body: >
{
"analysis_config" : {
"bucket_span": "1h",
"detectors" :[{"function":"count","by_field_name":"foo"}]
},
"data_description" : {
"time_field":"time"
}
}
- match: { job_id: "ml-anomalies-shared-mappings-job1" }
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
indices.refresh:
index: .ml-anomalies-shared
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
indices.get_mapping:
index: .ml-anomalies-shared
- is_true: \.ml-anomalies-shared.mappings.doc._meta.version
- do:
xpack.ml.put_job:
job_id: ml-anomalies-shared-mappings-job2
body: >
{
"analysis_config" : {
"bucket_span": "1h",
"detectors" :[{"function":"count","by_field_name":"bar"}]
},
"data_description" : {
"time_field":"time"
}
}
- match: { job_id: "ml-anomalies-shared-mappings-job2" }
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
indices.refresh:
index: .ml-anomalies-shared
- do:
headers:
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
indices.get_mapping:
index: .ml-anomalies-shared
- is_true: \.ml-anomalies-shared.mappings.doc._meta.version