line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crashplan::Client::Computer; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
36
|
use strict; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
260
|
|
4
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
6343
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.003_0'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Crashplan::Client::Computer - Object representation of Crashplan PROe server's entity |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Crashplan::Client::Computer objects are instancied by Crashplan::Client. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Specifically, calling Crashplan::Client->parse_response after querying |
17
|
|
|
|
|
|
|
the server could produce Crashplan::Client::Computer |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
A computer represents a unique resource which has connected to a CrashPlanPRO |
22
|
|
|
|
|
|
|
server and (perhaps) backed up data. Every computer must belong to exactly one |
23
|
|
|
|
|
|
|
user. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 new |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
The Crashplan::Client::Computer constructor |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
10
|
|
|
10
|
1
|
16
|
my $class = shift; |
36
|
10
|
|
50
|
|
|
24
|
my $param = shift || {}; |
37
|
|
|
|
|
|
|
|
38
|
10
|
|
|
|
|
46
|
my %converted_name = ( |
39
|
|
|
|
|
|
|
serverBackupStatsPercentComplete => 'serverBackupStats.percentComplete', |
40
|
|
|
|
|
|
|
serverBackupStatsCompressionRate => 'serverBackupStats.compressionRate', |
41
|
|
|
|
|
|
|
serverBackupStatsArchiveBytes => 'serverBackupStats.archiveBytes', |
42
|
|
|
|
|
|
|
serverBackupStatsSelectedBytes => 'serverBackupStats.selectedBytes', |
43
|
|
|
|
|
|
|
serverBackupStatsConnected => 'serverBackupStats.connected', |
44
|
|
|
|
|
|
|
serverBackupStatsNumberSelected => 'serverBackupStats.numberSelected', |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
10
|
|
|
|
|
15
|
my $self = $param; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
10
|
|
|
|
|
44
|
return bless $param,'Crashplan::Client::Computer'; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 id |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Getter for the 'id" attribute. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub id { |
61
|
10
|
|
|
10
|
1
|
120116
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
10
|
|
|
|
|
31
|
return $self->{id}; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 creationDate |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Getter for the 'creationDate" attribute. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub creationDate { |
73
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
|
|
6
|
return $self->{creationDate}; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 modificationDate |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Getter for the 'modificationDate" attribute. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub modificationDate { |
85
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
86
|
|
|
|
|
|
|
|
87
|
1
|
|
|
|
|
7
|
return $self->{modificationDate}; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 mountPointId |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
The id number of the mount point where the computer's archive resides |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub mountPointId { |
97
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
98
|
1
|
|
|
|
|
3
|
my $val = shift; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
1
|
|
|
|
|
5
|
return $self->{mountPointId}; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 serverBackupStatsCompressionRate |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
The compression rate of backups from this computer to the PRO Server. This valueis equivalent to the “Comp %” field in this_view of the admin console.A boolean value indicating whether this computer is currently connected to the |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub serverBackupStatsCompressionRate { |
111
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
112
|
0
|
|
|
|
|
0
|
my $val = shift; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
0
|
return $self->{serverBackupStatsCompressionRate}; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 status |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
“Active” if the computer is currently active, “Deactivated” if the computer has beendeactivated |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub status { |
125
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
126
|
1
|
|
|
|
|
3
|
my $val = shift; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
129
|
1
|
|
|
|
|
6
|
return $self->{status}; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 serverBackupStatsPercentComplete |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
The completion percentage for backups of this computer to the PRO Server. Thisvalue is equivalent to the ”% Complete” field in this_view of the admin console. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=cut |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub serverBackupStatsPercentComplete { |
139
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
140
|
0
|
|
|
|
|
0
|
my $val = shift; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
0
|
return $self->{serverBackupStatsPercentComplete}; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head2 alertStates |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
“OK” if the computer has backed up within defined days, “WARN” if computer hasexceeded “warning” threshold, “ALERT” if computer has exceeded “alert” threshold |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=cut |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub alertStates { |
153
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
154
|
1
|
|
|
|
|
3
|
my $val = shift; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
157
|
1
|
|
|
|
|
8
|
return $self->{alertStates}; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head2 remoteAddress |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
The IP address used by this computer to communicate with the PRO Server |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub remoteAddress { |
167
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
168
|
0
|
|
|
|
|
0
|
my $val = shift; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
171
|
0
|
|
|
|
|
0
|
return $self->{remoteAddress}; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head2 serverBackupStatsSelectedBytes |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
The total size of files selected for backup to the PRO Server. This value isequivalent to the “Bytes” field in this_view of the admin console. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=cut |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub serverBackupStatsSelectedBytes { |
181
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
182
|
0
|
|
|
|
|
0
|
my $val = shift; |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
0
|
return $self->{serverBackupStatsSelectedBytes}; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head2 guid |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
The GUID (globally unique identifier) for this computer |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=cut |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
sub guid { |
195
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
196
|
1
|
|
|
|
|
4
|
my $val = shift; |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
199
|
1
|
|
|
|
|
6
|
return $self->{guid}; |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head2 timeZone |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
The time zone confgured on this computer |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=cut |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
sub timeZone { |
209
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
210
|
0
|
|
|
|
|
0
|
my $val = shift; |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
0
|
return $self->{timeZone}; |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head2 javaVersion |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
The Java virtual machine version in use on this computer |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=cut |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
sub javaVersion { |
223
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
224
|
0
|
|
|
|
|
0
|
my $val = shift; |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
|
227
|
0
|
|
|
|
|
0
|
return $self->{javaVersion}; |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=head2 osVersion |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
Version of the operating system in use on this computer |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=cut |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub osVersion { |
237
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
238
|
0
|
|
|
|
|
0
|
my $val = shift; |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
241
|
0
|
|
|
|
|
0
|
return $self->{osVersion}; |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=head2 version |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
The version of CrashPlan software used on this computer |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=cut |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub version { |
251
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
252
|
0
|
|
|
|
|
0
|
my $val = shift; |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
|
255
|
0
|
|
|
|
|
0
|
return $self->{version}; |
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=head2 name |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
The name of this computer |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=cut |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
sub name { |
265
|
1
|
|
|
1
|
1
|
7
|
my $self = shift; |
266
|
1
|
|
|
|
|
3
|
my $val = shift; |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
269
|
1
|
|
|
|
|
8
|
return $self->{name}; |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=head2 userId |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
The id of the user to which this computer belongs |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=cut |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
sub userId { |
279
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
280
|
1
|
|
|
|
|
2
|
my $val = shift; |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
|
283
|
1
|
|
|
|
|
5
|
return $self->{userId}; |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head2 osArch |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
The underlying architecture of this computer |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=cut |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub osArch { |
293
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
294
|
0
|
|
|
|
|
|
my $val = shift; |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
|
297
|
0
|
|
|
|
|
|
return $self->{osArch}; |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
=head2 serverBackupStatsConnected |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
PRO Server. This value is equivalent to the “Connected” field in this_view of theadmin console. |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=cut |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
sub serverBackupStatsConnected { |
307
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
308
|
0
|
|
|
|
|
|
my $val = shift; |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
|
311
|
0
|
|
|
|
|
|
return $self->{serverBackupStatsConnected}; |
312
|
|
|
|
|
|
|
} |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=head2 osName |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
Name of the operating system in use on this computer |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
=cut |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
sub osName { |
321
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
322
|
0
|
|
|
|
|
|
my $val = shift; |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
|
325
|
0
|
|
|
|
|
|
return $self->{osName}; |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head2 serverBackupStatsArchiveBytes |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
The total disk space used by the PRO Server to store backups from this computer.This value is equivalent to the “Stored” field in this_view of the admin console. |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=cut |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
sub serverBackupStatsArchiveBytes { |
335
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
336
|
0
|
|
|
|
|
|
my $val = shift; |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
|
339
|
0
|
|
|
|
|
|
return $self->{serverBackupStatsArchiveBytes}; |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=head2 serverBackupStatsNumberSelected |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
The number of files selected for backup to the PRO Server. This value isequivalent to the “Selected” field in this_view of the admin console. |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=cut |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
sub serverBackupStatsNumberSelected { |
349
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
350
|
0
|
|
|
|
|
|
my $val = shift; |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
|
353
|
0
|
|
|
|
|
|
return $self->{serverBackupStatsNumberSelected}; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
=head2 url |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
Getter for the 'url" to access the REST server |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=cut |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
sub url { |
363
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
364
|
|
|
|
|
|
|
|
365
|
0
|
|
|
|
|
|
return '/rest/computers'; |
366
|
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=head1 SEE ALSO |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
http://support.crashplanpro.com/doku.php/api#computer |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=head1 AUTHOR |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
Arnaud (Arhuman) Assad, copyright 2011 Jaguar Network |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
=head1 LICENSE |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify |
379
|
|
|
|
|
|
|
it under the same terms as perl itself. |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=cut |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
1; |