| 1 | package VM::EC2::Volume::Status::Event; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::Volume::Status::Event - Object describing a scheduled volume maintenance event | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | @status_items = $ec2->describe_volume_status(); | ||
| 10 | for my $i (@status_items) { | ||
| 11 | for my $event ($i->events) { | ||
| 12 | print $i->volume_id,': ', | ||
| 13 | $event->type,' ', | ||
| 14 | $event->description, ' ', | ||
| 15 | $event->notBefore, ' ', | ||
| 16 | $event->notAfter,"\n"; | ||
| 17 | } | ||
| 18 | } | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This objects describes a scheduled maintenance event on an volume, | ||
| 23 | and is returned by calling the events() method of one of the status | ||
| 24 | item objects returned by $ec2->describe_volume_status(). | ||
| 25 | |||
| 26 | NOTE: There is an inconsistency in the AWS documentation for this data | ||
| 27 | type. The events field is documented as being a list, but the examples | ||
| 28 | shown show a single object. At release time, I was unable to verify | ||
| 29 | which is correct and have written the code such that it will detect a | ||
| 30 | single value in the response object and return this as a single-element | ||
| 31 | list. | ||
| 32 | |||
| 33 | =head1 METHODS | ||
| 34 | |||
| 35 | eventType -- The type of event | ||
| 36 | |||
| 37 | eventId -- The ID of the event | ||
| 38 | |||
| 39 | description -- A description of the event. | ||
| 40 | |||
| 41 | notBefore -- The earliest scheduled start time for the event. | ||
| 42 | |||
| 43 | notAfter -- The latest scheduled end time for the event. | ||
| 44 | |||
| 45 | type -- Alias for eventType | ||
| 46 | |||
| 47 | id -- Alias for eventId | ||
| 48 | |||
| 49 | When used in a string context, this object interpolates as a string | ||
| 50 | using the eventType. | ||
| 51 | |||
| 52 | =head1 SEE ALSO | ||
| 53 | |||
| 54 | L<VM::EC2> | ||
| 55 | L<VM::EC2::Generic> | ||
| 56 | L<VM::EC2::Volume> | ||
| 57 | L<VM::EC2::Volume::Status> | ||
| 58 | L<VM::EC2::Volume::StatusItem> | ||
| 59 | L<VM::EC2::Volume::Status::Details> | ||
| 60 | L<VM::EC2::Tag> | ||
| 61 | |||
| 62 | =head1 AUTHOR | ||
| 63 | |||
| 64 | Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>. | ||
| 65 | |||
| 66 | Copyright (c) 2012 Ontario Institute for Cancer Research | ||
| 67 | |||
| 68 | This package and its accompanying libraries is free software; you can | ||
| 69 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 70 | version 1, or at your option, any later version) or the Artistic | ||
| 71 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 72 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | use strict; | ||
| 77 | use base 'VM::EC2::Generic'; | ||
| 78 | |||
| 79 | use strict; | ||
| 80 | |||
| 81 | sub valid_fields { | ||
| 82 | my $self = shift; | ||
| 83 | return qw(eventType eventId description notBefore notAfter); | ||
| 84 | } | ||
| 85 | |||
| 86 | sub type {shift->eventType} | ||
| 87 | sub id {shift->eventId} | ||
| 88 | sub short_name { | ||
| 89 | my $self = shift; | ||
| 90 | return $self->eventType; | ||
| 91 | } | ||
| 92 | |||
| 93 | 1; | ||
| 94 |