William Baker 7af0b2ae73
feat: enhanced error messages for cloud and oss specific commands (#347)
* feat: enhanced error messages for cloud and oss specific commands

* chore: rename test
2021-12-28 10:03:29 -05:00

24 lines
580 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"
)
func newPingCmd() cli.Command {
return cli.Command{
Name: "ping",
Usage: "Check the InfluxDB /health endpoint",
Before: middleware.WithBeforeFns(withCli(), withApi(false), middleware.NoArgs),
Flags: coreFlags(),
Action: func(ctx *cli.Context) error {
client := ping.Client{
CLI: getCLI(ctx),
HealthApi: getAPINoToken(ctx).HealthApi,
}
return client.Ping(getContext(ctx))
},
}
}