API-DirectAdmin

 view release on metacpan or  search on metacpan

lib/API/DirectAdmin/Domain.pm  view on Meta::CPAN

package API::DirectAdmin::Domain;

use Modern::Perl '2010';
use Data::Dumper;

use base 'API::DirectAdmin::Component';

our $VERSION = 0.05;

# Return domains list
# INPUT
# connection data for USER, not admin
sub list {
    my ($self ) = @_;

    my $responce = $self->directadmin->query(
	command => 'CMD_API_SHOW_DOMAINS',
    );
    
    return $responce->{list} if ref $responce eq 'HASH';
    return [];

lib/API/DirectAdmin/Ip.pm  view on Meta::CPAN

package API::DirectAdmin::Ip;

use Modern::Perl '2010';

use base 'API::DirectAdmin::Component';

our $VERSION = 0.05;

# Return list of IP
# INPUT
# Admin connect params
sub list {
    my ($self ) = @_;

    my $responce = $self->directadmin->query(
	command => 'CMD_API_SHOW_RESELLER_IPS',
    );

    return $responce->{list} if ref $responce eq 'HASH';
    return [];
}

# Add Ip
# INPUT
# Admin connect params
# ip = 'IP.AD.DRE.SS'
# status = free|shared|owned (optional)
sub add {
    my ($self, $params ) = @_;
   
    my %add_params = (
	action   => 'add',
	add      => 'Submit',
	netmask  => '255.255.255.0',

lib/API/DirectAdmin/Ip.pm  view on Meta::CPAN

	allowed_fields => 'ip
			   action
			   add
			   netmask
			   notify
			   status',
    );
}

# Delete Ip
# INPUT
# Admin connect params
# select0 = 'IP.AD.DRE.SS'
sub remove {
    my ($self, $params ) = @_;
    
    my %add_params = (
	action   => 'select',
	delete   => 'Delete',
    );
    

lib/API/DirectAdmin/Mysql.pm  view on Meta::CPAN

use Data::Dumper;
use Carp;

use base 'API::DirectAdmin::Component';

our $VERSION = 0.05;

# Create database for user
# Connection data MUST BE for user: auth_user => 'admin_login|user_login'
# auth_passwd => 'admin_passwd'
#    INPUT
#    name	=> 'DBNAME',
#    passwd	=> 'DBPASSWD',
#    passwd2	=> 'DBPASSWD',
#    user	=> 'DBLOGIN',
sub adddb {
    my ($self, $params ) = @_;
    
    $params->{action} = 'create';
    
    carp 'params ' . Dumper($params) if $self->{debug};

lib/API/DirectAdmin/Mysql.pm  view on Meta::CPAN

    carp '$responce ' . Dumper(\$responce) if $self->{debug};
    
    return $responce if $responce;    

    return 'FAIL';
}

# Delete database for user
# Connection data MUST BE for user: auth_user => 'admin_login|user_login'
# auth_passwd => 'admin_passwd'
#    INPUT
#    select0	=> 'DBNAME',
#    domain	=> 'DOMAIN.COM',
sub deldb {
    my ($self, $params ) = @_;
    
    $params->{action} = 'delete';

    carp 'params ' . Dumper($params) if $self->{debug};

    my $responce = $self->directadmin->query(



( run in 0.407 second using v1.01-cache-2.11-cpan-4e96b696675 )