mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
add alias+datastream rollover, and auto rollover on index tpl change (#40)
fixes #37
This commit is contained in:
@@ -113,3 +113,23 @@ func IndexAliasDelete(conf *cfg.Config, index, alias string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func IndexAliasRollover(conf *cfg.Config, alias string) error {
|
||||
res, err := RolloverAlias(conf, alias)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to rollover index alias: %s", esErrorString(err))
|
||||
}
|
||||
|
||||
table := printer.NewTable(conf, 2, 5)
|
||||
table.Addheaders("rollover response", "value")
|
||||
table.Entries = [][]string{
|
||||
{"acknowledged", fmt.Sprintf("%t", res.Acknowledged)},
|
||||
{"rolled over", fmt.Sprintf("%t", res.RolledOver)},
|
||||
{"shards acknowledged", fmt.Sprintf("%t", res.ShardsAcknowledged)},
|
||||
{"old index", res.OldIndex},
|
||||
{"new index", res.NewIndex},
|
||||
}
|
||||
|
||||
return table.Print()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user