line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SecurityCenter::API::Zone; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
908
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
63
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
99
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
14
|
use parent 'Net::SecurityCenter::Base'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
123
|
use Net::SecurityCenter::Utils qw(:all); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
963
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.311'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $common_template = { |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
id => { |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
allow => qr/^\d+$/, |
19
|
|
|
|
|
|
|
messages => { |
20
|
|
|
|
|
|
|
required => 'Scan Zone ID is required', |
21
|
|
|
|
|
|
|
allow => 'Invalid Scan Zone ID', |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
fields => { |
26
|
|
|
|
|
|
|
filter => \&sc_filter_array_to_string |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
32
|
|
|
|
|
|
|
# METHODS |
33
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub list { |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
1
|
1
|
3
|
my ( $self, %args ) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $tmpl = { |
40
|
1
|
|
|
|
|
5
|
fields => $common_template->{'fields'}, |
41
|
|
|
|
|
|
|
raw => {}, |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
5
|
my $params = sc_check_params( $tmpl, \%args ); |
45
|
1
|
|
|
|
|
6
|
my $raw = delete( $params->{'raw'} ); |
46
|
1
|
|
|
|
|
12
|
my $zones = $self->client->get( '/zone', $params ); |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
6
|
return if ( !$zones ); |
49
|
|
|
|
|
|
|
|
50
|
1
|
50
|
|
|
|
5
|
if ($raw) { |
51
|
0
|
0
|
|
|
|
0
|
return wantarray ? @{$zones} : $zones; |
|
0
|
|
|
|
|
0
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
1
|
50
|
|
|
|
10
|
return wantarray ? @{ sc_normalize_array($zones) } : sc_normalize_array($zones); |
|
0
|
|
|
|
|
0
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub get { |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
1
|
1
|
6
|
my ( $self, %args ) = @_; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $tmpl = { |
65
|
|
|
|
|
|
|
fields => $common_template->{'fields'}, |
66
|
1
|
|
|
|
|
5
|
id => $common_template->{'id'}, |
67
|
|
|
|
|
|
|
raw => {}, |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
71
|
1
|
|
|
|
|
4
|
my $zone_id = delete( $params->{'id'} ); |
72
|
1
|
|
|
|
|
3
|
my $raw = delete( $params->{'raw'} ); |
73
|
1
|
|
|
|
|
4
|
my $zone = $self->client->get( "/zone/$zone_id", $params ); |
74
|
|
|
|
|
|
|
|
75
|
1
|
50
|
|
|
|
16
|
return if ( !$zone ); |
76
|
1
|
50
|
|
|
|
6
|
return $zone if ($raw); |
77
|
1
|
|
|
|
|
4
|
return sc_normalize_hash($zone); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |