0.0.9 • Published 3 years ago

@jolie/influxdb v0.0.9

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 years ago

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
      }
  }
}
0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago