@@ -23,13 +23,18 @@ let DefaultSetup : Operation list = [Actions("Setup", fun (client, suite) ->
23
23
let deleteAll () =
24
24
let dp = DeleteIndexRequestParameters()
25
25
dp.SetQueryString( " expand_wildcards" , " open,closed,hidden" )
26
- client.Indices.Delete< DynamicResponse>( " *" , dp)
26
+ client.Indices.Delete< DynamicResponse>( " *,-.ds-ilm-history-* " , dp)
27
27
let templates () =
28
- client.Cat.Templates< StringResponse>( " *" , CatTemplatesRequestParameters( Headers=[ " name" ]. ToArray()))
28
+ client.Cat.Templates< StringResponse>( " *" , CatTemplatesRequestParameters( Headers=[ " name" ; " order " ]. ToArray()))
29
29
.Body.Split( " \n " )
30
- |> Seq.filter( fun f -> not ( String.IsNullOrWhiteSpace( f)) && not ( f.StartsWith( " ." )) && f <> " security-audit-log" )
30
+ |> Seq.map( fun line -> line.Split( " " , StringSplitOptions.RemoveEmptyEntries))
31
+ |> Seq.filter( fun line -> line.Length = 2 )
32
+ |> Seq.map( fun tokens -> tokens.[ 0 ], Int32.Parse( tokens.[ 1 ]))
33
+ //assume templates with order 100 or higher are defaults
34
+ |> Seq.filter( fun ( _ , order ) -> order < 100 )
35
+ |> Seq.filter( fun ( name , _ ) -> not ( String.IsNullOrWhiteSpace( name)) && not ( name.StartsWith( " ." )) && name <> " security-audit-log" )
31
36
//TODO template does not accept comma separated list but is documented as such
32
- |> Seq.map( fun template ->
37
+ |> Seq.map( fun ( template , _ ) ->
33
38
let result = client.Indices.DeleteTemplateForAll< DynamicResponse>( template)
34
39
match result.Success with
35
40
| true -> result
@@ -155,7 +160,7 @@ let DefaultSetup : Operation list = [Actions("Setup", fun (client, suite) ->
155
160
let indices =
156
161
let dp = DeleteIndexRequestParameters()
157
162
dp.SetQueryString( " expand_wildcards" , " open,closed,hidden" )
158
- client.Indices.Delete< DynamicResponse>( " *" , dp)
163
+ client.Indices.Delete< DynamicResponse>( " *,-.ds-ilm-history-* " , dp)
159
164
yield indices
160
165
161
166
let data = PostData.String @" {"" password"" :"" x-pack-test-password"" , "" roles"" :["" superuser"" ]}"
0 commit comments