@@ -22,13 +22,18 @@ let DefaultSetup : Operation list = [Actions("Setup", fun (client, suite) ->
2222 let deleteAll () =
2323 let dp = DeleteIndexRequestParameters()
2424 dp.SetQueryString( " expand_wildcards" , " open,closed,hidden" )
25- client.Indices.Delete< DynamicResponse>( " *" , dp)
25+ client.Indices.Delete< DynamicResponse>( " *,-.ds-ilm-history-* " , dp)
2626 let templates () =
27- client.Cat.Templates< StringResponse>( " *" , CatTemplatesRequestParameters( Headers=[ " name" ]. ToArray()))
27+ client.Cat.Templates< StringResponse>( " *" , CatTemplatesRequestParameters( Headers=[ " name" ; " order " ]. ToArray()))
2828 .Body.Split( " \n " )
29- |> Seq.filter( fun f -> not ( String.IsNullOrWhiteSpace( f)) && not ( f.StartsWith( " ." )) && f <> " security-audit-log" )
29+ |> Seq.map( fun line -> line.Split( " " , StringSplitOptions.RemoveEmptyEntries))
30+ |> Seq.filter( fun line -> line.Length = 2 )
31+ |> Seq.map( fun tokens -> tokens.[ 0 ], Int32.Parse( tokens.[ 1 ]))
32+ //assume templates with order 100 or higher are defaults
33+ |> Seq.filter( fun ( _ , order ) -> order < 100 )
34+ |> Seq.filter( fun ( name , _ ) -> not ( String.IsNullOrWhiteSpace( name)) && not ( name.StartsWith( " ." )) && name <> " security-audit-log" )
3035 //TODO template does not accept comma separated list but is documented as such
31- |> Seq.map( fun template ->
36+ |> Seq.map( fun ( template , _ ) ->
3237 let result = client.Indices.DeleteTemplateForAll< DynamicResponse>( template)
3338 match result.Success with
3439 | true -> result
@@ -158,7 +163,7 @@ let DefaultSetup : Operation list = [Actions("Setup", fun (client, suite) ->
158163 let indices =
159164 let dp = DeleteIndexRequestParameters()
160165 dp.SetQueryString( " expand_wildcards" , " open,closed,hidden" )
161- client.Indices.Delete< DynamicResponse>( " *" , dp)
166+ client.Indices.Delete< DynamicResponse>( " *,-.ds-ilm-history-* " , dp)
162167 yield indices
163168
164169 let data = PostData.String @" {"" password"" :"" x-pack-test-password"" , "" roles"" :["" superuser"" ]}"
0 commit comments