line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Monitis::ExternalMonitors; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
|
|
|
|
|
|
require Carp; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base 'Monitis'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
998
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub add { |
10
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my @mandatory = qw/type name url interval timeout locationIds tag/; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# TODO: right checks for detailedTestType postData contentMatchFlag contentMatchString |
15
|
0
|
|
|
|
|
|
my @optional = |
16
|
|
|
|
|
|
|
qw/detailedTestType overSSL postData contentMatchFlag contentMatchString params/; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return $self->api_post('addExternalMonitor' => $params); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub edit { |
24
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my @mandatory = qw/testId name url locationIds timeout tag/; |
27
|
0
|
|
|
|
|
|
my @optional = qw/contentMatchString maxValue/; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return $self->api_post('editExternalMonitor' => $params); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub delete { |
35
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my @mandatory = qw/testIds/; |
38
|
0
|
|
|
|
|
|
my @optional = qw//; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return $self->api_post('deleteExternalMonitor' => $params); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub suspend { |
46
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
49
|
0
|
|
|
|
|
|
my @optional = qw/monitorIds tag/; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return $self->api_post('suspendExternalMonitor' => $params); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub activate { |
57
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
60
|
0
|
|
|
|
|
|
my @optional = qw/monitorIds tag/; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return $self->api_post('activateExternalMonitor' => $params); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub get_locations { |
68
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
return $self->api_get('locations'); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub get_monitors { |
74
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return $self->api_get('tests'); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub get_monitor_info { |
80
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
my @mandatory = qw/testId/; |
83
|
0
|
|
|
|
|
|
my @optional = qw//; |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
return $self->api_get('testinfo' => $params); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub get_monitor_results { |
91
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
my @mandatory = qw/testId day month year/; |
94
|
0
|
|
|
|
|
|
my @optional = qw/locationIds timezone/; |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
return $self->api_get('testresult' => $params); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub get_snapshot { |
102
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
105
|
0
|
|
|
|
|
|
my @optional = qw/locationIds/; |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
return $self->api_get('testsLastValues' => $params); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub get_top_results { |
113
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my @mandatory = qw//; |
116
|
0
|
|
|
|
|
|
my @optional = qw/timezoneoffset limit tag/; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
119
|
|
|
|
|
|
|
|
120
|
0
|
|
|
|
|
|
return $self->api_get('topexternal' => $params); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub get_tags { |
124
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
return $self->api_get('tags'); |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub get_by_tag { |
130
|
0
|
|
|
0
|
1
|
|
my ($self, @params) = @_; |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
|
my @mandatory = qw/tag/; |
133
|
0
|
|
|
|
|
|
my @optional = qw//; |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
my $params = $self->prepare_params(\@params, \@mandatory, \@optional); |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
return $self->api_get('tagtests' => $params); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |