API::Plesk - OOP interface to the Plesk XML API (http://www.parallels.com/en/products/plesk/).


API-Plesk documentation  | view source Contained in the API-Plesk distribution.

Index


NAME

Top

API::Plesk - OOP interface to the Plesk XML API (http://www.parallels.com/en/products/plesk/).

SYNOPSIS

Top

    use API::Plesk;
    use API::Plesk::Response;

    my $plesk_client = API::Plesk->new(%params);
    my $res = $plesk_client->Func_Module->operation_type(%params);

    if ($res->is_success) {
        $res->get_data; # return arr ref of answer blocks
    }

DESCRIPTION

Top

At present the module provides interaction with Plesk 8.3.0 (API 1.5.0.0). Complete support of operations with Accounts, partial support of work with Templates (account and domains). Support of addition of domains to user Accounts.

API::Plesk 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_parse. The first sub generates XML query to Plesk, the second is responsible for parse XML answer and its representation in Perl Native Structures. As a template for a writing of own expansions is better to use API/Plesk/Account.pm. In module API::Plesk::Methods we can find service functions for a writing our extensions.

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

EXPORT

Top

Nothing.

METHODS

Top

new(%params)

Create new class instance.

Required params:

  api_version -- default: 1.5.0.0
  username -- Plesk user name.
  password -- Plesk password.
  url -- full url to Plesk XML RPC gate (https://ip.ad.dr.ess:8443/enterprise/control/agent.php).

AUTOLOADed methods

All other methods are loaded by Autoload from corresponding modules. Execute some operations (see API::Plesk::* modules documentation).

Example:

  my $res = $plesk_client->Func_Module->operation_type(%params); 
  # Func_Module -- module in API/Plesk folder
  # operation_type -- sub which defined in Func_Module.
  # params hash used as @_ for operation_type sub.

AUTHOR

Top

Odintsov Pavel <nrg[at]cpan.org> Nikolay Shulyakovskiy <shulyakovskiy[at]rambler.ru>

COPYRIGHT AND LICENSE

Top


API-Plesk documentation  | view source Contained in the API-Plesk distribution.