mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
add alias+datastream rollover, and auto rollover on index tpl change (#40)
fixes #37
This commit is contained in:
@@ -237,3 +237,23 @@ func DatastreamDelete(conf *cfg.Config, dsname string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func DatastreamRollover(conf *cfg.Config, ds string) error {
|
||||
res, err := RolloverAlias(conf, ds)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to rollover data stream: %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