InfluxDB-HTTP
view release on metacpan or search on metacpan
InfluxDB::HTTP - The Perl way to interact with InfluxDB!
=head1 VERSION
Version 0.04
=head1 SYNOPSIS
InfluxDB::HTTP allows you to interact with the InfluxDB HTTP API. The module essentially provides
one method per InfluxDB HTTP API endpoint, that is C<ping>, C<write> and C<query>.
use InfluxDB::HTTP;
my $influx = InfluxDB::HTTP->new();
my $ping_result = $influx->ping();
print "$ping_result\n";
my $query = $influx->query(
[ 'SELECT Lookups FROM _internal.monitor.runtime WHERE time > '.(time - 60)*1000000000, 'SHOW DATABASES'],
lib/InfluxDB/HTTP.pm view on Meta::CPAN
}
result {
raw { return $response; }
<STR> { return "Write successful"; }
<BOOL> { return 1; }
}
}
sub _get_influxdb_http_api_uri {
my ($self, $endpoint) = @_;
die "Missing argument 'endpoint'" if !$endpoint;
my $uri = URI->new();
$uri->scheme('http');
$uri->host($self->{host});
$uri->port($self->{port});
$uri->path($endpoint);
return $uri;
}
1;
__END__
=head1 NAME
InfluxDB::HTTP - The Perl way to interact with InfluxDB!
=head1 VERSION
Version 0.04
=head1 SYNOPSIS
InfluxDB::HTTP allows you to interact with the InfluxDB HTTP API. The module essentially provides
one method per InfluxDB HTTP API endpoint, that is C<ping>, C<write> and C<query>.
use InfluxDB::HTTP;
my $influx = InfluxDB::HTTP->new();
my $ping_result = $influx->ping();
print "$ping_result\n";
my $query = $influx->query(
[ 'SELECT Lookups FROM _internal.monitor.runtime WHERE time > '.(time - 60)*1000000000, 'SHOW DATABASES'],
( run in 0.645 second using v1.01-cache-2.11-cpan-d7f47b0818f )