« blib/lib/VM/EC2/ELB/Attributes/CrossZoneLoadBalancing.pm
↑ Summary
blib/lib/VM/EC2/ELB/HealthCheck.pm »
| 1 | package VM::EC2::ELB::BackendServerDescription; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::ELB:BackendServerDescription - Load Balancer Backend Server Description | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | |||
| 11 | my $ec2 = VM::EC2->new(...); | ||
| 12 | my $lb = $ec2->describe_load_balancers('my-lb'); | ||
| 13 | my @descs = $lb->BackendServerDescriptions; | ||
| 14 | foreach my $desc (@descs) { | ||
| 15 | print $desc->InstancePort,":\n"; | ||
| 16 | foreach ($desc->PolicyNames) { | ||
| 17 | print $_,"\n"; | ||
| 18 | } | ||
| 19 | |||
| 20 | } | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | This object is used to describe the BackendServerDescription data type, which is | ||
| 25 | one of the response elements of the DescribeLoadBalancers API call. | ||
| 26 | |||
| 27 | =head1 METHODS | ||
| 28 | |||
| 29 | The following object methods are supported: | ||
| 30 | |||
| 31 | InstancePort -- Returns the port on which the back-end server is listening. | ||
| 32 | PolicyNames -- Returns an array of policy names enabled for the back-end | ||
| 33 | server. | ||
| 34 | |||
| 35 | =head1 STRING OVERLOADING | ||
| 36 | |||
| 37 | NONE. | ||
| 38 | |||
| 39 | =head1 SEE ALSO | ||
| 40 | |||
| 41 | L<VM::EC2> | ||
| 42 | L<VM::EC2::Generic> | ||
| 43 | L<VM::EC2::Listener> | ||
| 44 | |||
| 45 | =head1 AUTHOR | ||
| 46 | |||
| 47 | Lance Kinley E>lb>lkinley@loyaltymethods.comE>gt>. | ||
| 48 | |||
| 49 | Copyright (c) 2012 Loyalty Methods, Inc. | ||
| 50 | |||
| 51 | This package and its accompanying libraries is free software; you can | ||
| 52 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 53 | version 1, or at your option, any later version) or the Artistic | ||
| 54 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 55 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | use strict; | ||
| 60 | use base 'VM::EC2::Generic'; | ||
| 61 | |||
| 62 | sub valid_fields { | ||
| 63 | my $self = shift; | ||
| 64 | return qw(InstancePort PolicyNames); | ||
| 65 | } | ||
| 66 | |||
| 67 | sub PolicyNames { | ||
| 68 | my $self = shift; | ||
| 69 | my $policies = $self->SUPER::PolicyNames or return; | ||
| 70 | return @{$policies->{member}}; | ||
| 71 | } | ||
| 72 | |||
| 73 | 1; |