InfluxDB API
InfluxDB v2 API
Check the InfluxDB v2 API reference for details about API endpoints.
InfluxDB API can be used to retrieve and update data via Data Manipulation Panel.
Thanks to the community member fercasjr for the provided examples.
Query data
Update according to your environment:
- IP address or name of the server (
localhost
in the example) - InfluxDB org
- Token
- Query is represented by any valid query you already have to test.
docs/volkovlabs-form-panel/js/influx-query.js
loading...
To write data to InfluxDB you can use the experimental.to()
, wide.to(), or
to()` functions in the Flux language or use the API.
Write data
The generated payload of the HTTP POST request includes the following:
measurement_name
: name of the measurement that is written into InfluxDB (in this example is hardcoded).tag1
: name of the tag that is written into InfluxDB (also hardcoded).field1
andfield2
: names of fields that are written into InfluxDB (also hardcoded).body.element_id1
andbody.element_id2
: field values that are written into InfluxDB.Date.now()
: code snippet for generating the timestamp of the measurement (is in ms).
The body's elements are coming from the plugin's form, that's why they are placed inside the ${}
.
body.element_id1
is getting theelement_id1
value from thebody
object.
docs/volkovlabs-form-panel/js/influx-write.js
loading...