influxdata / influx-cli

CLI for managing resources in InfluxDB v2
MIT License
61 stars 22 forks source link

Error: flag provided but not defined: -read-dbrps #513

Open jonathan-dev opened 1 year ago

jonathan-dev commented 1 year ago

I tried to create an read only API key as described here in the docs

I am getting the attached output. I am guessing that either the docs or the implementation are wrong about the s at the end of --read-dbrps. So it should be an easy fix :)

I have no name!@93ac3f1f09c0:/$ influx auth create \
  --read-buckets \
  --read-checks \
  --read-dashboards \
  --read-dbrps \
  --read-notificationEndpoints \
  --read-notificationRules \
  --read-orgs \
  --read-remotes \
  --read-replications \
  --read-tasks \
  --read-telegrafs \
  --read-users
Incorrect Usage: flag provided but not defined: -read-dbrps

NAME:
   influx auth create - Create authorization

USAGE:
   influx auth create [command options] [arguments...]

COMMON OPTIONS:
   --host value                     HTTP address of InfluxDB [$INFLUX_HOST]
   --skip-verify                    Skip TLS certificate chain and host name verification [$INFLUX_SKIP_VERIFY]
   --configs-path value             Path to the influx CLI configurations [$INFLUX_CONFIGS_PATH]
   --active-config value, -c value  Config name to use for command [$INFLUX_ACTIVE_CONFIG]
   --http-debug
   --json                           Output data as JSON [$INFLUX_OUTPUT_JSON]
   --hide-headers                   Hide the table headers in output data [$INFLUX_HIDE_HEADERS]
   --token value, -t value          Token to authenticate request [$INFLUX_TOKEN]

OPTIONS:
   --org-id value                 The ID of the organization [$INFLUX_ORG_ID]
   --org value, -o value          The name of the organization [$INFLUX_ORG]
   --user value, -u value         The user name
   --description value, -d value  Token description
   --write-bucket value           The bucket id
   --read-bucket value            The bucket id
   --operator                     Grants all permissions in all organizations
   --all-access                   Grants all permissions in a single organization
   --read-authorizations          Grants the permission to read authorizations
   --write-authorizations         Grants the permission to create or update authorizations
   --read-buckets                 Grants the permission to perform read actions against organization buckets
   --write-buckets                Grants the permission to perform mutative actions against organization buckets
   --read-dashboards              Grants the permission to read dashboards
   --write-dashboards             Grants the permission to create or update dashboards
   --read-orgs                    Grants the permission to read organizations
   --write-orgs                   Grants the permission to create organizations
   --read-tasks                   Grants the permission to read tasks
   --write-tasks                  Grants the permission to create or update tasks
   --read-telegrafs               Grants the permission to read telegraf configs
   --write-telegrafs              Grants the permission to create telegraf configs
   --read-users                   Grants the permission to read users
   --write-users                  Grants the permission to create or update users
   --read-variables               Grants the permission to read variables
   --write-variables              Grants the permission to create or update variables
   --read-secrets                 Grants the permission to read secrets
   --write-secrets                Grants the permission to create or update secrets
   --read-labels                  Grants the permission to read labels
   --write-labels                 Grants the permission to create or update labels
   --read-views                   Grants the permission to read views
   --write-views                  Grants the permission to create or update views
   --read-documents               Grants the permission to read documents
   --write-documents              Grants the permission to create or update documents
   --read-notificationRules       Grants the permission to read notificationRules
   --write-notificationRules      Grants the permission to create or update notificationRules
   --read-notificationEndpoints   Grants the permission to read notificationEndpoints
   --write-notificationEndpoints  Grants the permission to create or update notificationEndpoints
   --read-checks                  Grants the permission to read checks
   --write-checks                 Grants the permission to create or update checks
   --read-dbrp                    Grants the permission to read dbrp
   --write-dbrp                   Grants the permission to create or update dbrp
   --read-annotations             Grants the permission to read annotations
   --write-annotations            Grants the permission to create or update annotations
   --read-sources                 Grants the permission to read sources (OSS only)
   --write-sources                Grants the permission to create or update sources (OSS only)
   --read-scrapers                Grants the permission to read scrapers (OSS only)
   --write-scrapers               Grants the permission to create or update scrapers (OSS only)
   --read-notebooks               Grants the permission to read notebooks (OSS only)
   --write-notebooks              Grants the permission to create or update notebooks (OSS only)
   --read-remotes                 Grants the permission to read remotes (OSS only)
   --write-remotes                Grants the permission to create or update remotes (OSS only)
   --read-replications            Grants the permission to read replications (OSS only)
   --write-replications           Grants the permission to create or update replications (OSS only)
   --read-flows                   Grants the permission to read flows (Cloud only)
   --write-flows                  Grants the permission to create or update flows (Cloud only)
   --read-subscriptions           Grants the permission to read subscriptions (Cloud only)
   --write-subscriptions          Grants the permission to create or update subscriptions (Cloud only)

Error: flag provided but not defined: -read-dbrps
I have no name!@93ac3f1f09c0:/$ influx version
Influx CLI v2.6.1 (git: 61c5b4d) build_date: 2023-03-30T09:29:16Z
jeffreyssmith2nd commented 1 year ago

Hey @jonathan-dev, thanks for the report. The implementation is wrong here since all the other commands are plural. That being said, I'd rather not break compatibility with any scripts/etc people might have, so I think a docs update is ultimately the correct fix.

If you're interested in submitting a PR, this would be the file to change. If not, I'll update it whenever I do my next set of docs updates.