| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package API::Plesk::DNS; |
|
3
|
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
1908
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
23
|
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
20
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
53
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
3
|
use base 'API::Plesk::Component'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
327
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub add_rec { |
|
12
|
0
|
|
|
0
|
0
|
|
my ( $self, %params ) = @_; |
|
13
|
0
|
|
|
|
|
|
my $bulk_send = delete $params{bulk_send}; |
|
14
|
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my @fields = ( |
|
16
|
|
|
|
|
|
|
[qw(site-id site-alias-id)], |
|
17
|
|
|
|
|
|
|
'type', |
|
18
|
|
|
|
|
|
|
'host', |
|
19
|
|
|
|
|
|
|
'value' |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
$self->check_required_params(\%params, @fields); |
|
23
|
0
|
|
|
|
|
|
my $data = $self->sort_params(\%params, @fields, 'opt'); |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
|
26
|
|
|
|
|
|
|
$self->plesk->send('dns', 'add_rec', $data); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub get_rec { |
|
30
|
0
|
|
|
0
|
0
|
|
my ( $self, %filter ) = @_; |
|
31
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
|
32
|
0
|
|
|
|
|
|
my $template = delete $filter{template}; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
my $data = [ |
|
|
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
{ filter => @_ > 2 ? \%filter : '' }, |
|
37
|
|
|
|
|
|
|
( $template ? {template => $template} : () ), |
|
38
|
|
|
|
|
|
|
]; |
|
39
|
|
|
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
|
41
|
|
|
|
|
|
|
$self->plesk->send('dns', 'get_rec', $data); |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub del_rec { |
|
45
|
0
|
|
|
0
|
0
|
|
my ( $self, %filter ) = @_; |
|
46
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
|
47
|
0
|
|
|
|
|
|
my $template = delete $filter{template}; |
|
48
|
|
|
|
|
|
|
|
|
49
|
0
|
0
|
|
|
|
|
my $data = [ |
|
50
|
|
|
|
|
|
|
{ filter => $self->prepare_filter(\%filter) }, |
|
51
|
|
|
|
|
|
|
( $template ? {template => $template} : () ), |
|
52
|
|
|
|
|
|
|
]; |
|
53
|
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
|
55
|
|
|
|
|
|
|
$self->plesk->send('dns', 'del_rec', $data); |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |