enhance ilm show, add ilm update, rename modify to update everywhere (#58)

This commit is contained in:
T. von Dein
2026-06-29 11:48:29 +02:00
parent b7a87051c0
commit f9eded5f92
4 changed files with 135 additions and 19 deletions

View File

@@ -36,7 +36,8 @@ func Ilm(conf *cfg.Config) *cli.Command {
IlmStatus(conf),
IlmList(conf),
IlmShow(conf),
IlmCreate(conf),
IlmCreate(conf, false),
IlmCreate(conf, true),
IlmForecast(conf),
IlmExplain(conf),
},
@@ -127,12 +128,22 @@ func IlmShow(conf *cfg.Config) *cli.Command {
}
}
func IlmCreate(conf *cfg.Config) *cli.Command {
func IlmCreate(conf *cfg.Config, modify bool) *cli.Command {
name := "create"
alias := "+"
usage := "create a new lifecycle policy"
if modify {
name = "update"
usage = "update an lifecycle policy"
alias = "upd"
}
return &cli.Command{
Name: "create",
Aliases: []string{"+"},
Usage: "create a index lifecycle policy",
UsageText: "create [options] <policy>",
Name: name,
Aliases: []string{alias},
Usage: usage,
UsageText: name + " [options] <policy>",
Flags: []cli.Flag{
&cli.StringFlag{

View File

@@ -154,8 +154,8 @@ func IndexCreate(conf *cfg.Config, modify bool) *cli.Command {
usage := "create a new index"
if modify {
name = "modify"
usage = "modify anindex"
name = "update"
usage = "update an index"
}
return &cli.Command{

View File

@@ -83,8 +83,8 @@ func IndexTemplateCreate(conf *cfg.Config, modify bool) *cli.Command {
required := true
if modify {
name = "modify"
alias = "mod"
name = "update"
alias = "upd"
required = false
}