AnyEvent-InfluxDB

 view release on metacpan or  search on metacpan

lib/AnyEvent/InfluxDB.pm  view on Meta::CPAN

            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 C<on_success> code reference is executed if request was successful,
otherwise executes the required C<on_error> code reference.

=head3 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 C<name> on database C<database> with retention policy
C<rp>.

The required C<on_success> code reference is executed if request was successful,
otherwise executes the required C<on_error> code reference.

=head2 Other

=head3 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 C<query> arguments.

The required C<on_response> code reference is executed with the raw response
data and headers as parameters.

=head1 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.

=head1 AUTHOR

Alex J. G. Burzyński <ajgb@cpan.org>

=head1 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.

=cut



( run in 0.912 second using v1.01-cache-2.11-cpan-140bd7fdf52 )