line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Zabbix2::API::Map; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20214
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
5
|
1
|
|
|
1
|
|
25
|
use 5.010; |
|
1
|
|
|
|
|
2
|
|
6
|
1
|
|
|
1
|
|
3
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
58
|
|
7
|
1
|
|
|
1
|
|
4
|
use autodie; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
3175
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
22
|
use Moo::Lax; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends qw/Exporter Zabbix2::API::CRUDE/; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use constant { |
15
|
1
|
|
|
|
|
367
|
MAP_ELEMENT_TYPE_HOST => 0, |
16
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_MAP => 1, |
17
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_TRIGGER => 2, |
18
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_HOSTGROUP => 3, |
19
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_IMAGE => 4 |
20
|
1
|
|
|
1
|
|
707
|
}; |
|
1
|
|
|
|
|
2
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our @EXPORT_OK = qw/ |
23
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_HOST |
24
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_MAP |
25
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_TRIGGER |
26
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_HOSTGROUP |
27
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_IMAGE/; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
30
|
|
|
|
|
|
|
map_element_types => [ |
31
|
|
|
|
|
|
|
qw/MAP_ELEMENT_TYPE_HOST |
32
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_MAP |
33
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_TRIGGER |
34
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_HOSTGROUP |
35
|
|
|
|
|
|
|
MAP_ELEMENT_TYPE_IMAGE/ |
36
|
|
|
|
|
|
|
], |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _readonly_properties { |
40
|
|
|
|
|
|
|
return { |
41
|
0
|
|
|
0
|
|
|
sysmapid => 1, |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub id { |
46
|
|
|
|
|
|
|
## mutator for id |
47
|
0
|
|
|
0
|
1
|
|
my ($self, $value) = @_; |
48
|
0
|
0
|
|
|
|
|
if (defined $value) { |
49
|
0
|
|
|
|
|
|
$self->data->{sysmapid} = $value; |
50
|
0
|
|
|
|
|
|
return $self->data->{sysmapid}; |
51
|
|
|
|
|
|
|
} else { |
52
|
0
|
|
|
|
|
|
return $self->data->{sysmapid}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _prefix { |
57
|
0
|
|
|
0
|
|
|
my (undef, $suffix) = @_; |
58
|
0
|
0
|
|
|
|
|
if ($suffix) { |
59
|
0
|
0
|
|
|
|
|
if ($suffix =~ m/id(s?)/) { |
60
|
0
|
|
|
|
|
|
return 'sysmap'.$suffix; |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
return 'map'.$suffix; |
63
|
|
|
|
|
|
|
} else { |
64
|
0
|
|
|
|
|
|
return 'map'; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub _extension { |
69
|
0
|
|
|
0
|
|
|
return (output => 'extend', |
70
|
|
|
|
|
|
|
selectSelements => 'extend', |
71
|
|
|
|
|
|
|
selectLinks => 'extend'); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
__END__ |