Skip to content

Commit 11f246f

Browse files
committed
Add filter by action
1 parent 0dce13f commit 11f246f

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

28+
action := cmd.String("action")
2829
phase := cmd.String("phase")
2930
sortColumns := cmd.StringSlice("sort")
3031
minSizeStr := cmd.String("min-size")
@@ -110,6 +111,10 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
110111
continue
111112
}
112113

114+
if action != "" && action != *managed.Action {
115+
continue
116+
}
117+
113118
if phase != "" && phase != *managed.Phase {
114119
continue
115120
}

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)