API-MikroTik
view release on metacpan or search on metacpan
lib/API/MikroTik.pm view on Meta::CPAN
my $host = $api->host;
$api = $api->host('border-gw.local');
Host name or IP address to connect to. Defaults to C<192.168.88.1>.
=head2 ioloop
my $loop = $api->ioloop;
$api = $api->loop(Mojo::IOLoop->new());
Event loop object to use for blocking operations, defaults to L<Mojo::IOLoop>
object.
=head2 password
my $pass = $api->password;
$api = $api->password('secret');
Password for authentication. Empty string by default.
=head2 port
my $port = $api->port;
$api = $api->port(8000);
API service port for connection. Defaults to C<8729> and C<8728> for TLS and
clear text connections respectively.
=head2 timeout
lib/API/MikroTik.pm view on Meta::CPAN
$api = $api->timeout(15);
Timeout in seconds for sending request and receiving response before command
will be canceled. Default is C<10> seconds.
=head2 tls
my $tls = $api->tls;
$api = $api->tls(1);
Use TLS for connection. Enabled by default.
=head2 user
my $user = $api->user;
$api = $api->user('admin');
User name for authentication purposes. Defaults to C<admin>.
=head1 METHODS
lib/API/MikroTik/Query.pm view on Meta::CPAN
# disabled = 'true' OR running = 'false'
$query = [disabled => 'true', running => 'false'];
Simple attribute value comparison.
=head2 List of values
# type = 'ether' OR type = 'wlan'
my $query = {type => ['ether', 'wlan']};
You can use arrayrefs for a list of possible values for an attribute. By default,
it will be expanded into an C<OR> statement.
=head2 Comparison operators
# comment isn't empty (more than empty string)
my $query = {comment => {'>', ''}};
# mtu > 1000 AND mtu < 1500
$query = {mtu => {'<' => 1500, '>' => 1000}};
( run in 0.491 second using v1.01-cache-2.11-cpan-0a6323c29d9 )