lib/VM/EC2/REST/zone.pm

filter: Statementstmt 44.4% 8 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 41.6% 10 / 24 CC 1 SCAR 4.1
CC
1
Cov
44%
describe_regions
2.0
describe_availability_zones
2.0
BEGIN
1.0
CRAP 1.5
« lib/VM/EC2/Error.pm ↑ Summary lib/VM/EC2/REST/monitoring.pm »
1 package VM::EC2::REST::zone;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use VM::EC2 ''; # important not to import anything!
Subroutine BEGIN: called CC=1 SCAR=0.0
5 package VM::EC2; # add methods to VM::EC2
6  
7 7 VM::EC2::Dispatch->register(
8 DescribeRegions => 'fetch_items,regionInfo,VM::EC2::Region',
9 DescribeAvailabilityZones => 'fetch_items,availabilityZoneInfo,VM::EC2::AvailabilityZone',
10 );
11  
12 =head1 NAME VM::EC2::REST::zone
13  
14 =head1 SYNOPSIS
15  
16 use VM::EC2 qw(:standard);
17  
18 =head1 EC2 REGIONS AND AVAILABILITY ZONES
19  
20 This section describes methods that allow you to fetch information on
21 EC2 regions and availability zones. These methods return objects of
22 type L<VM::EC2::Region> and L<VM::EC2::AvailabilityZone>.
23  
24 Implemented:
25 DescribeAvailabilityZones
26 DescribeRegions
27  
28 Unimplemented:
29 (none)
30  
31 =head2 @regions = $ec2->describe_regions(@list)
32  
33 =head2 @regions = $ec2->describe_regions(-region_name=>\@list)
34  
35 Describe regions and return a list of VM::EC2::Region objects. Call
36 with no arguments to return all regions. You may provide a list of
37 regions in either of the two forms shown above in order to restrict
38 the list returned. Glob-style wildcards, such as "*east") are allowed.
39  
40 =cut
41  
42 sub describe_regions {
43 0 ▶ my $self = shift;
Subroutine describe_regions: not called CC=1 SCAR=6.9
Pod undocumented
44 0 my %args = $self->args('-region_name',@_);
45 0 my @params = $self->list_parm('RegionName',\%args);
46 0 push @params,$self->filter_parm(\%args);
47 0 return $self->call('DescribeRegions',@params);
48 }
49  
50 =head2 @zones = $ec2->describe_availability_zones(@names)
51  
52 =head2 @zones = $ec2->describe_availability_zones(-zone_name=>\@names,-filter=>\%filters)
53  
54 Describe availability zones and return a list of
55 VM::EC2::AvailabilityZone objects. Call with no arguments to return
56 all availability regions. You may provide a list of zones in either
57 of the two forms shown above in order to restrict the list
58 returned. Glob-style wildcards, such as "*east") are allowed.
59  
60 If you provide a single argument consisting of a hashref, it is
61 treated as a -filter argument. In other words:
62  
63 $ec2->describe_availability_zones({state=>'available'})
64  
65 is equivalent to
66  
67 $ec2->describe_availability_zones(-filter=>{state=>'available'})
68  
69 Availability zone filters are described at
70 http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAvailabilityZones.html
71  
72 =cut
73  
74 sub describe_availability_zones {
75 0 ▶ my $self = shift;
Subroutine describe_availability_zones: not called CC=1 SCAR=6.9
Pod undocumented
76 0 my %args = $self->args('-zone_name',@_);
77 0 my @params = $self->list_parm('ZoneName',\%args);
78 0 push @params,$self->filter_parm(\%args);
79 0 return $self->call('DescribeAvailabilityZones',@params);
80 }
81  
82 =head1 SEE ALSO
83  
84 L<VM::EC2>
85  
86 =head1 AUTHOR
87  
88 Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>.
89  
90 Copyright (c) 2011 Ontario Institute for Cancer Research
91  
92 This package and its accompanying libraries is free software; you can
93 redistribute it and/or modify it under the terms of the GPL (either
94 version 1, or at your option, any later version) or the Artistic
95 License 2.0. Refer to LICENSE for the full license text. In addition,
96 please see DISCLAIMER.txt for disclaimers of warranty.
97  
98 =cut
99  
100  
101 7 1;
« lib/VM/EC2/Error.pm ↑ Summary lib/VM/EC2/REST/monitoring.pm »