blib/lib/VM/EC2/ELB/Policies.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 46 CC 1 SCAR 6.9
CC
1
Cov
0%
valid_fields
2.0
AppCookieStickinessPolicies
2.0
LBCookieStickinessPolicies
2.0
CRAP 2.0
1 package VM::EC2::ELB::Policies;
2  
3 =head1 NAME
4  
5 VM::EC2::ELB:Policies - Elastic Load Balancer Policies
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 $p = $lb->Policies;
14 my @lb_policies = $p->LBCookieStickinessPolicies;
15 my @app_policies = $p->AppCookieStickinessPolicies;
16 my @other_policies = $p->OtherPolicies;
17  
18 =head1 DESCRIPTION
19  
20 This object is used to describe the policies that are attached to an Elastic
21 Load Balancer, segregated by type. To more easily obtain a full list of
22 policies associated with the ELB, used the VM::EC2->describe_load_balancers()
23 method.
24  
25 =head1 METHODS
26  
27 The following object methods are supported:
28
29 AppCookieStickinessPolicies -- Application-based cookie stickiness policies
30 LBCookieStickinessPolicies -- Load Balancer-based cookie stickiness policies
31 OtherPolicies -- Other Policies
32  
33 =head1 STRING OVERLOADING
34  
35 NONE.
36  
37 =head1 SEE ALSO
38  
39 L<VM::EC2>
40 L<VM::EC2::Generic>
41 L<VM::EC2::ELB>
42  
43 =head1 AUTHOR
44  
45 Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.
46  
47 Copyright (c) 2012 Loyalty Methods, Inc.
48  
49 This package and its accompanying libraries is free software; you can
50 redistribute it and/or modify it under the terms of the GPL (either
51 version 1, or at your option, any later version) or the Artistic
52 License 2.0. Refer to LICENSE for the full license text. In addition,
53 please see DISCLAIMER.txt for disclaimers of warranty.
54  
55 =cut
56  
57 use strict;
58 use base 'VM::EC2::Generic';
59 use VM::EC2::ELB::Policies::AppCookieStickinessPolicy;
60 use VM::EC2::ELB::Policies::LBCookieStickinessPolicy;
61  
62 sub valid_fields {
63 my $self = shift;
64 return qw(AppCookieStickinessPolicies OtherPolicies LBCookieStickinessPolicies);
65 }
66  
67 sub AppCookieStickinessPolicies {
68 my $self = shift;
69 my $acsp = $self->SUPER::AppCookieStickinessPolicies or return;
70 return map { VM::EC2::ELB::Policies::AppCookieStickinessPolicy->new($_,$self->aws) } @{$acsp->{member}};
71 }
72  
73 sub LBCookieStickinessPolicies {
74 my $self = shift;
75 my $lbcsp = $self->SUPER::LBCookieStickinessPolicies or return;
76 return map { VM::EC2::ELB::Policies::LBCookieStickinessPolicy->new($_,$self->aws) } @{$lbcsp->{member}};
77 }
78  
79 sub OtherPolicies {
80 my $self = shift;
81 my $op = $self->SUPER::OtherPolicies or return;
82 return @{$op->{member}};
83 }
84  
85 1;