NAME

cPanel::APIClient::Service::cpanel

SYNOPSIS

If your transport uses blocking I/O:

my $resp = $client->call_uapi('Email', 'list_pops', \%args);

my $pops_ar = $resp->get_data();

If your transport uses non-blocking I/O:

my $call = $client->call_uapi('Email', 'list_pops', \%args);

$call->promise()->then( sub {
    my ($resp) = @_;

    my $pops_ar = $resp->get_data();
} );

Some non-blocking transports support canceling in-progress requests, thus:

$client->cancel($call, ..);

See your transport’s documentation for more details.

METHODS

$whatsit = OBJ->call_uapi( $MODULE, $FUNC, \%ARGS, \%METAARGS )

Calls a single UAPI call. %ARGS values should be simple scalars or arrays thereof.

The return value depends on OBJ’s configured transport:

  • If the transport uses blocking I/O, then the return will be a cPanel::APIClient::Response::UAPI instance.

  • A transport that uses non-blocking I/O can determine its own mechanism for returning the API call response. Some might return a promise (e.g., Promise::XS), others a Future, and still others might return nothing and instead take a callback as a parameter. See the individual transport’s documentation for details. Eventually, though, a cPanel::APIClient::Response::UAPI instance should somehow be given to indicate the API call response.

LICENSE

Copyright 2020 cPanel, L. L. C. All rights reserved. http://cpanel.net

This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.