API-PleskExpand
view release on metacpan or search on metacpan
lib/API/PleskExpand.pm view on Meta::CPAN
#
# DESCRIPTION:
# Plesk Expand communicate interface. Main class.
# AUTHORS:
# Pavel Odintsov (nrg) <pavel.odintsov@gmail.com>
#
#========================================================================
package API::PleskExpand;
use strict;
use warnings;
use lib qw(../..);
use API::Plesk;
use base 'API::Plesk';
use Data::Dumper;
use Carp;
our $VERSION = '1.07';
=head1 NAME
API::PleskExpand - OOP interface to the Plesk Expand XML API (http://www.parallels.com/en/products/plesk/expand/).
=head1 SYNOPSIS
use API::PleskExpand;
use API::Plesk::Response;
my $expand_client = API::PleskExpand->new(%params);
my $res = $expand_client->Func_Module->operation_type(%params);
if ($res->is_success) {
$res->get_data; # return arr ref of answer blocks
}
=head1 DESCRIPTION
At present the module provides interaction with Plesk Expand 2.2.4 (API 2.2.4.1). Complete support of operations with Accounts, partial support of work with domains. Support of addition of domains to user Accounts.
API::PleskExpand module gives the convenient interface for addition of new functions. Extensions represent modules in a folder Plesk with definitions of demanded functions. Each demanded operation is described by two functions: op and op_response_par...
For example, here the set of subs in the Accounts module is those.
create / create_response_parse
modify / modify_response_parse
delete / delete_response_parse
get / get_response_parse
=head1 EXPORT
Nothing.
=head1 METHODS
=over 3
=item new(%params)
Create new class instance.
Required params:
api_version -- default: 2.2.4.1
username -- Expand user name (root as default).
password -- Expand password.
url -- full url to Expand XML RPC gate (https://ip.ad.dr.ess::8442/webgate.php').
=cut
sub new {
(undef) = shift @_;
my $self = __PACKAGE__->SUPER::new(@_);
$self->{package_name} = __PACKAGE__;
unless ($self->{api_version}) {
$self->{api_version} = '2.2.4.1';
}
return $self;
}
=item AUTOLOADed methods
All other methods are loaded by Autoload from corresponding modules.
Execute some operations (see API::PleskExpand::* modules documentation).
Example:
my $res = $expand_client->Func_Module->operation_type(%params);
# Func_Module -- module in API/PleskExpand folder
# operation_type -- sub which defined in Func_Module.
( run in 0.514 second using v1.01-cache-2.11-cpan-9288abcf80b )