how to get all databases use http api from influxdb in v0.8?
but I can use this query in v0.9:
curl -G http://localhost:8086/query --data-urlencode "u=todd" \
--data-urlencode "p=influxdb4ever" --data-urlencode "q=SHOW DATABASES"
I can't get any info on influxdb.com
thx
Run a SHOW DATABASES query The query returns database names in a tabular format. This InfluxDB instance has two databases: NOAA_water_database and _internal .
To perform a query send a GET request to the /query endpoint, set the URL parameter db as the target database, and set the URL parameter q as your query. You may also use a POST request by sending the same parameters either as URL parameters or as part of the body with application/x-www-form-urlencoded .
A fresh install of InfluxDB has no databases (apart from the system _internal ), so creating one is our first task. You can create a database with the CREATE DATABASE <db-name> InfluxQL statement, where <db-name> is the name of the database you wish to create.
I can get the database list using this statement: curl -G "http://somehost:8086/query?pretty=true" --data-urlencode "q=show databases"
My InfluxDB version is 1.2.2
Using influxdb lib in python
install: $pip3 install influxdb
from influxdb import InfluxDBClient
client = InfluxDBClient(host='', port='', username='', password='')
#return database in a list of dict
dbs = client.get_list_database()
#for better format
list = []
for db in dbs:
list.append(db.get('name'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With