
* 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
24 lines
562 B
Go
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)
|
|
},
|
|
}
|
|
}
|