Daniel Moran 0ee555c6a7
fix: fix bugs in new influx restore impl (#124)
* fix: adjust restore-org logic to handle 404
* fix: overwrite org ID and name before restoring bucket
2021-06-16 11:22:01 -04:00
2021-04-09 14:21:16 -04:00

influx-cli

CLI for managing resources in InfluxDB v2

Status

This is a work-in-progress effort to decouple the influx CLI from the OSS influxdb codebase. Our goals are to:

  1. Make it easier to keep the CLI up-to-date with InfluxDB Cloud API changes
  2. Enable faster turn-around on fixes/features that only affect the CLI
  3. Allow the CLI to be built & released for a wider range of platforms than the server can support

Building

Development build

Run make or make influx to build the CLI. The output binary will be written to bin/$(GOOS)/influx.

Release build

We use goreleaser to manage cross-building the CLI for release. Run make build to build the CLI with release settings for your current GOOS and GOARCH. Run make crossbuild to build the CLI for all GOOS/GOARCH pairs supported by the CLI. The output binary/binaries will be written under dist/influx_${GOOS}_${GOARCH}/.

Regenerating OpenAPI client

We use OpenAPITools/openapi-generator to generate the underlying HTTP client used by the CLI. Run make openapi to re-generate the code. You'll need Docker running locally for the script to work.

Running

After building, use influx -h to see the list of available commands.

Enabling Completions

The CLI supports generating completions for bash, zsh, and powershell. To enable completions for a single shell session, run one of these commands:

# For bash:
source <(influx completion bash)
# For zsh:
source <(influx completion zsh)
# For pwsh:
Invoke-Expression ((influx completion powershell) -join "`n`")

To enable completions across sessions, add the appropriate line to your shell's login profile (i.e. ~/.bash_profile).

Testing

Run make test to run unit tests.

Description
No description provided
Readme 1.8 MiB
Languages
Go 92%
Mustache 6.1%
Shell 1.6%
Makefile 0.3%