* add owners endpoints to cli.yml
* run make openapi and mock
* add owner listing, adding and removing
* fix: update tests to remove getUser indirection
* basic list, create, and invoke working
* all commands working
* added support for create script body from file and invoke params from file
* linter cleanup
* update defaults to existing parameters if not provided
* updated generated mock files, added mock files for scripts, added basic script create test
* added mock script list
* cleanup pass, fixed not using params in list call
* added update mock test
* fixed mock tests requiring go 1.18
* updated openapi, integrated overrides upstream, added new override to fix codegen bug
* added nil check
* fixed routes
* 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
* feat: v1 dbrp commands
* fix: fixed the cloud create command
* chore: cleanup
* fix: updated based on required attrs in swagger
* feat: update to latest openapi rev
* chore: made dbrps plural consistently
* chore: formatting
* fix: standardized Default field name and added comments
* chore: changed file name for command to singular
* 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
* 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
* 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
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