@@ -324,10 +324,6 @@ def clear_datafeeds(client)
324
324
end
325
325
end
326
326
327
- def clear_datastreams ( client )
328
- client . xpack . indices . delete_data_stream ( name : '*' , expand_wildcards : 'all' )
329
- end
330
-
331
327
def clear_ml_jobs ( client )
332
328
client . xpack . ml . close_job ( job_id : '_all' , force : true )
333
329
client . xpack . ml . get_jobs [ 'jobs' ] . each do |d |
@@ -378,14 +374,19 @@ def clear_transforms(client)
378
374
end
379
375
end
380
376
377
+ def clear_datastreams ( client )
378
+ client . xpack . indices . delete_data_stream ( name : '*' , expand_wildcards : 'all' )
379
+ client . indices . delete_data_stream ( name : '*' , expand_wildcards : 'all' )
380
+ end
381
+
381
382
def clear_indices ( client )
382
383
client . indices . delete ( index : '*' , expand_wildcards : 'all' , ignore : 404 )
383
384
384
385
indices = client . indices . get ( index : '_all' , expand_wildcards : 'all' ) . keys . reject do |i |
385
- i . start_with? ( '.security' ) || i . start_with? ( '.watches' ) || i . start_with? ( '.ds-' )
386
+ i . start_with? ( '.security' ) || i . start_with? ( '.watches' )
386
387
end
387
388
indices . each do |index |
388
- client . indices . delete_alias ( index : index , name : '*' , ignore : 404 )
389
+ client . indices . delete_alias ( index : index , name : '*' , ignore : 404 ) unless index . start_with? ( '.ds' )
389
390
client . indices . delete ( index : index , ignore : 404 )
390
391
end
391
392
rescue Elasticsearch ::Transport ::Transport ::Errors ::BadRequest => e
0 commit comments