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:
@@ -83,9 +83,7 @@ func filterShards(conf *cfg.Config, shardlist shards.Response) shards.Response {
|
||||
}
|
||||
|
||||
func ShardList(conf *cfg.Config) error {
|
||||
res, err := conf.DefaultCluster.ES.Cat.Shards().
|
||||
Header("content-type", "application/json").
|
||||
Header("accept", "application/json").
|
||||
res, err := conf.DefaultCluster.ES().Cat.Shards().
|
||||
Do(context.Background())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get shards: %s", esErrorString(err))
|
||||
@@ -135,9 +133,7 @@ func printShards(conf *cfg.Config, shardlist shards.Response) error {
|
||||
}
|
||||
|
||||
func ShardShow(conf *cfg.Config, index string) error {
|
||||
res, err := conf.DefaultCluster.ES.Cat.Shards().Index(index).
|
||||
Header("content-type", "application/json").
|
||||
Header("accept", "application/json").
|
||||
res, err := conf.DefaultCluster.ES().Cat.Shards().Index(index).
|
||||
Do(context.Background())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get shards: %s", esErrorString(err))
|
||||
|
||||
Reference in New Issue
Block a user