influxdata / influxdata/influxdb-client-python

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

Abierto
#547 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug
Lenguaje dominante
Python
Estrellas
793
Forks
186
Merge medio
3 h 2 min
PR fusionados (30 d)
1

Descripción

### 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

```python
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

```console
Traceback (most recent call last):
File "mdsh.py", line 5, in
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_

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Start with the BucketsApi.find_buckets() call and the InfluxDB 1.8.10 behavior described in the reproduction. Determine whether the client exposes an equivalent database-listing entry point; done means the expected databases can be listed against InfluxDB 1.8.10 without the reported 404.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api, databases
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.