API-DirectAdmin
view release on metacpan or search on metacpan
lib/API/DirectAdmin/Mysql.pm view on Meta::CPAN
# passwd2 => 'DBPASSWD',
# user => 'DBLOGIN',
sub adddb {
my ($self, $params ) = @_;
$params->{action} = 'create';
carp 'params ' . Dumper($params) if $self->{debug};
my $responce = $self->directadmin->query(
command => 'CMD_API_DATABASES',
method => 'POST',
params => $params,
allowed_fields => 'action
name
passwd
passwd2
user',
);
carp '$responce ' . Dumper(\$responce) if $self->{debug};
lib/API/DirectAdmin/Mysql.pm view on Meta::CPAN
# 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(
command => 'CMD_API_DATABASES',
method => 'POST',
params => $params,
allowed_fields => 'action
select0',
);
carp '$responce ' . Dumper(\$responce) if $self->{debug};
return $responce if $responce;
return 'FAIL';
}
# Get list of databases for authorized user.
# No params.
sub list {
my ($self ) = @_;
my $responce = $self->directadmin->query(
command => 'CMD_API_DATABASES',
method => 'GET',
);
carp '$responce ' . Dumper($responce) if $self->{debug};
return $responce->{list} if ref $responce eq 'HASH';
return [];
}
1;
( run in 1.566 second using v1.01-cache-2.11-cpan-140bd7fdf52 )