
API::PleskExpand::Accounts - extension module for the management Plesk user accounts from Plesk Expand.

Directly not used, calls via API::PleskExpand.
use API::PleskExpand; some code

The module provides full support operations with Plesk accounts from Plesk Expand.

None by default.

Params:
'select' => 'optimal',
'template-id' => 1,
'attach_to_template' => 1, # attach account to a certain template
'general_info' => {
login => 'plesk_login',
pname => 'perldonal name',
passwd => 'userpasswd',
status => 0, # active
cname => '', # company name
phone => '',
fax => '',
email => '',
address => '',
city => '',
state => '', # state, for USA only
pcode => '',
country => 'RU',
}
You can let Plesk Expand automatically select a Plesk server based on certain filtering parameters (params for 'select' field):
'optimal' -- Least Integral Estimate (% used) selects the least loaded server (integrally estimated).
'min_domains' -- Least Domains (% used) registers a client on the server with the minimum number of domains.
'max_diskspace' -- Least Disk Space (% used) registers a client on the server with the minimum disk space used.
'' -- Select manually, Specify the target Plesk server by selecting its name from the list.
When choosing a 'manual' (select => '') option you should set server_id! For 'optimal', 'min_domains', 'max_diskspace' you can ask additional server group id ('group_id' params) or server keyword ('server_keyword' param);
Return (Data::Dumper output):
VAR1 = bless( {
'answer_data' => [ {
'server_id' => '1',
'status' => 'ok',
'expiration' => '-1',
'tmpl_id' => '1',
'id' => '15'
} ],
'error_codes' => ''
}, 'API::Plesk::Response' );
Changes the account params.
Params: general_info -- hashref`s with new user details id -- client id
Return:
$VAR1 = bless( {
'answer_data' => [ {
'server_id' => '1',
'status' => 'ok',
'tmpl_id' => '1',
'id' => '15',
'plesk_client_id' => '384',
'login' => 'suxdffffxx'
} ],
'error_codes' => ''
}, 'API::Plesk::Response' );
Example (client deactivation):
print Dumper $client->Accounts->modify(
id => 10,
general_info => { status => 16 }
);
Delete accounts.
Params: id -- client id in Plesk
Return:
$VAR1 = bless( {
'answer_data' => [ {
'server_id' => '1',
'status' => 'ok',
'id' => '15'
} ],
'error_codes' => ''
}, 'API::Plesk::Response' );
Example: print Dumper $client->Accounts->delete( id => 11 );

Blank.

Odintsov Pavel <nrg[at]cpan.org>

Copyright (C) 2008 by NRG
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.