The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

Directly not used, calls via API::PleskExpand.

 use API::PleskExpand;

 some code

DESCRIPTION

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

EXPORT

None by default.

METHODS

create()

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' );
modify(%params)

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(%params)

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 );

SEE ALSO

Blank.

AUTHOR

Odintsov Pavel <nrg[at]cpan.org>

COPYRIGHT AND LICENSE

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.