-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatafeed_crud.yml
91 lines (89 loc) · 2.29 KB
/
datafeed_crud.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
---
requires:
serverless: true
stack: true
---
setup:
- do:
ml.put_job:
job_id: datafeeds-crud-1
body: >
{
"job_id":"datafeeds-crud-1",
"analysis_config" : {
"bucket_span": "1h",
"detectors" :[{"function":"count"}],
"summary_count_field_name": "doc_count"
},
"data_description" : {
"format":"xcontent",
"time_field":"time",
"time_format":"epoch"
}
}
- do:
ml.put_job:
job_id: datafeeds-crud-2
body: >
{
"analysis_config" : {
"bucket_span": "1h",
"detectors" :[{"function":"count"}]
},
"data_description" : {
"time_field":"time"
}
}
---
teardown:
- do:
ml.delete_job: { job_id: datafeeds-crud-1, force: true }
- do:
ml.delete_job: { job_id: datafeeds-crud-2, force: true }
---
"datafeeds cruds":
- do:
ml.get_datafeeds:
datafeed_id: "_all"
- match: { count: 0 }
- match: { datafeeds: [] }
- do:
ml.get_datafeed_stats:
datafeed_id: "_all"
- match: { count: 0 }
- match: { datafeeds: [] }
- do:
ml.put_datafeed:
datafeed_id: test-datafeed-1
body: >
{
"job_id":"datafeeds-crud-1",
"indexes":["index-foo"]
}
- match: { datafeed_id: "test-datafeed-1" }
- match: { job_id: "datafeeds-crud-1" }
- match: { indices: ["index-foo"] }
- match: { scroll_size: 1000 }
- is_true: query.match_all
- match: { chunking_config: { mode: "auto" }}
- do:
ml.update_datafeed:
datafeed_id: test-datafeed-1
body: >
{
"indexes":["index-*"],
"scroll_size": 10000,
"frequency": "2m",
"query_delay": "0s",
"max_empty_searches": -1
}
- match: { datafeed_id: "test-datafeed-1" }
- match: { job_id: "datafeeds-crud-1" }
- match: { indices: ["index-*"] }
- match: { scroll_size: 10000 }
- match: { frequency: "2m" }
- match: { query_delay: "0s" }
- is_false: max_empty_searches
- do:
ml.delete_datafeed: { datafeed_id: "test-datafeed-1" }
- is_true: acknowledged