Commit Graph

89 Commits

Author SHA1 Message Date
e5707cd63c feat: allow setting membership type in influx org members add (#402)
* add owners endpoints to cli.yml

* run make openapi and mock

* add owner listing, adding and removing

* fix: update tests to remove getUser indirection
2022-06-28 16:06:58 -06:00
56a8276a4a chore: fix issues with Go 1.18 in CI (#416) 2022-06-27 15:11:12 -05:00
760f07ed9e feat: invokable scripts (#387)
* 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
2022-06-22 14:08:55 -06:00
a68106ee88 Replace token flags with = to prevent bad parsing of leading dash in token (#399) 2022-06-17 14:59:11 -06:00
c695e601a5 Add REPL autocompletion & go-prompt (#392)
* 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>
2022-06-14 15:18:27 -06:00
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
50de408a0a fix: add mutual exclusion for OrgId and OrgName params (#377)
Display an error when the OrgName and OrgId flags are both passed in. Only one or the other is allowed.

closes https://github.com/influxdata/influx-cli/issues/371
2022-05-13 18:50:22 -06:00
30e64c5cc9 feat: Add --extra-http-header flag (#372) 2022-04-13 19:22:18 +02:00
88ba3464cd feat: add max age to replications create and update (#367) 2022-03-18 17:21:12 -05:00
37ec38ac5a fix: rename bucket id parameters to be explicit (#369) 2022-03-11 15:12:34 -05:00
9ddf110ad6 fix: template apply uses better diff checking (#358)
* fix: template apply uses better diff checking

Previously, we did a DeepEqual of all the returned data about each changed entity,
but due to our template overrides that is not actually all the information
available for each entity. So we marked trivial things as 'conflicts' (e.g.
telegraf config ID's 'changing' from the empty string to the real, current value)
while not catching important conflicts like flux script changes in checks and tasks.

Changes to make things more straightforward:

 * Change the --force behaviour to be more similar to `apt install`, where even
in non-interactive mode `--force yes` is required to bypass the prompt to apply.

  * Before, there were two stages of diff checking - once to print diffs, and once
after the 'Yes/No' prompt. If any conflicts were detected in the second check,
the user got an inscrutable error message that did not highlight what the difference
was or how to force it to apply. `--force conflict` was required to avoid this error.
Instead, we now have simplified to `--force yes` to bypass the 'Yes/No' prompt, and
we never do a second stage of diff checking.

 * Because we do not currently properly account for more complicated diffs (e.g.
flux tasks), we now assume in the diff printing that every object has changes,
except for Labels, Buckets, Variables, and Label Mappings. This could be improved
in the future.

* fix: when statestatus is 'remove', mark as removed
2022-02-04 10:59:02 -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
327f239c6f feat: enable remotes and replication streams feature (#341) 2021-12-13 16:33:28 -06:00
f32a55f3bf feat: add drop-non-retryable-data to replications commands (#330)
* feat: add drop-non-retryable-data to replications commands

* refactor: use drop vs nodrop flags

* chore: use the built-in PtrBool
2021-11-17 14:16:58 -07:00
adc58b8441 chore: refactor influxid.ID, cleanup organization checking (#326) 2021-11-10 15:12:59 -06:00
99791bafd3 feat: add flags for remotes, replications, and functions to auth create (#325) 2021-11-10 11:33:01 -05:00
d861490100 fix: return "unknown command" instead of "no help topic" error when unknown (sub)command is passed (#316)
Co-authored-by: Sam Lai <samuel.lai@gmail.com>
2021-11-02 14:17:42 -04:00
a3af8ca833 revert: "feat: return error if API token required but not found (#310)" (#315)
This reverts commit 81de7e63dd2649cd043c7a66c6698a9f5609552c.
2021-11-01 12:57:30 -04:00
81de7e63dd feat: return error if API token required but not found (#310) 2021-10-22 10:06:12 -04:00
6fda4cceed feat: handle pagination in bucket list (#307) 2021-10-15 15:14:59 -07:00
c49001b412 feat: added functionality for replication update command (#299)
* feat: added functionality for replication update command

* refactor: changed replication update usage text for clarity

* fix: added closing bracket back in

* chore: ran make fmt
2021-10-08 14:08:44 -07:00
eb3ee7631f feat: added functionality for replication delete command (#298)
* feat: added functionality for replication delete command

* refactor: changed naming of remote-id flag to be consistent with other influx commands

* refactor: reduced lines of code and improved error message based on code review
2021-10-07 14:43:03 -07:00
c4a5a13c8e fix: restore when changing tokens works (#297)
* fix: restore when changing tokens works

* fix: remove cruft

* chore: changelog update

* chore: CHANGELOG word-smithing

Co-authored-by: Dan Moran <dmoran@influxdata.com>
2021-10-07 08:23:39 -04:00
64b1b03f8f feat: added functionality for replication list command (#296)
* feat: added functionality for replication list command

* chore: ran make fmt

* refactor: fixed comment for clarity

* refactor: chained statements together to simplify code
2021-10-06 17:42:16 -07:00
4e8671dcc5 feat: added functionality for replication create command (#289)
* feat: added functionality for replication create command

* refactor: changed replication create flag usage text and eliminated extra conditionals

* refactor: made changes to usage text and output table based on code review

* chore: fixed link to max queue size default value
2021-10-06 10:48:57 -07: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
ade82cc4fe fix: removed unused fmt import in remote cmd code (#287) 2021-10-04 11:04:19 -07:00
3c3d70cc60 feat: added functionality for remote update command (#282)
* feat: added functionality for remote update command

* refactor: removed extra get request for TLS flag and minor changes to help text

* chore: pulled newest changes to openapi and ran make fmt

* refactor: shortened conditional statement to one line
2021-10-04 10:28:07 -07:00
b7627a33c8 feat: added functionality for remote delete command (#283)
* feat: added functionality for remote delete command

* chore: pulled recent openapi changes and ran make fmt
2021-10-04 10:02:36 -07:00
65cca47ded feat: added functionality for remote list subcommand (#273)
* feat: add remote list subcommand functionality

* refactor: removed repeated code and improved help text
2021-09-22 09:18:06 -07:00
9a008c6b26 fix: fix type test for common flags (#275) 2021-09-21 13:26:21 -04:00
dfc6f00982 fix: less confusing overloads of 'token' in help (#272)
* chore: refactor GetOrg calls

* fix: less confusing overloads of 'token' in help

Closes #20619

* fix: clean up iscommon function definition
2021-09-20 13:57:45 -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
76e9ed68d8 feat: add shorthand for --bucket to influx delete (#259) 2021-09-08 15:26:34 -05:00
1ec4e1590b feat: stub out remote and replication commands and subcommands (#254)
* feat: stubbed out remote and replication commands and subcommands

* refactor: renamed remote.go file to match command

* refactor: combined replication metrics and replication list subcommands into list only

* refactor: removed extra appends to pass lint check
2021-09-03 13:17:18 -07:00
65da55e3f3 fix: --host value passed to setup is written to generated config (#255) 2021-09-02 17:42:37 -04:00
fa12328714 fix: detect and error out on incorrect positional args (#236) 2021-08-20 17:30:30 -04:00
285103df13 fix: make --http-debug flag visible in help text (#228) 2021-08-20 10:27:36 -04:00
d615694ee9 refactor: replace uses of ioutil with io and os (#223) 2021-08-04 14:45:22 -04:00
4ae87ced37 fix: enable default completion logic on top-level app (#221) 2021-07-30 16:04:41 -04:00
e2bd0a0a12 feat: Bind skip-verify flag to INFLUX_SKIP_VERIFY (#208)
* feat: Bind skip-verify flag to INFLUX_SKIP_VERIFY

This improves the user experience when using the influx tooling in
development environments.

* chore: Update CHANGELOG with skip-verify flag binding
2021-07-28 10:28:36 +10:00
7efea59d35 fix: fix env var used for configs path (#207) 2021-07-26 12:38:50 -04:00
127f829226 feat: allow passing password via flag in user password (#191) 2021-07-13 14:37:23 -04:00
c3feea5900 feat: update restore to support InfluxDB 2.0.x (#185) 2021-07-09 15:36:44 -04:00
95f190bf64 feat: update backup to support InfluxDB 2.0.x (#184) 2021-07-09 12:51:53 -04:00
3ca681b1dd feat: implement template command (#169) 2021-07-02 10:19:51 -04:00
40fc1845e9 feat: port stacks command from influxdb (#168) 2021-06-30 17:21:50 -04:00
a3f36a9821 feat: port apply command from influxdb (#160) 2021-06-30 14:47:23 -04:00
a058fe7e0b feat: port influx auth command (#152) 2021-06-28 14:06:29 -05:00