API::Plesk::Response - Class for processing server answers with errors handling.
my $res = API::Plesk::Response->new( operator => 'customer', operation => 'get', response => 'xml answer from plesk api', ); $res->is_success; $res->is_connection_error; # get errors $res->error_code; $res->error_codes->[0]; $res->error_text; $res->error_texts->[0]; $res->error; $res->errors->[0]; # get data sections $res->data->[0]; # get result sections $res->results->[0]; # get id and guid $res->id; $res->guid;
This class is intended for convenient processing results of Plesk API responses. Every operation of API::Plesk::Component return object of this class. And it get you easy way to manipulate with response from Plesk API.
Create response object.
Returns true if all results have no errors.
Returns true if connection error happened.
$response->data; $response->data->[0];
$response->results; $response->results->[0];
$response->error_code;
$response->error_codes->[0];
$response->error_text;
$response->error_texts->[0];
$response->error;
$response->errors->[0];
Ivan Sokolov <lt>ivsokolov@cpan.org<gt>
To install API::Plesk, copy and paste the appropriate command in to your terminal.
cpanm
cpanm API::Plesk
CPAN shell
perl -MCPAN -e shell install API::Plesk
For more information on module installation, please visit the detailed CPAN module installation guide.