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