mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
get rid of getJsonPath, use flat_settings query flag instead (#66)
This commit is contained in:
@@ -28,7 +28,7 @@ type Tpl struct {
|
||||
}
|
||||
|
||||
func getIndexTemplateSettings(conf *cfg.Config, tplname string, table *printer.Table) error {
|
||||
raw, err := CallAPI(conf, "GET", "/_index_template/"+tplname, "")
|
||||
raw, err := CallAPI(conf, "GET", "/_index_template/"+tplname+"?flat_settings", "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -52,11 +52,7 @@ func getIndexTemplateSettings(conf *cfg.Config, tplname string, table *printer.T
|
||||
|
||||
tpl := data.IndexTemplates[0].IndexTemplate.Template.Settings
|
||||
for topic, val := range tpl {
|
||||
paths := getJsonPath(map[string]string{}, val.(map[string]any), topic)
|
||||
|
||||
for setting, value := range paths {
|
||||
table.Entries = append(table.Entries, []string{setting, fmt.Sprintf("%v", value)})
|
||||
}
|
||||
table.Entries = append(table.Entries, []string{topic, fmt.Sprintf("%v", val)})
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user