NAME

Net::FreeIPA::RPC provides RPC handling for Net::FreeIPA

Public methods

new_rpc

Create a new REST::Client instance, will be used throughout the remainder of the instance.

An authentication cookie will be retrieved (and will be used for the actual FreeIPA API calls).

Returns undef on failure, 1 on success.

Arguments
host: host to connect to
Options
username: the username to use for username/password based login
password: the password to use for username/password login
krbcc: kerberos credentials cache to use (set via KRB5CCNAME)
set_apiversion

Set the API version for this session.

If no version string is passed, the api_version attribute is set to undef (effecitively removing it), and this is typically interpreted by the server as using the latest version.

If the string API is passed as version, it will use verison from Net::FreeIPA::API::VERSION.

If the version is a version instance, the used version is stringified and any leading 'v' is removed.

Returns the version that was set version on success, undef otherwise. (If you want to get the current version, use the api_version attribute. This method will always set a version.)

post

Make a JSON API post. Return 1 on succes, undef on failure. Answer is stored in the answer attribute. (The answer is decoded in case of success).

rpc

Make a JSON API rpc. Return 1 on succes, undef on failure.

Arguments

command: API command (passed to post method)
args: arrayref with API command arguments (passed to post method)
opts: hashref with API command options (passed to post method)

Options

result_path

A path-like string, indicating which subtree of the decoided JSON response should be set as result attribute (default result/result).

Processed result is stored in the result attribute.

get_api_commands

Retrieve the API commands metadata.

The result attribute holds the commands hashref.

Returns commands hasref on success, undef on failure.

get_api_version

Retrieve the API version from the server.

The result attribute holds the version.

(To retrieve the latest version remove the api_version attribute first).

Does not set the version.

Returns the api_version on success, undef on failure.