jolie-influxdb
This is the Jolie language influx connector
Installation
jpm add @jolie/influxdb
Usage
from @jolie.influxdb.jolie-influxdb import InfluxDBConnector
Operations
interface InfluxDBInterface{
RequestResponse:
connect (ConnectRequest)(ConnectResponse),
write(WriteRequest)(WriteResponse),
query(QueryRequest)(QueryResponse)
}
connect
This operation allows your service to connect to the to your instance of InfluxDB
type ConnectRequest:void{
token:string
org:string
url:string
bucket:string
}
example
connect@influxdb({
token = "I0kn4_sybERDjvNrG44LWsDax6ozSNsDvcVewqyIn3WlEJ1c6K37pUOGK7K6d7EJHhZh8iQEcpBFWJzz5O1fqg=="
org = "org"
url = "http://localhost:8086"
bucket = "test"
})()
write
This operation allows the user to write on InfluxDB
type WriteRequest:void {
measurement:string
values*:void{
time?:long
fields:undefined
}
}
example
write@influxdb({
measurement = "example"
values.fields.sensor1= 100
values.fields.sensor2= 2.0
})()
the time can be express as long epoc value if not present like in the example the connector with assign the current in time
query
type QueryRequest:void{
.query:string
}
the query uses influxDB query format example
query@influxdb({
query = "from(bucket: \"test\") |> range(start: -1h) |> filter(fn: (r) => r[\"_measurement\"] == \"example\")"
})(responseQuery)
the response type is
type QueryResponse:void{
tables*:void{
values*:void{
time?:long
field:undefined
}
}
}