line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SecurityCenter::API::Zone; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
909
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
37
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
106
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
11
|
use parent 'Net::SecurityCenter::Base'; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
13
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
145
|
use Net::SecurityCenter::Utils qw(:all); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1048
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.300'; |
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
|
4
|
my ( $self, %args ) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $tmpl = { |
40
|
1
|
|
|
|
|
5
|
fields => $common_template->{'fields'}, |
41
|
|
|
|
|
|
|
raw => {}, |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
6
|
my $params = sc_check_params( $tmpl, \%args ); |
45
|
1
|
|
|
|
|
4
|
my $raw = delete( $params->{'raw'} ); |
46
|
1
|
|
|
|
|
14
|
my $zones = $self->client->get( '/zone', $params ); |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
6
|
return if ( !$zones ); |
49
|
|
|
|
|
|
|
|
50
|
1
|
50
|
|
|
|
4
|
if ($raw) { |
51
|
0
|
0
|
|
|
|
0
|
return wantarray ? @{$zones} : $zones; |
|
0
|
|
|
|
|
0
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
1
|
50
|
|
|
|
8
|
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
|
4
|
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
|
|
|
|
|
3
|
my $zone_id = delete( $params->{'id'} ); |
72
|
1
|
|
|
|
|
4
|
my $raw = delete( $params->{'raw'} ); |
73
|
1
|
|
|
|
|
5
|
my $zone = $self->client->get( "/zone/$zone_id", $params ); |
74
|
|
|
|
|
|
|
|
75
|
1
|
50
|
|
|
|
5
|
return if ( !$zone ); |
76
|
1
|
50
|
|
|
|
4
|
return $zone if ($raw); |
77
|
1
|
|
|
|
|
5
|
return sc_normalize_hash($zone); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |