| 1 | package VM::EC2::DB::AvailabilityZone; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::DB::AvailabilityZone - An RDS Database Availability Zone | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | |||
| 11 | $ec2 = VM::EC2->new(...); | ||
| 12 | @options = $ec2->describe_orderable_db_instance_options(-engine => 'mysql'); | ||
| 13 | foreach $option (grep { $_->DBInstanceClass eq 'db.m2.4xlarge' } @options) { | ||
| 14 | foreach $zone (grep { $_->ProvisionedIopsCapable } $option->AvailabilityZones) { | ||
| 15 | print $option->Engine,' ',$option->EngineVersion,' ',$zone,"\n"; | ||
| 16 | } | ||
| 17 | } | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | This object represents an Availability Zone as part of an Orderable DB Instance | ||
| 22 | Option. Return as an element of a VM::EC2->describe_orderable_db_instance_options() | ||
| 23 | call. | ||
| 24 | |||
| 25 | =head1 STRING OVERLOADING | ||
| 26 | |||
| 27 | In string context, the object returns the Availability Zone name. | ||
| 28 | |||
| 29 | =head1 SEE ALSO | ||
| 30 | |||
| 31 | L<VM::EC2> | ||
| 32 | L<VM::EC2::Generic> | ||
| 33 | L<VM::EC2::DB::Instance> | ||
| 34 | |||
| 35 | =head1 AUTHOR | ||
| 36 | |||
| 37 | Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>. | ||
| 38 | |||
| 39 | Copyright (c) 2013 Loyalty Methods, Inc. | ||
| 40 | |||
| 41 | This package and its accompanying libraries is free software; you can | ||
| 42 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 43 | version 1, or at your option, any later version) or the Artistic | ||
| 44 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 45 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | use strict; | ||
| 50 | use base 'VM::EC2::Generic'; | ||
| 51 | |||
| 52 | use overload '""' => sub { shift->Name }, | ||
| 53 | fallback => 1; | ||
| 54 | |||
| 55 | sub valid_fields { | ||
| 56 | my $self = shift; | ||
| 57 | return qw(Name ProvisionedIopsCapable); | ||
| 58 | } | ||
| 59 | |||
| 60 | sub ProvisionedIopsCapable { | ||
| 61 | my $self = shift; | ||
| 62 | my $p = $self->SUPER::ProvisionedIopsCapable; | ||
| 63 | return $p eq 'true'; | ||
| 64 | } | ||
| 65 | |||
| 66 | 1; |