Commit Graph

24 Commits

Author SHA1 Message Date
fc529745a5 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
2022-06-10 08:54:07 -06:00
35279515e9 build: upgrade to Go 1.18.1 (#373) 2022-04-13 15:50:35 -05:00
7af0b2ae73 feat: enhanced error messages for cloud and oss specific commands (#347)
* feat: enhanced error messages for cloud and oss specific commands

* chore: rename test
2021-12-28 10:03:29 -05:00
178c7546b1 feat: add server-config command (#346)
* feat: added server-config command

* chore: update openapi to latest
2021-12-23 09:32:31 -05:00
becbe8f7b8 fix: Use influx-debug-id header (#338)
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]
...
```
2021-12-03 17:54:47 +01:00
99791bafd3 feat: add flags for remotes, replications, and functions to auth create (#325) 2021-11-10 11:33:01 -05:00
714a73d9eb feat: all-access and operator token from CLI (#285)
* 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
2021-10-05 14:33:02 -04:00
f17f21410c fix: allow explicit empty request bodies (#281) 2021-09-24 11:35:29 -04:00
9076a65d1e feat: generate clients for replications APIs (#278) 2021-09-23 09:09:36 -04:00
dcf9f5bc9a feat: added functionality for remote create subcommand (#268)
* 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
2021-09-14 13:03:17 -07:00
d615694ee9 refactor: replace uses of ioutil with io and os (#223) 2021-08-04 14:45:22 -04:00
aaf99da0a9 feat: add stacks APIs to codegen (#163) 2021-06-30 14:47:35 -04:00
a058fe7e0b feat: port influx auth command (#152) 2021-06-28 14:06:29 -05:00
a1921e1e59 feat: port influx v1 auth command (#138) 2021-06-28 09:03:33 -05:00
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
f80b91730d feat: v1 dbrp commands (#136)
* 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
2021-06-22 10:07:15 -04:00
23e73e9146 feat: reimplement influx secret CLI command (#125)
* refactor: rename `getPassword` to `getSecret`
2021-06-21 13:33:51 -05:00
bd0b90df41 feat: port top-level export command from influxdb (#131) 2021-06-21 08:23:18 -04:00
51b1eadb12 feat: reimplement influx dashboards with new APIs (#122)
Fixes #108
2021-06-15 16:22:09 -05:00
abe521add0 feat: reimplement influx telegrafs with new APIs (#120)
* feat: reimplement `influx telegrafs` with new APIs

* chore: restructure structs for later modification

* refactor: bump openapi & regenerate clients

* refactor: better error output and descriptions

Co-authored-by: Dan Moran <dmoran@influxdata.com>
2021-06-15 14:55:04 -05:00
b1ba53bae2 refactor: move request-compression out of codegen, avoid some buffering (#118) 2021-06-11 16:01:34 -04:00
943e8fba31 feat: reimplement influx backup using new APIs (#116) 2021-06-11 09:50:39 -04:00
a1cf15d971 refactor: codegen backup and restore APIs (#107) 2021-06-02 16:19:36 -04:00
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