Skip to content

Commit 741bbf4

Browse files
authored
Merge pull request #18 from SwissLife-OSS/filter-by-ilm-policy
Add filter by ILM policy
2 parents 6a9f540 + 96dd204 commit 741bbf4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cmd_ilm_list.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
2929

3030
action := cmd.String("action")
3131
phase := cmd.String("phase")
32+
ilmPolicy := cmd.String("ilm-policy")
3233
sortColumns := cmd.StringSlice("sort")
3334
minPriSizeStr := cmd.String("min-pri-size")
3435
minTotalSizeStr := cmd.String("min-total-size")
@@ -140,6 +141,10 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
140141
continue
141142
}
142143

144+
if ilmPolicy != "" && ilmPolicy != *managed.Policy {
145+
continue
146+
}
147+
143148
priSize := priSizes[index]
144149

145150
if priSize < minPriSize {

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ func run(ctx context.Context, args []string) error {
7373
Aliases: []string{"p"},
7474
Usage: "Filter to only include indices in the given phase",
7575
},
76+
&cli.StringFlag{
77+
Name: "ilm-policy",
78+
Aliases: []string{"i"},
79+
Usage: "Filter to only include indices with the given ILM policy attached",
80+
},
7681
&cli.StringSliceFlag{
7782
Name: "sort",
7883
Aliases: []string{"s"},

0 commit comments

Comments
 (0)