NAME
InfluxDB::Client - query and manage InfluxDB
VERSION
version 0.1
SYNOPSIS
use InfluxDB::Client;
METHODS
new(%args)
creates a new InfluxDB::Client instance.
The arguments are:
urlcomplete URL to the influx host. Can be an array reference or a string. default:http://localhost:8086ua_optsa hash reference, given to LWP::UserAgent during constructionusernameusername for authenticationpasswordpassword for authentication
If url is an array reference, we will use the URL's round robin. If a request fails the next URL is tried The username and password are optional. None or both must be defined.
ping()
queries the ping endpoint of the InfluxDB server and returns a HTTP::Response object on success, undef otherwise
returns: InfluxDB::Client::Response
query($query)
sends the $query as GET request to the /query endpoint of the remote database
returns: InfluxDB::Client::Response
query(%args)
The arguments are:
querythe query string to send to the /query endpointmethodeitherPOSTorGET, defaults toGETdatabasethe database to use for database dependent queriesepochdefines the precision of the returned timestamp values, must be one ofns,u,ms,s,m,h. Defaults tons
query is the only required argument. If this is the only argument you need, consider using query($query) instead.
returns: InfluxDB::Client::Response
write(%args)
The arguments are:
databasethe database, the data should be written toconsistencythe write consistency for InfluxEnterprise cluster, defaults tooneprecisiondefines the precision of the given data, must be one ofns,u,ms,s,m,h. Defaults tonsdataan array reference of strings and/or InfluxDB::Client::DataSet objectsrpsets the target retention policy for the write, defaults toundef
If precision is not given and the first element of data is a InfluxDB::Client::DataSet, the precision is taken from that object.
All elements of data must have the same precision. If you need to write data with different precision, you must call this method once for each precision.
You can mix strings and InfluxDB::Client::DataSet objects in the data array reference.
returns: InfluxDB::Client::Response
show_databases()
wrapper around query('SHOW DATABASES')
returns: A InfluxDB::Client::Response object.
the ->content of the response contains an array of database names
AUTHOR
Thomas Berger <thomas.berger@1und1.de>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2017 by 1&1 Telecommunication SE.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004