Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Using influxdb-client-python against v1.8.10 how do I do the equivalent to `client.get_list_database()`?

オープン
#547 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, databases

調査の方向性

BucketsApi.find_buckets() の呼び出しと、再現手順で説明されている InfluxDB 1.8.10 の動作から始めます。クライアントがデータベース一覧取得に相当するエントリーポイントを公開しているかを確認します。InfluxDB 1.8.10 に対して、報告された 404 なしで期待されるデータベースを一覧表示できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

influxdata/influxdb-client-python のほかの issue

influxdata/influxdb-client-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。