line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Duowan::DNS::Zones; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
28
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
6
|
1
|
|
|
1
|
|
4
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
7
|
1
|
|
|
1
|
|
918
|
use JSON; |
|
1
|
|
|
|
|
11964
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
1
|
|
150
|
use base 'Net::Duowan::DNS::Common'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
504
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use vars qw/$VERSION/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
400
|
|
11
|
|
|
|
|
|
|
$VERSION = '1.2.0'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $psp = shift; |
16
|
0
|
|
|
|
|
|
my $token = shift; |
17
|
0
|
|
|
|
|
|
bless { psp => $psp, token => $token },$class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub fetch { |
21
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $psp = $self->{psp}; |
24
|
0
|
|
|
|
|
|
my $token = $self->{token}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my %args = @_; |
27
|
0
|
|
0
|
|
|
|
my $offset = $args{offset} || 0; |
28
|
0
|
|
0
|
|
|
|
my $number = $args{number} || -1; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my $act = 'zone_load_multi'; |
31
|
0
|
|
|
|
|
|
my %reqs = (a=>$act, psp=>$psp, tkn=>$token, offset=>$offset, number=>$number); |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return $self->reqTemplate(%reqs); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub check { |
37
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my @zones = @_; |
40
|
0
|
0
|
|
|
|
|
unless (@zones) { |
41
|
0
|
|
|
|
|
|
croak "no zones list provided"; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $zones = join ',',@zones; |
45
|
0
|
|
|
|
|
|
my $psp = $self->{psp}; |
46
|
0
|
|
|
|
|
|
my $token = $self->{token}; |
47
|
0
|
|
|
|
|
|
my $act = 'zone_check'; |
48
|
0
|
|
|
|
|
|
my %reqs = (a=>$act, psp=>$psp, tkn=>$token, zones=>$zones); |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $self->reqTemplate(%reqs); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub create { |
54
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
55
|
0
|
|
0
|
|
|
|
my $zone = shift || croak "no zone provided"; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $psp = $self->{psp}; |
58
|
0
|
|
|
|
|
|
my $token = $self->{token}; |
59
|
0
|
|
|
|
|
|
my $act = 'zone_new'; |
60
|
0
|
|
|
|
|
|
my %reqs = (a=>$act, psp=>$psp, tkn=>$token, z=>$zone); |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
return $self->reqTemplate(%reqs); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub remove { |
66
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
67
|
0
|
|
0
|
|
|
|
my $zone = shift || croak "no zone provided"; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $psp = $self->{psp}; |
70
|
0
|
|
|
|
|
|
my $token = $self->{token}; |
71
|
0
|
|
|
|
|
|
my $act = 'zone_delete'; |
72
|
0
|
|
|
|
|
|
my %reqs = (a=>$act, psp=>$psp, tkn=>$token, z=>$zone); |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return $self->reqTemplate(%reqs); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |