
* feat: set logging info for cloud- or oss-only commands * fix: add cloud-only to BucketSchemasApi * fix: api-only flagging and %w for return error wrapping * fix: keep the model assignment
24 lines
572 B
Go
24 lines
572 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.OnlyOSS(),
|
|
}
|
|
return client.Ping(ctx.Context)
|
|
},
|
|
}
|
|
}
|