Using influxdb-client-python against v1.8.10 how do I do the equivalent to `client.get_list_database()`?
还没有人认领这个 Issue。
评估
调研方向
从 BucketsApi.find_buckets() 调用以及复现中描述的 InfluxDB 1.8.10 行为开始。确定客户端是否提供了等效的数据库列表入口;当能够在 InfluxDB 1.8.10 上列出预期的数据库且不会出现报告的 404 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Specifications
- Client Version: 1.35.0
- InfluxDB Version: 1.8.10
- Platform: Linux
The subject sums up my whole question, really. Using influxdb-client-python v1.35.0 against InfluxDB v1.8.10 how do I do the equivalent to client.get_list_database() from the older influxdb-python v5.3.1?
The docs say Use this client library with InfluxDB 2.x and InfluxDB 1.8+ so I hoped there was an equivalent.
I tried BucketsApi.find_buckets() but that seems to only use the v2 API and therefore throws an exception following the 404 status.
Code sample to reproduce problem
from influxdb_client import InfluxDBClient as InfluxDBClient2, BucketsApi
with InfluxDBClient2(url='http://localhost:8086', token=':', org='-') as client:
bucket_client = BucketsApi(client)
buckets = bucket_client.find_buckets()
for bucket in buckets:
print(bucket)
Expected behavior
To get the databases listed.
Actual behavior
Traceback (most recent call last):
File "mdsh.py", line 5, in <module>
buckets = bucket_client.find_buckets()
File "/usr/local/lib/python3.7/site-packages/influxdb_client/client/bucket_api.py", line 119, in find_buckets
return self._buckets_service.get_buckets(**kwargs)
File "/usr/local/lib/python3.7/site-packages/influxdb_client/service/buckets_service.py", line 548, in get_buckets
(data) = self.get_buckets_with_http_info(**kwargs) # noqa: E501
File "/usr/local/lib/python3.7/site-packages/influxdb_client/service/buckets_service.py", line 590, in get_buckets_with_http_info
urlopen_kw=kwargs.get('urlopen_kw', None))
File "/usr/local/lib/python3.7/site-packages/influxdb_client/_sync/api_client.py", line 348, in call_api
_preload_content, _request_timeout, urlopen_kw)
File "/usr/local/lib/python3.7/site-packages/influxdb_client/_sync/api_client.py", line 177, in __call_api
_request_timeout=_request_timeout, **urlopen_kw)
File "/usr/local/lib/python3.7/site-packages/influxdb_client/_sync/api_client.py", line 370, in request
**urlopen_kw)
File "/usr/local/lib/python3.7/site-packages/influxdb_client/_sync/rest.py", line 273, in GET
**urlopen_kw)
File "/usr/local/lib/python3.7/site-packages/influxdb_client/_sync/rest.py", line 261, in request
raise ApiException(http_resp=r)
influxdb_client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': '1.8.10', 'Date': 'Sun, 01 Jan 2023 16:04:59 GMT', 'Content-Length': '19'})
HTTP response body: 404 page not found
Additional info
No response
- 主要语言
- Python
- 星标
- 792
- 派生
- 186
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
influxdata/influxdb-client-python 的其他 Issue
-
Pandas outputs warning when calling dataframe.append in flux_csv_parser._prepare_data_frame可能已有人在做 @dave-cz 于 409 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
influxdata/influxdb-client-python#613 · 7 条评论 ·
-
ApiClient.__del__ triggers shutdown-time exception in influxdb-client 1.50.0可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 3/5 1-2 天 新手友好度 65/100
influxdata/influxdb-client-python#719 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 45/100
influxdata/influxdb-client-python#694 · 6 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 30/100
influxdata/influxdb-client-python#693 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
查看 influxdata/influxdb-client-python 的全部 Issue
相似的 Issue
-
SSM GetParameter throttling during concurrent workflow launches可能已有人在做 @alexiswl 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
-
[Bug] Dev image build fails: `npm install` in the root Dockerfile runs out of memory (exit 134)可能已有人在做 @andest01 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 79/100
pesu-dev/discord_bot#97 ·
-
难度 1/5 1-3 小时 新手友好度 88/100
gradio-app/gradio#13964 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 93/100
BSData/horus-heresy-3rd-edition#3232 · 1 条评论 ·
维护者通常 1 天内回复