* chore: update openapi
* feat: update replication field names to match influx changes
* feat: add new field to show replication queue sync progress
* chore: update to master openapi
* chore: upgrade go releaser to v1.13.1 (#464)
* chore: update goreleaser and actually use go 1.19
* chore: format for go 1.19
Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>
Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>
* feat: add username and password login
* fix: make sure cookie is not empty
* chore: go mod tidy
* fix: prevent local config from influencing tests
* fix: small cleanup on error handling
* fix: remove unnecessary trim
* 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
* add v1-compatible query path and refactor other paths to de-duplicate "/query"
* add initial influxQL repl
* add ping endpoint to schema
* improve prompt UX, implement some commands
* fix json column type in schema and improve completion
* feat: add table formatter and move to forked go-prompt
* improve formatting and add table pagination
* implement more REPL commands, including insert and history
* implement "INSERT INTO"
* move repl command to "v1 repl"
* refactor and improve documentation
* clean up v1_repl cmd
* update to latest openapi, use some openapi paths instead of overrides
* remove additional files that were moved to openapi
* compute historyFilePath at REPL start
* clean up REPL use command logic flow
* clean up comments for TODOs now in issues
* move gopher (chonky boi)
* remove autocompletion for separate PR
* run go mod tidy
* add back autocompletion & go-prompt
* add rfc3339 precision option
* allow left and right column scrolling to display whole table
* add error to JSON query response
* add tags and partial to JSON response series schema
* fix csv formatting and add column formatting
* remove table format for separate PR
* fix getDatabases
* move from write to legacy write endpoint for INSERT
* remove history vestiges
* allow multiple spaces in INSERT commands
* add precision comment
* remove auth for separate PR
* separate parseInsert and add unit test
* add additional test case and improve error messages
* fix missing errors import
* fix format suggestion
* re-add history implementation with history limit
* build: upgrade to Go 1.18.3 (#395)
* feat: add back the InfluxQL REPL (#386)
* add v1-compatible query path and refactor other paths to de-duplicate "/query"
* add initial influxQL repl
* add ping endpoint to schema
* improve prompt UX, implement some commands
* fix json column type in schema and improve completion
* feat: add table formatter and move to forked go-prompt
* improve formatting and add table pagination
* implement more REPL commands, including insert and history
* implement "INSERT INTO"
* move repl command to "v1 repl"
* refactor and improve documentation
* clean up v1_repl cmd
* update to latest openapi, use some openapi paths instead of overrides
* remove additional files that were moved to openapi
* compute historyFilePath at REPL start
* clean up REPL use command logic flow
* clean up comments for TODOs now in issues
* move gopher (chonky boi)
* remove autocompletion for separate PR
* run go mod tidy
* add rfc3339 precision option
* allow left and right column scrolling to display whole table
* add error to JSON query response
* add tags and partial to JSON response series schema
* fix csv formatting and add column formatting
* remove table format for separate PR
* fix getDatabases
* move from write to legacy write endpoint for INSERT
* remove history vestiges
* allow multiple spaces in INSERT commands
* add precision comment
* remove auth for separate PR
* separate parseInsert and add unit test
* add additional test case and improve error messages
* fix missing errors import
* print rfc3339 precision
* add rfc3339 to help output
* run tidy
* restructure autocomplete and handle review items
* improve autocompletion with leftover handling
* improve comments and add autocomplete for DELETE & DROP MEASUREMENT
* rename repl to shell
* remove unsupported CREATE & DROP autocompletions
* additional refactor for autocompletion
Co-authored-by: Dane Strandboge <dstrandboge@influxdata.com>
* add v1-compatible query path and refactor other paths to de-duplicate "/query"
* add initial influxQL repl
* add ping endpoint to schema
* improve prompt UX, implement some commands
* fix json column type in schema and improve completion
* feat: add table formatter and move to forked go-prompt
* improve formatting and add table pagination
* implement more REPL commands, including insert and history
* implement "INSERT INTO"
* move repl command to "v1 repl"
* refactor and improve documentation
* clean up v1_repl cmd
* update to latest openapi, use some openapi paths instead of overrides
* remove additional files that were moved to openapi
* compute historyFilePath at REPL start
* clean up REPL use command logic flow
* clean up comments for TODOs now in issues
* move gopher (chonky boi)
* remove autocompletion for separate PR
* run go mod tidy
* add rfc3339 precision option
* allow left and right column scrolling to display whole table
* add error to JSON query response
* add tags and partial to JSON response series schema
* fix csv formatting and add column formatting
* remove table format for separate PR
* fix getDatabases
* move from write to legacy write endpoint for INSERT
* remove history vestiges
* allow multiple spaces in INSERT commands
* add precision comment
* remove auth for separate PR
* separate parseInsert and add unit test
* add additional test case and improve error messages
* fix missing errors import
* print rfc3339 precision
* add rfc3339 to help output
Influxdata cloud2 uses a different mechanism to enable tracing.
You need to pass a `influx-debug-id` header (the value is ignored) and if the response contains
`trace-sampled: true` then the response's `trace-id` header contains a valid trace ID that can be
used to jump to the trace in jaeger.
If the request has been sampled, we print the trace-id to stderr.
Since modern terminals allow to click on hyperlinks, we could avoid a copy&paste of the trace id
if the `influx` binary wrote a the link to the jeager trace.
However, we don't want to hardcode the URL of the internal jaeger endpoint in the binary.
I tried adding a wrapper script on my machine that would just capture the trace-id and render it, but it's
hard to do without messing with the ordering of the stderr and stdout lines.
Thus I preferred adding a secret env var that controls the formatting of the trace-id and can be used
by our devs to generate links to our internal jaeger instance.
```console
$ export INFLUX_CLI_TRACE_PRINT_PREFIX="Trace: https://jaeger.my.cloud/trace/"
$ influx query --trace-debug-id 123 -f query.flux
Trace: https://jaeger.my.cloud/trace/f39a69354a3acca6
Result: _result
Table: keys: [_measurement]
...
```
* chore: include enum values in openapi generated code
* chore: add enum template to list of template overrides
* chore: update template and generated code
* feat: generate permissions list from openapi spec
* feat: all-access and operator token from CLI
Closes#22510
* fix: cloud fixed the resources endpoint
* fix: all access and operator permissions cannot be composed
* fix: review comments from dan-moran
* feat: implement remote create subcommand
* chore: generate mocks for testing remote command
* refactor: separated out test code, made small changes to remote create code
* chore: ran make fmt
* chore: removed excess print statements
* refactor: made changes suggested in code review
* refactor: added name and remote id to printed table
* fix: cloud or oss only error msg for parsable responses
* fix: add code text to error message
* fix: keep the last part of the error msg
* chore: make the error code a little more succinct
* fix: corrected errors for non-server specific commands
* chore: sync openapi submodule with main
* 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