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