@@ -331,28 +331,10 @@ private static function wipeSnapshots(Client $client): void
331
331
]);
332
332
foreach ($ repos ->asArray () as $ repository => $ value ) {
333
333
if ($ value ['type ' ] === 'fs ' ) {
334
- $ response = $ client ->snapshot ()->get ([
334
+ $ client ->snapshot ()->delete ([
335
335
'repository ' => $ repository ,
336
- 'snapshot ' => '_all ' ,
337
- 'ignore_unavailable ' => true
336
+ 'snapshot ' => '* '
338
337
]);
339
- if (isset ($ response ['responses ' ])) {
340
- $ response = $ response ['responses ' ][0 ];
341
- }
342
- if (isset ($ response ['snapshots ' ])) {
343
- foreach ($ response ['snapshots ' ] as $ snapshot ) {
344
- try {
345
- $ client ->snapshot ()->delete ([
346
- 'repository ' => $ repository ,
347
- 'snapshot ' => $ snapshot ['snapshot ' ]
348
- ]);
349
- } catch (ClientResponseException $ e ) {
350
- if ($ e ->getCode () !== 404 ) {
351
- throw $ e ;
352
- }
353
- }
354
- }
355
- }
356
338
}
357
339
try {
358
340
$ client ->snapshot ()->deleteRepository ([
@@ -684,11 +666,24 @@ private static function isXPackTemplate(string $name): bool
684
666
if (strpos ($ name , '.deprecation- ' ) !== false ) {
685
667
return true ;
686
668
}
669
+ if (strpos ($ name , '.fleet- ' ) !== false ) {
670
+ return true ;
671
+ }
672
+ if (strpos ($ name , 'behavioral_analytics- ' ) !== false ) {
673
+ return true ;
674
+ }
675
+ if (strpos ($ name , 'profiling- ' ) !== false ) {
676
+ return true ;
677
+ }
678
+ if (strpos ($ name , 'elastic-connectors ' ) !== false ) {
679
+ return true ;
680
+ }
687
681
switch ($ name ) {
688
682
case ".watches " :
689
683
case "security_audit_log " :
690
684
case ".slm-history " :
691
685
case ".async-search " :
686
+ case ".profiling-ilm-lock " :
692
687
case "saml-service-provider " :
693
688
case "logs " :
694
689
case "logs-settings " :
@@ -704,6 +699,9 @@ private static function isXPackTemplate(string $name): bool
704
699
case "logstash-index-template " :
705
700
case "security-index-template " :
706
701
case "data-streams-mappings " :
702
+ case "ecs@dynamic_templates " :
703
+ case "search-acl-filter " :
704
+ case ".kibana-reporting " :
707
705
return true ;
708
706
default :
709
707
return false ;
@@ -731,9 +729,16 @@ private static function preserveILMPolicyIds(): array
731
729
"90-days-default " ,
732
730
"180-days-default " ,
733
731
"365-days-default " ,
732
+ ".fleet-files-ilm-policy " ,
733
+ ".fleet-file-data-ilm-policy " ,
734
734
".fleet-actions-results-ilm-policy " ,
735
+ ".fleet-file-fromhost-data-ilm-policy " ,
736
+ ".fleet-file-fromhost-meta-ilm-policy " ,
737
+ ".fleet-file-tohost-data-ilm-policy " ,
738
+ ".fleet-file-tohost-meta-ilm-policy " ,
735
739
".deprecation-indexing-ilm-policy " ,
736
- ".monitoring-8-ilm-policy "
740
+ ".monitoring-8-ilm-policy " ,
741
+ "behavioral_analytics-events-default_policy "
737
742
];
738
743
}
739
744
0 commit comments