mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 10:04:18 +02:00
streamline table api
This commit is contained in:
@@ -59,7 +59,7 @@ func IndexTemplateList(conf *cfg.Config, filter string) error {
|
||||
|
||||
slog.Debug("res", "index templates", res)
|
||||
|
||||
table := printer.NewTable(conf, 5, 0)
|
||||
table := printer.NewTable(conf).WithSize(5, 0)
|
||||
table.Addheaders("name", "description", "index patterns", "priority")
|
||||
|
||||
tplList := filterIndexTemplates(conf, filter, res.IndexTemplates)
|
||||
@@ -120,7 +120,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
|
||||
|
||||
tpl := res.IndexTemplates[0]
|
||||
|
||||
table := printer.NewTable(conf, 2, 6)
|
||||
table := printer.NewTable(conf).WithSize(2, 6)
|
||||
table.Addheaders("index template property", "value")
|
||||
|
||||
desc, err := json.Marshal(tpl.IndexTemplate.Meta_["description"])
|
||||
@@ -148,7 +148,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
table = printer.NewTable(conf, 2, 0)
|
||||
table = printer.NewTable(conf).WithSize(2, 0)
|
||||
table.Addheaders("index setting property", "value")
|
||||
|
||||
err = getIndexTemplateSettings(conf, tplname, table)
|
||||
@@ -162,7 +162,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
table = printer.NewTable(conf, 2, 0)
|
||||
table = printer.NewTable(conf).WithSize(2, 0)
|
||||
table.Addheaders("index field mapping", "type")
|
||||
|
||||
if tpl.IndexTemplate.Template.Mappings != nil {
|
||||
@@ -441,7 +441,7 @@ func rolloverAliasIndexTemplate(conf *cfg.Config, name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
table := printer.NewTable(conf, 4, 0)
|
||||
table := printer.NewTable(conf).WithSize(4, 0)
|
||||
table.Addheaders("rollover alias", "status", "ack", "new index")
|
||||
|
||||
// apply rollover to all matching aliases, if any
|
||||
|
||||
Reference in New Issue
Block a user