Files
influx-cli/cmd/influx/ping.go
William Baker d519890f03 feat: improved error messages for cloud- or oss-only commands (#140)
* 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
2021-06-23 10:41:35 -04:00

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)
},
}
}