Comments (4)
This is a similar but not directly related issue, with the API. influxdata/influxdb#20048
from influx-cli.
@danatinflux
Could really use this as a parameter for the netreo migration(https://github.com/influxdata/InfluxDB-Cloud-2-Migration/issues/19) They have 36 customers and 5 buckets for each. I use the customer id in the bucket name. For token and dbrp processing on the scripts, I do a bucket list, grep out the buckets and then process them. Now I get clipped at 20. You should be able to specify something like --size 500
from influx-cli.
A --size
or --limit
flag could be part of the solution, but not enough to fully address this; the DB backends (both OSS and Cloud) enforce a max-size on list requests to protect themselves from abuse.
To fully address this, the CLI will need to make iterative requests to the buckets API, setting after=<ID-of-last-bucket-from-previous-batch>
and limit=<some-page-size>
. The iteration would stop once a request returned an empty list. We could expose flags for users to control the process:
--limit
: Limit on total number of buckets to fetch & print--page-size
: Value to set forlimit
in each HTTP request--offset
: Number of buckets to skip on initial request--after
: ID of bucket to set asafter
in the initial request
We'd probably want this for all of our list
commands, but we see it requested most frequently for buckets
so it makes sense to implement it there first as a one-off.
from influx-cli.
@btasker gave me a work around in python:
#!/usr/bin/env python3
import json
import requests
import sys
# https://docs.influxdata.com/influxdb/v2.0/api/#tag/Buckets
INFLUX="https://us-west-2-1.aws.cloud2.influxdata.com"
ORG="xxxx"
TOKEN="xxx"
def reqAPI(path):
headers = {
"Authorization": f"Token {TOKEN}"
}
r = requests.get(f'{INFLUX}{path}', headers=headers)
return r.json()
def printBuckets(r):
for bucket in r['buckets']:
print(f"{bucket['id']}\t{bucket['name']}")
r = reqAPI('/api/v2/buckets?org={ORG}')
if r:
while "links" in r and "next" in r['links']:
printBuckets(r)
r = reqAPI(r['links']['next'])
printBuckets(r)
from influx-cli.
Related Issues (20)
- Client tooltips hiding results
- not implemented: CREATE RETENTION POLICY
- Please bump golang.org/x/sys dependency to make the port build on riscv64 HOT 2
- Contributing to influx-cli HOT 1
- `influx v1 auth ls` fails with `unable to decode response content type "text/html"` HOT 8
- CLI version 2.7.1 broken for Windows HOT 3
- influx write incorrectly parses input data when --skipRowOnError is enabled HOT 2
- Required --user flag problems: prevents token creation on cloud2 offering using cli
- Inconsistency in required parameters for bucket commands
- Unvalidated duration input leads to signed integer overflow and confusing error message
- release version not reported
- CLI v2.7.1 for Windows is not an executable HOT 4
- Error: flag provided but not defined: -read-dbrps HOT 1
- influxdb-cli does not follow xdg base directory specification
- [bug] user option ignored when listing tokens with `influx auth list`
- `influx write` with seperator does not work as without
- Add V3 Querying to CLI
- Is the download link for InfluxDB CLI Windows version 2.7.1 correct?
- influx client CLI / auth create read-telegrafs all or nothing? (create token for specific telegraf config)
- shard duration 0 (infinite) not applying, `Error: retention policy duration must be greater than the shard duration` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from influx-cli.