blib/lib/VM/EC2/AvailabilityZone.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
primary_id
2.0
valid_fields
2.0
messages
2.0
CRAP 2.0
1 package VM::EC2::AvailabilityZone;
2  
3 =head1 NAME
4  
5 VM::EC2::AvailabilityZone - Object describing an Amazon availability zone
6  
7 =head1 SYNOPSIS
8  
9 use VM::EC2;
10  
11 $ec2 = VM::EC2->new(...);
12 @zones = $ec2->describe_availability_zones(-filter=>{state=>'available'});
13  
14 $zone = $zones[0];
15 $name = $zone->zoneName;
16 @messages= $zone->messages;
17  
18 =head1 DESCRIPTION
19  
20 This object represents an Amazon EC2 availability zone, and is returned
21 by VM::EC2->describe_availability_zones().
22  
23 =head1 METHODS
24  
25 These object methods are supported:
26  
27 zoneName -- Name of the zone, e.g. "eu-west-1a"
28 zoneState -- State of the availability zone, e.g. "available"
29 regionName -- Name of the region
30 region -- A VM::EC2::Region object corresponding to regionName
31 messages -- A list of messages about the zone
32  
33 =head1 STRING OVERLOADING
34  
35 When used in a string context, this object will interpolate the
36 zoneName.
37  
38 =head1 SEE ALSO
39  
40 L<VM::EC2>
41 L<VM::EC2::Generic>
42 L<VM::EC2::Region>
43  
44 =head1 AUTHOR
45  
46 Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>.
47  
48 Copyright (c) 2011 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  
61 sub primary_id {shift->zoneName}
62  
63 sub valid_fields {
64 my $self = shift;
65 return qw(zoneName zoneState regionName messageSet);
66 }
67  
68 sub messages {
69 my $self = shift;
70 my $m = $self->messageSet or return;
71 return map {$_->{message}} @{$m->{item}};
72 }
73  
74 sub region {
75 my $self = shift;
76 my $r = $self->regionName;
77 return $self->aws->describe_regions($r);
78 }
79  
80 1;