Skip to content

Commit 6a9f540

Browse files
authored
Merge pull request #19 from SwissLife-OSS/filter-by-action
Add filter by action
2 parents cbf0d20 + 11f246f commit 6a9f540

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
@@ -27,6 +27,7 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
2727
username := cmd.String("username")
2828
password := cmd.String("password")
2929

30+
action := cmd.String("action")
3031
phase := cmd.String("phase")
3132
sortColumns := cmd.StringSlice("sort")
3233
minPriSizeStr := cmd.String("min-pri-size")
@@ -131,6 +132,10 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
131132
continue
132133
}
133134

135+
if action != "" && action != *managed.Action {
136+
continue
137+
}
138+
134139
if phase != "" && phase != *managed.Phase {
135140
continue
136141
}

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ func run(ctx context.Context, args []string) error {
6363
Name: "list",
6464
Usage: "list ilm managed indices filtered by phase",
6565
Flags: []cli.Flag{
66+
&cli.StringFlag{
67+
Name: "action",
68+
Aliases: []string{"a"},
69+
Usage: "Filter to only include indices in the given action",
70+
},
6671
&cli.StringFlag{
6772
Name: "phase",
6873
Aliases: []string{"p"},

0 commit comments

Comments
 (0)