API-DirectAdmin
view release on metacpan or search on metacpan
lib/API/DirectAdmin.pm view on Meta::CPAN
Delete DirectAdmin user and all user's data
Note: Some DirectAdmin's API methods required parameter "select0" for choose value from list. Like list of users, databases, ip, etc.
Example:
my $result = $da->user->delete( {
select0 => 'username',
} );
=item disable/enable
Two different methods for disable and enable users with same params.
Example:
my $disable_result = $da->user->disable( {
select0 => 'username',
} );
my $enable_result = $da->user->enable( {
select0 => 'username',
} );
=item change_password
Change password for user
Example:
my $result = $da->user->change_password( {
username => 'username',
passwd => 'new_password',
passwd2 => 'new_password',
} );
=item change_package
Change package (tariff plan) for user
Example:
my $result = $da->user->change_package( {
username => 'username',
package => 'new_package',
} );
=item show_packages
Return list of available packages.
Note: If you created packages through administrator user - you must use admin's login and password for authorisation. Obviously, if packages was created by reseller user - use reseller authorisation.
Example:
my $packages = $da->user->show_packages();
=item show_user_config
Return all user settings.
Example:
my $user_config = $da->user->show_user_config({ user => 'username' });
=back
=head2 API::DirectAdmin::Domain
=over
=item list
Return list of domains on server.
Example:
my $domains = $da->domain->list();
=item add
Add new domain to user through you connect to server.
Note: For adding domains for customers and you don't khow their password use: auth_user = 'admin_name|customer_name' in auth hash.
Example:
my %auth = (
auth_user => 'admin_name|customer_name',
auth_passwd => 'admin_passwd',
host => '11.22.33.44',
);
# init
my $da = API::DirectAdmin->new(%auth);
$result = $da->domain->add({
domain => 'newdomain.com',
php => 'ON',
cgi => 'ON',
});
=back
=head2 API::DirectAdmin::Mysql
Control users mysql databases
=over
=item list
List of databases from user. Return empty array if databases not found.
Example:
print $da->mysql->list();
=item adddb
( run in 1.487 second using v1.01-cache-2.11-cpan-d7f47b0818f )