Files
influx-cli/cmd/influx/ping.go
Sam Arnold 9747d05ae1 refactor: expose generated code and client business logic to share with Kapacitor (#103)
* refactor: take clients out of internal

* refactor: move stdio to pkg

* Move internal/api to api

* refactor: final changes for Kapacitor to access shared functionality

* chore: regenerate mocks

* fix: bad automated refactor

* chore: extra formatting not caught by make fmt
2021-05-25 10:05:01 -04:00

24 lines
562 B
Go

package main
import (
"github.com/influxdata/influx-cli/v2/clients/ping"
"github.com/influxdata/influx-cli/v2/pkg/cli/middleware"
"github.com/urfave/cli/v2"
)
func newPingCmd() *cli.Command {
return &cli.Command{
Name: "ping",
Usage: "Check the InfluxDB /health endpoint",
Before: middleware.WithBeforeFns(withCli(), withApi(false)),
Flags: coreFlags(),
Action: func(ctx *cli.Context) error {
client := ping.Client{
CLI: getCLI(ctx),
HealthApi: getAPINoToken(ctx).HealthApi,
}
return client.Ping(ctx.Context)
},
}
}