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