blib/lib/VM/EC2/Instance/Status.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 33 CC 1 SCAR 6.9
CC
1
Cov
0%
valid_fields
2.0
details
2.0
short_name
2.0
CRAP 2.0
1 package VM::EC2::Instance::Status;
2  
3 =head1 NAME
4  
5 VM::EC2::Instance::Status - Object describing an instance/system status check
6  
7 =head1 SYNOPSIS
8  
9 @status_items = $ec2->describe_instance_status();
10 for my $i (@status_items) {
11 print $i->instance_id,
12 ': instance check=',$i->instance_status,
13 ', system check=',$i->system_status,"\n";
14 if ($i->instance_status ne 'ok') {
15 print $i->instance_status->details,"\n";
16 }
17 }
18  
19 =head1 DESCRIPTION
20  
21 This object represents the result of a system or instance status check
22 operation.
23  
24 =head1 METHODS
25  
26 The following methods are supported:
27  
28 status() -- The status, one of "ok", "impaired", "insufficient-data",
29 or "not-applicable"
30 details() -- A list of information about system instance health or
31 application instance health.
32  
33 In a string context, this object interpolates with the status string.
34  
35 =head1 SEE ALSO
36  
37 L<VM::EC2>
38 L<VM::EC2::Generic>
39 L<VM::EC2::State>
40 L<VM::EC2::Instance>
41 L<VM::EC2::Instance::StatusItem>
42 L<VM::EC2::Tag>
43  
44 =head1 AUTHOR
45  
46 Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>.
47  
48 Copyright (c) 2012 Ontario Institute for Cancer Research
49  
50 This package and its accompanying libraries is free software; you can
51 redistribute it and/or modify it under the terms of the GPL (either
52 version 1, or at your option, any later version) or the Artistic
53 License 2.0. Refer to LICENSE for the full license text. In addition,
54 please see DISCLAIMER.txt for disclaimers of warranty.
55  
56 =cut
57  
58 use strict;
59 use base 'VM::EC2::Generic';
60 use VM::EC2::Instance::Status::Details;
61  
62 use strict;
63  
64 sub valid_fields {
65 my $self = shift;
66 return qw(status details);
67 }
68  
69 sub details {
70 my $self = shift;
71 my $e = $self->SUPER::details or return;
72 my @e = map { VM::EC2::Instance::Status::Details->new($_,$self->ec2)} @{$e->{item}};
73 return @e;
74 }
75  
76 sub short_name {shift->status}
77  
78 1;
79