| 1 | package VM::EC2::NetworkInterface::PrivateIpAddress; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::NetworkInterface::PrivateIpAddress | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | ... | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | Please see L<VM::EC2::Generic> for methods shared by all VM::EC2 | ||
| 15 | objects. | ||
| 16 | |||
| 17 | =head1 METHODS | ||
| 18 | |||
| 19 | These object methods are supported: | ||
| 20 | |||
| 21 | privateIpAddress | ||
| 22 | privateDnsName | ||
| 23 | primary | ||
| 24 | association | ||
| 25 | |||
| 26 | In addition, this object supports the following convenience methods: | ||
| 27 | |||
| 28 | =head1 STRING OVERLOADING | ||
| 29 | |||
| 30 | When used in a string context, this object will be interpolated as the | ||
| 31 | VPC ID. | ||
| 32 | |||
| 33 | =head1 SEE ALSO | ||
| 34 | |||
| 35 | L<VM::EC2> | ||
| 36 | L<VM::EC2::Generic> | ||
| 37 | |||
| 38 | =head1 AUTHOR | ||
| 39 | |||
| 40 | Lincoln Stein E<lt>lincoln.stein@gmail.comE<gt>. | ||
| 41 | |||
| 42 | Copyright (c) 2012 Ontario Institute for Cancer Research | ||
| 43 | |||
| 44 | This package and its accompanying libraries is free software; you can | ||
| 45 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 46 | version 1, or at your option, any later version) or the Artistic | ||
| 47 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 48 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | use strict; | ||
| 53 | use base 'VM::EC2::Generic'; | ||
| 54 | use VM::EC2::NetworkInterface::Association; | ||
| 55 | |||
| 56 | sub valid_fields { | ||
| 57 | my $self = shift; | ||
| 58 | return qw(privateIpAddress privateDnsName primary association); | ||
| 59 | } | ||
| 60 | |||
| 61 | sub primary { | ||
| 62 | my $self = shift; | ||
| 63 | my $p = $self->SUPER::primary; | ||
| 64 | return $p eq 'true'; | ||
| 65 | } | ||
| 66 | |||
| 67 | sub short_name { shift->privateIpAddress } | ||
| 68 | |||
| 69 | sub association { | ||
| 70 | my $self = shift; | ||
| 71 | my $ass = $self->SUPER::association; | ||
| 72 | return VM::EC2::NetworkInterface::Association->new($ass,$self->ec2); | ||
| 73 | } | ||
| 74 | |||
| 75 | 1; | ||
| 76 |