| 1 | package VM::EC2::Volume::Status; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::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 | |||
| 19 | This object represents the result of a volume status check operation. | ||
| 20 | |||
| 21 | =head1 METHODS | ||
| 22 | |||
| 23 | The 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 | |||
| 30 | In a string context, this object interpolates with the status string. | ||
| 31 | |||
| 32 | =head1 SEE ALSO | ||
| 33 | |||
| 34 | L<VM::EC2> | ||
| 35 | L<VM::EC2::Generic> | ||
| 36 | L<VM::EC2::State> | ||
| 37 | L<VM::EC2::Volume> | ||
| 38 | L<VM::EC2::Volume::StatusItem> | ||
| 39 | L<VM::EC2::Tag> | ||
| 40 | |||
| 41 | =head1 AUTHOR | ||
| 42 | |||
| 43 | Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>. | ||
| 44 | |||
| 45 | Copyright (c) 2012 Ontario Institute for Cancer Research | ||
| 46 | |||
| 47 | This package and its accompanying libraries is free software; you can | ||
| 48 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 49 | version 1, or at your option, any later version) or the Artistic | ||
| 50 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 51 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | use strict; | ||
| 56 | use base 'VM::EC2::Generic'; | ||
| 57 | use VM::EC2::Volume::Status::Details; | ||
| 58 | |||
| 59 | use strict; | ||
| 60 | |||
| 61 | sub valid_fields { | ||
| 62 | my $self = shift; | ||
| 63 | return qw(status details); | ||
| 64 | } | ||
| 65 | |||
| 66 | sub 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 | |||
| 73 | sub short_name {shift->status} | ||
| 74 | |||
| 75 | 1; | ||
| 76 |