Net::FreeIPA is a perl FreeIPA JSON API client class
'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.
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"; }
Handle the actual initializtion of new. Return 1 on success, undef otherwise.
An instance that can be used for logging (with error/warn/info/debug methods) (e.g. LOG::Log4perl).
When true, log the JSON POST and JSON reply data with debug.
All other arguments and options are passed to Net::FreeIPA::RPC::new_client during initialisation. (Check the presence of an rc attribute for succesfull initialisation of the underlying rest client. An error is logged in case of failure.)
rc
To install Net::FreeIPA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::FreeIPA
CPAN shell
perl -MCPAN -e shell install Net::FreeIPA
For more information on module installation, please visit the detailed CPAN module installation guide.