line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package API::Plesk::DNS; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
2886
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
77
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
60
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
191
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
13
|
use base 'API::Plesk::Component'; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
1051
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub add_rec { |
12
|
1
|
|
|
1
|
0
|
6
|
my ( $self, %params ) = @_; |
13
|
1
|
|
|
|
|
2
|
my $bulk_send = delete $params{bulk_send}; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
my @fields = ( |
16
|
|
|
|
|
|
|
[qw(site-id site-alias-id)], |
17
|
|
|
|
|
|
|
'type', |
18
|
|
|
|
|
|
|
'host', |
19
|
|
|
|
|
|
|
'value' |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
9
|
$self->check_required_params(\%params, @fields); |
23
|
1
|
|
|
|
|
7
|
my $data = $self->sort_params(\%params, @fields, 'opt'); |
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
|
|
|
8
|
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
|
|
|
|
|
|
|
sub get_soa { |
59
|
0
|
|
|
0
|
0
|
|
my ( $self, %filter ) = @_; |
60
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
my $data = [ |
63
|
|
|
|
|
|
|
{ filter => @_ > 2 ? \%filter : '' } |
64
|
|
|
|
|
|
|
]; |
65
|
|
|
|
|
|
|
|
66
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
67
|
|
|
|
|
|
|
$self->plesk->send('dns', 'get', $data); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |