I need to develop a web interface that queries our organizations/buckets in InfluxDB to provide first level information to our users. I’m developing this information in PHP 8.2 using the influxdb-client-php client.
First, I want to list my organizations and buckets in selectBoxes to create filters. No problem getting my organization list, but I can’t list the buckets. All I get in response are “system” buckets (_monitoring and _tasks).
Let’s take an example. I have an organization named ‘test’ (I know, it’s very original) which contains the buckets ‘bourges_ovins’, bourges_‘caprins’ and ‘test’ (yes, again).
I don’t understand why I can’t get my ‘user’ buckets.
I’d like to point out in advance that the token I’m using has full --read-XXX rights on all organizations.
thank you for your answer @suyash . it’s the first thing I tested
then, as I had 9 times (9 organizations) _tasks and _monitoring buckets, I filtered by organization thinking I’d get my user buckets back … … unfortunately, not !
The getBuckets() arguments are positional, so "test" may be landing in a different filter than you intend. Check the installed client’s BucketsService::getBuckets() signature in vendor/ and pass the organization’s ID in the orgID parameter (or use named arguments if that version supports them). The API’s org filter is the organization name; it isn’t the same as the bucket name filter.
If your installed signature is getBuckets($name, $orgID, $org, $limit, $after, $offset, $descending), then “test” is being passed as $after, not as the organization filter. Try getBuckets(null, null, “test”) for the org name, or use named arguments if supported: getBuckets(org: “test”). If using orgID, pass the actual organization ID rather than the name.