line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Zabbix2::API::Map;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
27301
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings;
|
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
21
|
use 5.010;
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
7
|
use Carp;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
7
|
1
|
|
|
1
|
|
5
|
use autodie;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
5277
|
use utf8;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
24
|
use Moo;
|
|
1
|
|
|
|
|
21
|
|
|
1
|
|
|
|
|
9
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends qw/Exporter Zabbix2::API::CRUDE/;
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use constant {
|
15
|
1
|
|
|
|
|
489
|
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
|
|
580
|
};
|
|
1
|
|
|
|
|
4
|
|
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__
|