51 Commits

Author SHA1 Message Date
Daniel Moran
b1ba53bae2
refactor: move request-compression out of codegen, avoid some buffering (#118) 2021-06-11 16:01:34 -04:00
Daniel Moran
a1f8e0edf1
test: remove racy logic from backup test (#117) 2021-06-11 10:01:51 -04:00
Daniel Moran
943e8fba31
feat: reimplement influx backup using new APIs (#116) 2021-06-11 09:50:39 -04:00
Dane Strandboge
ea2cbab67b
chore: add .idea/ to gitignore (#115) 2021-06-10 13:48:23 -05:00
Daniel Moran
a387cabcfb
refactor: return full HTTP response for binary response bodies (#112) 2021-06-10 11:20:33 -04:00
Pavel Závora
1c2f61f5ca
feat(write): warn about standalone CR characters in header lines (#109)
* feat(write): warn about standalone CR characters in header lines

* feat(write): add test for Windows CRLF line endings

* chore: improve warning message

Co-authored-by: Daniel Moran <danxmoran@gmail.com>

* chore: update test with a new warning message

Co-authored-by: Daniel Moran <danxmoran@gmail.com>
2021-06-07 14:59:57 +02:00
Daniel Moran
a1cf15d971
refactor: codegen backup and restore APIs (#107) 2021-06-02 16:19:36 -04:00
Sam Arnold
63da8eccbd
feat: task subcommand (#105)
* feat: task subcommand

Closes #19

* fix: testing and review comments

* fix: pointer deref and error message
2021-05-26 08:44:22 -04:00
Sam Arnold
9747d05ae1
refactor: expose generated code and client business logic to share with Kapacitor (#103)
* 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
2021-05-25 10:05:01 -04:00
Sam Arnold
d54aa9ec2d
feat: create subcommand for tasks cli (#102)
* refactor: add task APIs to codegen

* feat: tasks subcommand

Co-authored-by: Dan Moran <dmoran@influxdata.com>
2021-05-25 09:06:37 -04:00
Daniel Moran
4981b6742e
build: set up goreleaser for release (cross-)builds (#101) 2021-05-22 21:21:44 -04:00
Daniel Moran
60dd8b54b5
feat: port user commands from influxdb (#99) 2021-05-20 13:24:13 -04:00
Daniel Moran
e4af676ae5
feat: port delete from influxdb (#98) 2021-05-20 09:20:30 -04:00
Daniel Moran
d8ef442b64
feat: port org members commands from influxdb (#97) 2021-05-19 11:02:59 -04:00
Daniel Moran
8ab34d59e6
feat: port top-level org commands from influxdb. (#96) 2021-05-17 15:43:02 -04:00
Daniel Moran
b1851eb819
refactor(api): move CLI-specific API contract into this repo, add openapi as submodule (#95) 2021-05-17 14:53:55 -04:00
Daniel Moran
8e73906437
refactor: replace global slices with functions (#94)
I started to see strange behavior where flags would merge across
subcommands. I'm not sure if the bug was in our 'append' usage or
in urfave/cli's handling of flag-slices, but this change seems to
fix the problem either way.
2021-05-14 16:10:07 -04:00
Daniel Moran
9fe4197625
refactor: bump codegen to pull in more /orgs APIs (#93) 2021-05-14 15:16:19 -04:00
Daniel Moran
99d573bdaa
feat: port influx config from influxdb (#90) 2021-05-13 11:47:03 -04:00
Daniel Moran
6a9f17d100
feat: add formatted output to influx query (#87) 2021-05-13 10:54:45 -04:00
Daniel Moran
d22fb717c6
feat: port most of influx query from influxdb (#86) 2021-05-12 15:18:08 -04:00
Daniel Moran
223ae250a9
refactor: update codegen to use schema-less flux AST (#65) 2021-05-11 09:35:03 -04:00
Daniel Moran
ead7e63d41
refactor: split flat internal/ module into modules-per-cmd (#64) 2021-05-06 13:47:03 -04:00
Daniel Moran
d995f7d182
test: replace hand-written mocks with gomock (#63) 2021-05-06 10:19:41 -04:00
Daniel Moran
c44fec7d6d
feat(internal): add /query API to codegen (#62) 2021-05-05 11:01:24 -04:00
Daniel Moran
f95668ada6
refactor: improve codegen to support influx query rewrite (#60)
* build: add goimports to fmt target to remove unused imports
* feat: update codegen template to support returning raw response body
* feat: add support for gunzip-ing response bodies
* refactor: remove unused piece from codegen return values
2021-05-05 10:30:22 -04:00
Stuart Carnie
7eca7c0bb9
feat: Add bucket schema management commands (#52)
* feat: update generated client to include schema-management APIs
* feat: implement interfaces to decode flags and CSV
* feat: implement decoders for different measurement schema column formats
* feat: extend bucket CLI commands to support schema type property
* feat: add CLI commands to manage measurement schema
* test: add unit tests for bucket schema create, update and list commands
2021-05-05 10:12:11 -04:00
Daniel Moran
4a1e6223f0
feat: add bash/zsh/powershell completions (#59) 2021-05-04 12:17:13 -04:00
Daniel Moran
bf750650ec
fix: check server status before local config to improve error message (#58) 2021-05-03 11:17:57 -04:00
Daniel Moran
cf2b2f2791
refactor: update codegen to clean old files, use new extension (#57) 2021-05-03 11:06:18 -04:00
Stuart Carnie
3414e1a983
refactor: Move from global state to functions (#53)
This commit represents a few experiments of features I've used in Cobra

1. Uses cli.GenericFlag to encapsulate parsing and validation of flag
   values at parse time. This removes the burden from the individual
   CLI commands to parse and validate args and options.

2. Add influxid.ID that may be used by any flag that requires an
   Influx ID. influxid.ID parses and validates string value is a valid
   ID, removing this burden from individual commands and ensuring valid
   values before the command actions begins.

3. Binds cli.Flags directly to params structures to directly capture
   the values when parsing flags.

4. Moves from global state to local builder functions for the majority
   of the commands. This allows the commands to bind to flag variables
   reducing the repeated ctx.String(), ctx.Int(), etc

5. Leverages the BeforeFunc to create middleware and inject the CLI and
   API client into commands, saving the repeated boilerplate across
   all of the instantiated commands. This is extensible, so additional
   middleware can be appends using the middleware.WithBeforeFns
2021-05-03 09:31:45 -04:00
Daniel Moran
0b4d753728
feat: port influx bucket commands from influxdb (#54)
* feat: add /buckets and /orgs APIs to codegen
* feat: add bucket CLI commands
* test: add bucket tests
2021-05-03 08:46:53 -04:00
Daniel Moran
b038973a19
refactor: switch to Execute() method on requests (#56) 2021-04-30 16:42:29 -04:00
Daniel Moran
7f5542c119
refactor: inject trace ID as a default header (#50) 2021-04-27 17:21:37 -04:00
Daniel Moran
0e1db1e782
feat: port influx write from influxdb (#47) 2021-04-26 12:32:54 -04:00
Daniel Moran
bd97d2c7f3
refactor: split CLI commands into separate files (#46) 2021-04-26 10:48:15 -04:00
Daniel Moran
3fddaf00a9
feat: port write-batcher from influxdb (#42)
Co-authored-by: William Baker <55118525+wbaker85@users.noreply.github.com>
2021-04-26 10:47:26 -04:00
Daniel Moran
ab91522081
feat: port line reader from influxdb (#45) 2021-04-26 10:47:02 -04:00
Daniel Moran
74d622bece
feat: port rate-limiter from influxdb (#44) 2021-04-26 10:46:32 -04:00
Daniel Moran
1aa715df05
refactor: replace api.yml with copy downloaded from openapi repo (#43) 2021-04-26 10:46:02 -04:00
Daniel Moran
73dc5ef63b
feat(api): improve codegen outputs (#41)
* Use `[]byte` for generated request bodies when the source schema has `format: byte`
* Gzip-compress request bodies when `Content-Encoding: gzip` is set
* Require that all models returned as error conditions in our API implement the `error` interface
* Move the implementation for `api.HealthCheck` out of `ping.go` and into `api/error.go`


Co-authored-by: William Baker <55118525+wbaker85@users.noreply.github.com>
2021-04-26 10:10:45 -04:00
Daniel Moran
5328b1fdc8
fix: fix some issues with the local config service (#40) 2021-04-26 09:57:36 -04:00
Daniel Moran
cf30ec4345
refactor: move mock APIs and services into mock module (#39) 2021-04-26 09:51:27 -04:00
Daniel Moran
7d6ea73c33
feat: use signal-wrapped contexts in CLI commands (#38) 2021-04-26 09:51:15 -04:00
Daniel Moran
f2d10e34f9
feat: port csv2lp from influxdb (#37)
Co-authored-by: William Baker <55118525+wbaker85@users.noreply.github.com>
2021-04-26 09:12:29 -04:00
Daniel Moran
68ad797ab7
feat: port influx setup from influxdb (#35) 2021-04-22 09:46:15 -04:00
Daniel Moran
079f707c21
refactor: replace bash hacks with custom templates (#34) 2021-04-19 15:51:53 -04:00
Daniel Moran
4f62e469e9
refactor: switch to OpenAPITools's generator for our HTTP clients (#33)
* build: add CI job to check OpenAPI generation is clean
* feat: add hidden flag for HTTP debug
2021-04-16 17:16:58 -04:00
Daniel Moran
ca8a5c5364
feat: implement ping command (#31)
* build: use deepmap/oapi-codegen to generate an HTTP client
* feat: add global CLI options
* feat: load local config to find host and token
* feat: implement ping command
* test: add unit tests for ping command
2021-04-14 09:31:21 -04:00
Daniel Moran
8c062cacf0
feat: set up project skeleton for new CLI (#1)
* docs: fill in README
* feat: initial setup of CLI, with help + version commands
* build: add linters and Makefile
* build: add initial CircleCI workflow
2021-04-12 13:39:09 -04:00