Perl5 NET::FreeIPA (FreeIPA 4.2+ JSON API)
ipa user-find
equivalent using API call and basic result postprocessing.
The connection in this example will (try to) use kerberos authentication.
(See Net::FreeIPA::RPC::new_client
for authentication details.)
use Net::FreeIPA;
my $fi = Net::FreeIPA->new("host.example.com");
die("Failed to initialise the rest client") if ! $fi->{rc};
if ($fi->api_user_find("")) {
print "Found ", scalar @{$fi->{result}}, " users\n";
} else {
print "Something went wrong\n";
}
All API commands are retrieve using gen_api.pl
script from the JSON API.
Run tests with prove -Ilib -r t
(or prove -Ilib -t/name_of_test.t
for single unittest)
Apache 2.0 (license is added to the release via Dist-Zilla
).