line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Zabbix2::API::Trigger; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
809
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
46
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
35
|
|
5
|
2
|
|
|
2
|
|
30
|
use 5.010; |
|
2
|
|
|
|
|
5
|
|
6
|
2
|
|
|
2
|
|
6
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
84
|
|
7
|
2
|
|
|
2
|
|
398
|
use autodie; |
|
2
|
|
|
|
|
11515
|
|
|
2
|
|
|
|
|
9
|
|
8
|
2
|
|
|
2
|
|
7108
|
use utf8; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
44
|
use Moo::Lax; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
11
|
|
|
|
|
|
|
extends qw/Zabbix2::API::CRUDE/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _readonly_properties { |
14
|
|
|
|
|
|
|
return { |
15
|
0
|
|
|
0
|
|
|
triggerid => 1, |
16
|
|
|
|
|
|
|
error => 1, |
17
|
|
|
|
|
|
|
flags => 1, |
18
|
|
|
|
|
|
|
lastchange => 1, |
19
|
|
|
|
|
|
|
state => 1, |
20
|
|
|
|
|
|
|
templateid => 1, |
21
|
|
|
|
|
|
|
value => 1, |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub id { |
26
|
|
|
|
|
|
|
## mutator for id |
27
|
0
|
|
|
0
|
1
|
|
my ($self, $value) = @_; |
28
|
0
|
0
|
|
|
|
|
if (defined $value) { |
29
|
0
|
|
|
|
|
|
$self->data->{triggerid} = $value; |
30
|
0
|
|
|
|
|
|
return $self->data->{triggerid}; |
31
|
|
|
|
|
|
|
} else { |
32
|
0
|
|
|
|
|
|
return $self->data->{triggerid}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _prefix { |
37
|
0
|
|
|
0
|
|
|
my (undef, $suffix) = @_; |
38
|
0
|
0
|
|
|
|
|
if ($suffix) { |
39
|
0
|
|
|
|
|
|
return 'trigger'.$suffix; |
40
|
|
|
|
|
|
|
} else { |
41
|
0
|
|
|
|
|
|
return 'trigger'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _extension { |
46
|
0
|
|
|
0
|
|
|
return (output => 'extend', |
47
|
|
|
|
|
|
|
selectHosts => ['hostid'], |
48
|
|
|
|
|
|
|
selectItems => ['itemid'], |
49
|
|
|
|
|
|
|
selectFunctions => 'extend', |
50
|
|
|
|
|
|
|
selectDependencies => ['triggerid']); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub name { |
54
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
55
|
|
|
|
|
|
|
# can't think of a good name for triggers -- descriptions are too long |
56
|
0
|
|
|
|
|
|
return $self->data->{description}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |