stdweird / p5-net-freeipa

Perl5 NET::FreeIPA (FreeIPA 4.2+ JSON API)
Apache License 2.0
4 stars 3 forks source link

p5-net-freeipa

Perl5 NET::FreeIPA (FreeIPA 4.2+ JSON API)

Example usage

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";
}

IPA API

All API commands are retrieve using gen_api.pl script from the JSON API.

Tests

Run tests with prove -Ilib -r t (or prove -Ilib -t/name_of_test.t for single unittest)

References

License

Apache 2.0 (license is added to the release via Dist-Zilla).