$k. InfluxClient

new InfluxClient(database, urlopt)

Creates a new InfluxDB cient

Parameters:
NameTypeAttributesDescription
databasestring

Name of the database

urlstring<optional>

URL of the InfluxDB server. Default: http://localhost:8086

Since
  • 5.2.2

Methods

authenticate(username, password)

Set the username and password

Parameters:
NameTypeDescription
usernamestring
passwordstring
Since
  • 5.6.1

authenticateFromEncrypedAccount(encryptedAccount)

Set the username and password from a volume encrypted authenication string

Parameters:
NameTypeDescription
encryptedAccountstring

Encrypted account (Base64 encoded string generated in the Admin-Tool)

Since
  • 5.2.2

query(query)

Executes an InfluxDB query

Parameters:
NameTypeDescription
querystring

Influx query

Since
  • 5.2.2

setRetentionPolicy(policy)

Set the retentionPolicy

Parameters:
NameTypeDescription
policystring

The name of a retention policy

Since
  • 5.2.2

setWriteDelay(delay)

Set the delay before actually writing datapoints to InfluxDB. All datapoints written during this timespan are combined to a single write request.

Parameters:
NameTypeDescription
delaynumber

Number of seconds

Since
  • 5.2.2

writePoints(datapoints)

Write datapoints to InfluxDB

Parameters:
NameTypeDescription
datapointsArray.<object>

List of datapoints objects:

 [ {measurement: "m", fields: { }, tags: { } ]

Since
  • 5.2.2