mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 05:04:18 +02:00
enhanced default cluster selection, add 'cluster switch', overhaul json header setting (#47)
This commit is contained in:
@@ -43,7 +43,7 @@ type Snapshot struct {
|
||||
|
||||
func SnapshotList(conf *cfg.Config) error {
|
||||
// get partial indicies
|
||||
ires, err := conf.DefaultCluster.ES.Cat.Indices().Do(context.Background())
|
||||
ires, err := conf.DefaultCluster.ES().Cat.Indices().Do(context.Background())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get indicies: %s", esErrorString(err))
|
||||
}
|
||||
@@ -56,7 +56,7 @@ func SnapshotList(conf *cfg.Config) error {
|
||||
}
|
||||
|
||||
// get snapshots
|
||||
sres, err := conf.DefaultCluster.ES.Cat.Snapshots().Do(context.Background())
|
||||
sres, err := conf.DefaultCluster.ES().Cat.Snapshots().Do(context.Background())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get snapshots: %s", esErrorString(err))
|
||||
}
|
||||
@@ -106,7 +106,7 @@ func SnapshotList(conf *cfg.Config) error {
|
||||
}
|
||||
|
||||
func SnapshotShow(conf *cfg.Config, snapshot string) error {
|
||||
res, err := conf.DefaultCluster.ES.Snapshot.Get("*", snapshot).Do(context.Background())
|
||||
res, err := conf.DefaultCluster.ES().Snapshot.Get("*", snapshot).Do(context.Background())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get snapshot: %s", esErrorString(err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user