API-PleskExpand

 view release on metacpan or  search on metacpan

lib/API/PleskExpand/Accounts.pm  view on Meta::CPAN

#
# DESCRIPTION:
#   Plesk Expand communicate interface. Static methods for managing Plesk user accounts from Plesk Expand.
# AUTHORS:
#   Pavel Odintsov (nrg) <pavel.odintsov@gmail.com>
#
#========================================================================

package API::PleskExpand::Accounts;

use strict;
use warnings;

use API::Plesk::Methods;
use Data::Dumper;

our $VERSION = '1.04';

=head1 NAME

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

=head1 SYNOPSIS

Directly not used, calls via API::PleskExpand.

 use API::PleskExpand;

 some code

=head1 DESCRIPTION

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

=head1 EXPORT

None by default.

=cut

=head1 METHODS

=over 3

=item 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' );

=cut

# Create element
# STATIC
sub create {



( run in 2.003 seconds using v1.01-cache-2.11-cpan-140bd7fdf52 )