python - Internal Server Error while entering points using JSON in InfluxDB -
i trying enter points using json in influxdb version 0.9. run localhost:8083 on browser. enabling me create db, when try enter points using json, shoeing 'internal server error'. tried same using python api influx db.
from influxdb import influxdbclient json_body = [ { "name": "cpu_load_short", "tags": { "host": "server01", "region": "us-west" }, "timestamp": "2009-11-10t23:00:00z", "fields": { "value":0.64 } } ] client = influxdbclient('localhost', 8086, 'root', 'mydb') client.create_database('mydb') client.write_points(json_body)
for clients.write_points(json_body)
, following error shown:
traceback (most recent call last): file "<pyshell#17>", line 1, in <module> client.write_points(json_body) file "c:\python27\lib\site-packages\influxdb\client.py", line 364, in write_points tags=tags) file "c:\python27\lib\site-packages\influxdb\client.py", line 406, in _write_points expected_response_code=204 file "c:\python27\lib\site-packages\influxdb\client.py", line 277, in write expected_response_code=expected_response_code file "c:\python27\lib\site-packages\influxdb\client.py", line 257, in request raise influxdbclienterror(response.content, response.status_code) influxdbclienterror: 500: {"error":"database required"}
you must specify database , retention policy points should written, on docs page erik referenced:
for example:
{ "database": "mydb", "retentionpolicy": "default", "points": [ { "name": "cpu_load_short", "tags": { "host": "server01", "region": "us-west" }, "time": "2009-11-10t23:00:00z", "fields": { "value": 0.64 } } ] }
if using else's python api it's compatible influxdb 0.9? many clients compatible 0.8.x , there significant breaking changes api between 2 versions.
Comments
Post a Comment