AnyEvent-InfluxDB
view release on metacpan or search on metacpan
for my $s ( @{ $subscriptions->{$database} } ) {
print " Name: $s->{name}\n";
print " Retention Policy: $s->{retention_policy}\n";
print " Mode: $s->{mode}\n";
print " Destinations:\n";
print " * $_\n" for @{ $s->{destinations} || [] };
}
}
Returns a hash reference with database name as keys and their shards as
values.
The required "on_success" code reference is executed if request was
successful, otherwise executes the required "on_error" code reference.
drop_subscription
$cv = AE::cv;
$db->drop_subscription(
# raw query
q => 'DROP SUBSCRIPTION "alldata" ON "mydb"."default"',
# or query created from arguments
name => q{"alldata"},
database => q{"mydb"},
rp => q{"default"},
# callbacks
on_success => $cv,
on_error => sub {
$cv->croak("Failed to drop subscription: @_");
}
);
$cv->recv;
Drops subscription "name" on database "database" with retention policy
"rp".
The required "on_success" code reference is executed if request was
successful, otherwise executes the required "on_error" code reference.
Other
query
$cv = AE::cv;
$db->query(
method => 'GET',
query => {
db => 'mydb',
q => 'SELECT * FROM cpu_load',
},
on_response => $cv,
);
my ($response_data, $response_headers) = $cv->recv;
Executes an arbitrary query using provided in "query" arguments.
The required "on_response" code reference is executed with the raw
response data and headers as parameters.
CAVEATS
Following the optimistic nature of InfluxDB this modules does not
validate any arguments. Also quoting and escaping special characters is
to be done by the user of this library.
AUTHOR
Alex J. G. BurzyÅski <ajgb@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Alex J. G. BurzyÅski
<ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
( run in 0.651 second using v1.01-cache-2.11-cpan-39bf76dae61 )