blib/lib/VM/EC2/VPC/NetworkAcl/Association.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 33 CC 1 SCAR 6.9
CC
1
Cov
0%
primary_id
2.0
valid_fields
2.0
network_acl
2.0
CRAP 2.0
1 package VM::EC2::VPC::NetworkAcl::Association;
2  
3 =head1 NAME
4  
5 VM::EC2::VPC::NetworkAcl::Association - The association between a network acl
6 and a subnet
7  
8 =head1 SYNOPSIS
9  
10 use VM::EC2;
11  
12 my $ec2 = VM::EC2->new(...);
13 my $acl = $ec2->describe_network_acls(-network_acl_id=>'acl-12345678');
14 my @assoc = $acl->associations;
15  
16 foreach my $a (@assoc) {
17 print $a->networkAclAssociationId,"\n",
18 $a->networkAclId,"\n",
19 $a->subnetId,"\n";
20 }
21  
22 =head1 DESCRIPTION
23  
24 This object represents an Amazon EC2 VPC network ACL association
25  
26 =head1 METHODS
27  
28 These object methods are supported:
29  
30 networkAclAssociationId -- An identifier representing the
31 association between a network ACL
32 and a subnet.
33 networkAclId -- The ID of the network ACL in the
34 association.
35 subnetId -- The ID of the subnet in the association.
36  
37 The following convenience methods are supported:
38  
39 network_acl -- A VM::EC2::VPC::NetworkAcl object
40  
41 subnet -- A VM::EC2::VPC::Subnet object
42  
43 The object also supports the tags() method described in
44 L<VM::EC2::Generic>:
45  
46 =head1 STRING OVERLOADING
47  
48 When used in a string context, this object will interpolate the
49 subnetId.
50  
51 =head1 SEE ALSO
52  
53 L<VM::EC2>
54 L<VM::EC2::Generic>
55 L<VM::EC2::Tag>
56 L<VM::EC2::VPC>
57 L<VM::EC2::VPC::NetworkAcl>
58 L<VM::EC2::VPC::Subnet>
59  
60 =head1 AUTHOR
61  
62 Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.
63  
64 Copyright (c) 2012 Loyalty Methods, Inc.
65  
66 This package and its accompanying libraries is free software; you can
67 redistribute it and/or modify it under the terms of the GPL (either
68 version 1, or at your option, any later version) or the Artistic
69 License 2.0. Refer to LICENSE for the full license text. In addition,
70 please see DISCLAIMER.txt for disclaimers of warranty.
71  
72 =cut
73  
74 use strict;
75 use base 'VM::EC2::Generic';
76 use Carp 'croak';
77  
78 sub primary_id { shift->subnetId }
79  
80 sub valid_fields {
81 my $self = shift;
82 return qw(networkAclAssociationId networkAclId subnetId);
83 }
84  
85 sub network_acl {
86 my $self = shift;
87 my $acl = $self->networkAclId or return;
88 return $self->aws->describe_network_acls($acl);
89 }
90  
91 sub subnet {
92 my $self = shift;
93 my $sn = $self->subnetId or return;
94 return $self->aws->describe_subnets($sn);
95 }
96  
97 1;
98