1package Net::Amazon::EC2::RunningInstances; 2$Net::Amazon::EC2::RunningInstances::VERSION = '0.36'; 3use Moose; 4 5=head1 NAME 6 7Net::Amazon::EC2::RunningInstances 8 9=head1 DESCRIPTION 10 11A class representing a running instance. 12 13=head1 ATTRIBUTES 14 15=over 16 17=item ami_launch_index (optional) 18 19The AMI launch index, which can be used to find 20this instance within the launch group. 21 22=item dns_name (optional) 23 24The public DNS name assigned to the instance. This DNS 25name is contactable from outside the Amazon EC2 network. 26This element remains empty until the instance enters a 27running state. 28 29=item image_id (required) 30 31The image id of the AMI currently running in this instance. 32 33=item kernel_id (required) 34 35The kernel id of the AKI currently running in this instance. 36 37=item ramdisk_id (required) 38 39The ramdisk id of the ARI loaded in this instance. 40 41=item instance_id (required) 42 43The instance id of the launched instance. 44 45=item instance_state (required) 46 47An Net::Amazon::EC2::InstanceState object. 48 49=item instance_type (required) 50 51The type of instance launched. 52 53=item key_name (optional) 54 55The key pair name the instance was launched with. 56 57=item launch_time (required) 58 59The time the instance was started. 60 61=item placement (required) 62 63A Net::Amazon::EC2::PlacementResponse object. 64 65=item private_dns_name (optional) 66 67The private DNS name assigned to the instance. This DNS 68name can only be used inside the Amazon EC2 network. 69This element remains empty until the instance enters a 70running state. 71 72=item product_codes (optional) 73 74An array ref of Net::Amazon::EC2::ProductCode objects. 75 76=item reason (optional) 77 78The reason for the most recent state transition. 79 80=item platform (optional) 81 82The operating system for this instance. 83 84=item monitoring (optional) 85 86The state of monitoring on this instance. 87 88=item subnet_id (optional) 89 90Specifies the subnet ID in which the instance is running (Amazon Virtual Private Cloud). 91 92=item vpc_id (optional) 93 94Specifies the VPC in which the instance is running (Amazon Virtual Private Cloud). 95 96=item private_ip_address (optional) 97 98Specifies the private IP address that is assigned to the instance (Amazon VPC). 99 100=item ip_address (optional) 101 102Specifies the IP address of the instance. 103 104=item state_reason (optional) 105 106The reason for the state change. 107 108A Net::Amazon::EC2::StateReason object. 109 110=item architecture (optional) 111 112The architecture of the image. 113 114=item root_device_name (optional) 115 116The root device name (e.g., /dev/sda1). 117 118=item root_device_type (optional) 119 120The root device type used by the AMI. The AMI can use an Amazon EBS or instance store root device. 121 122=item block_device_mapping (optional) 123 124An array ref of Net::Amazon::EC2::BlockDeviceMapping objects. 125 126=item tag_set (optional) 127 128An array ref of Net::Amazon::EC2::TagSet objects. 129 130=item name (optional) 131 132The instance name from tags. 133 134=cut 135 136has 'ami_launch_index' => ( is => 'ro', isa => 'Str', required => 0 ); 137has 'dns_name' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 138has 'image_id' => ( is => 'ro', isa => 'Str', required => 1 ); 139has 'kernel_id' => ( is => 'ro', isa => 'Maybe[Str]', required => 1 ); 140has 'ramdisk_id' => ( is => 'ro', isa => 'Maybe[Str]', required => 1 ); 141has 'instance_id' => ( is => 'ro', isa => 'Str', required => 1 ); 142has 'instance_state' => ( 143 is => 'ro', 144 isa => 'Net::Amazon::EC2::InstanceState', 145 required => 1 146); 147has 'instance_type' => ( is => 'ro', isa => 'Str', required => 1 ); 148has 'key_name' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 149has 'launch_time' => ( is => 'ro', isa => 'Str', required => 1 ); 150has 'placement' => ( is => 'ro', isa => 'Net::Amazon::EC2::PlacementResponse', required => 1 ); 151has 'private_dns_name' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 152has 'product_codes' => ( 153 is => 'rw', 154 isa => 'ArrayRef[Net::Amazon::EC2::ProductCode]', 155 auto_deref => 1, 156 required => 0, 157); 158has 'reason' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 159has 'platform' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 160has 'monitoring' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 161has 'subnet_id' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 162has 'vpc_id' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 163has 'private_ip_address' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 164has 'ip_address' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 165has 'state_reason' => ( is => 'ro', isa => 'Maybe[Net::Amazon::EC2::StateReason]', required => 0 ); 166has 'architecture' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 167has 'root_device_name' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 168has 'root_device_type' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); 169has 'block_device_mapping' => ( is => 'ro', isa => 'Maybe[ArrayRef[Net::Amazon::EC2::BlockDeviceMapping]]', required => 0 ); 170has 'network_interface_set' => ( is => 'ro', isa => 'Maybe[ArrayRef[Net::Amazon::EC2::NetworkInterfaceSet]]', required => 0 ); 171has 'tag_set' => ( is => 'ro', isa => 'Maybe[ArrayRef[Net::Amazon::EC2::TagSet]]', required => 0 ); 172has 'name' => ( 173 is => 'ro', 174 lazy => 1, 175 default => sub { 176 my $self = shift; 177 return '' if !$self->tag_set || scalar @{$self->tag_set} == 0; 178 my $name = (grep {$_->{key} eq 'Name'} @{$self->tag_set})[0]; 179 return $name->{value} || ''; 180 }, 181); 182 183 184__PACKAGE__->meta->make_immutable(); 185 186=back 187 188=head1 AUTHOR 189 190Jeff Kim <cpan@chosec.com> 191 192=head1 COPYRIGHT 193 194Copyright (c) 2006-2010 Jeff Kim. This program is free software; you can redistribute it and/or modify it 195under the same terms as Perl itself. 196 197=cut 198 199no Moose; 2001; 201