aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-ec2.rb +2 -2
- data/lib/aws-sdk-ec2/classic_address.rb +198 -200
- data/lib/aws-sdk-ec2/client.rb +17169 -14563
- data/lib/aws-sdk-ec2/client_api.rb +6458 -6301
- data/lib/aws-sdk-ec2/dhcp_options.rb +158 -160
- data/lib/aws-sdk-ec2/errors.rb +4 -13
- data/lib/aws-sdk-ec2/image.rb +404 -406
- data/lib/aws-sdk-ec2/instance.rb +1423 -1422
- data/lib/aws-sdk-ec2/internet_gateway.rb +178 -180
- data/lib/aws-sdk-ec2/key_pair.rb +98 -100
- data/lib/aws-sdk-ec2/key_pair_info.rb +102 -104
- data/lib/aws-sdk-ec2/network_acl.rb +326 -328
- data/lib/aws-sdk-ec2/network_interface.rb +428 -430
- data/lib/aws-sdk-ec2/network_interface_association.rb +126 -128
- data/lib/aws-sdk-ec2/placement_group.rb +400 -399
- data/lib/aws-sdk-ec2/resource.rb +2696 -2659
- data/lib/aws-sdk-ec2/route.rb +229 -231
- data/lib/aws-sdk-ec2/route_table.rb +243 -245
- data/lib/aws-sdk-ec2/route_table_association.rb +148 -150
- data/lib/aws-sdk-ec2/security_group.rb +515 -517
- data/lib/aws-sdk-ec2/snapshot.rb +431 -433
- data/lib/aws-sdk-ec2/subnet.rb +981 -977
- data/lib/aws-sdk-ec2/tag.rb +185 -187
- data/lib/aws-sdk-ec2/types.rb +24081 -20965
- data/lib/aws-sdk-ec2/volume.rb +513 -512
- data/lib/aws-sdk-ec2/vpc.rb +1671 -1649
- data/lib/aws-sdk-ec2/vpc_address.rb +189 -191
- data/lib/aws-sdk-ec2/vpc_peering_connection.rb +219 -221
- data/lib/aws-sdk-ec2/waiters.rb +1252 -1210
- metadata +2 -2
@@ -1,151 +1,149 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::EC2
|
9
|
+
class NetworkInterfaceAssociation
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(id, options = {})
|
14
|
+
# @param [String] id
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :id
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@id = extract_id(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
# The public IP address or Elastic IP address bound to the network
|
34
|
+
# interface.
|
35
|
+
# @return [String]
|
36
|
+
def public_ip
|
37
|
+
data.public_ip
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The public DNS name.
|
41
|
+
# @return [String]
|
42
|
+
def public_dns_name
|
43
|
+
data.public_dns_name
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The ID of the owner of the Elastic IP address.
|
47
|
+
# @return [String]
|
48
|
+
def ip_owner_id
|
49
|
+
data.ip_owner_id
|
50
|
+
end
|
52
51
|
|
53
|
-
|
52
|
+
# @!endgroup
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
# @return [Client]
|
55
|
+
def client
|
56
|
+
@client
|
57
|
+
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
59
|
+
# Loads, or reloads {#data} for the current {NetworkInterfaceAssociation}.
|
60
|
+
# Returns `self` making it possible to chain methods.
|
61
|
+
#
|
62
|
+
# network_interface_association.reload.data
|
63
|
+
#
|
64
|
+
# @return [self]
|
65
|
+
def load
|
66
|
+
resp = @client.describe_network_interfaces(filters: [{
|
67
|
+
name: "association.association-id",
|
68
|
+
values: [@id]
|
69
|
+
}])
|
70
|
+
@data = resp.networkinterfaces[0].association
|
71
|
+
self
|
72
|
+
end
|
73
|
+
alias :reload :load
|
74
|
+
|
75
|
+
# @return [Types::InstanceNetworkInterfaceAssociation]
|
76
|
+
# Returns the data for this {NetworkInterfaceAssociation}. Calls
|
77
|
+
# {Client#describe_network_interfaces} if {#data_loaded?} is `false`.
|
78
|
+
def data
|
79
|
+
load unless @data
|
80
|
+
@data
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
# @return [Boolean]
|
84
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
85
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
86
|
+
def data_loaded?
|
87
|
+
!!@data
|
88
|
+
end
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
90
|
+
# @!group Actions
|
91
|
+
|
92
|
+
# @example Request syntax with placeholder values
|
93
|
+
#
|
94
|
+
# network_interface_association.delete({
|
95
|
+
# dry_run: false,
|
96
|
+
# public_ip: "String",
|
97
|
+
# })
|
98
|
+
# @param [Hash] options ({})
|
99
|
+
# @option options [Boolean] :dry_run
|
100
|
+
# Checks whether you have the required permissions for the action,
|
101
|
+
# without actually making the request, and provides an error response.
|
102
|
+
# If you have the required permissions, the error response is
|
103
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
104
|
+
# @option options [String] :public_ip
|
105
|
+
# \[EC2-Classic\] The Elastic IP address. Required for EC2-Classic.
|
106
|
+
# @return [EmptyStructure]
|
107
|
+
def delete(options = {})
|
108
|
+
options = options.merge(association_id: @id)
|
109
|
+
resp = @client.disassociate_address(options)
|
110
|
+
resp.data
|
111
|
+
end
|
113
112
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
end
|
113
|
+
# @!group Associations
|
114
|
+
|
115
|
+
# @return [VpcAddress, nil]
|
116
|
+
def address
|
117
|
+
if data.allocation_id
|
118
|
+
VpcAddress.new(
|
119
|
+
allocation_id: data.allocation_id,
|
120
|
+
client: @client
|
121
|
+
)
|
122
|
+
else
|
123
|
+
nil
|
126
124
|
end
|
125
|
+
end
|
127
126
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
end
|
127
|
+
# @deprecated
|
128
|
+
# @api private
|
129
|
+
def identifiers
|
130
|
+
{ id: @id }
|
131
|
+
end
|
132
|
+
deprecated(:identifiers)
|
133
|
+
|
134
|
+
private
|
135
|
+
|
136
|
+
def extract_id(args, options)
|
137
|
+
value = args[0] || options.delete(:id)
|
138
|
+
case value
|
139
|
+
when String then value
|
140
|
+
when nil then raise ArgumentError, "missing required option :id"
|
141
|
+
else
|
142
|
+
msg = "expected :id to be a String, got #{value.class}"
|
143
|
+
raise ArgumentError, msg
|
146
144
|
end
|
147
|
-
|
148
|
-
class Collection < Aws::Resources::Collection; end
|
149
145
|
end
|
146
|
+
|
147
|
+
class Collection < Aws::Resources::Collection; end
|
150
148
|
end
|
151
149
|
end
|
@@ -1,431 +1,432 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class PlacementGroup
|
8
|
+
module Aws::EC2
|
9
|
+
class PlacementGroup
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
# @overload def initialize(name, options = {})
|
14
|
+
# @param [String] name
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :name
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@name = extract_name(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def name
|
30
|
+
@name
|
31
|
+
end
|
32
|
+
alias :group_name :name
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The placement strategy.
|
35
|
+
# @return [String]
|
36
|
+
def strategy
|
37
|
+
data.strategy
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The state of the placement group.
|
41
|
+
# @return [String]
|
42
|
+
def state
|
43
|
+
data.state
|
44
|
+
end
|
46
45
|
|
47
|
-
|
46
|
+
# @!endgroup
|
48
47
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
# @return [Client]
|
49
|
+
def client
|
50
|
+
@client
|
51
|
+
end
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
53
|
+
# Loads, or reloads {#data} for the current {PlacementGroup}.
|
54
|
+
# Returns `self` making it possible to chain methods.
|
55
|
+
#
|
56
|
+
# placement_group.reload.data
|
57
|
+
#
|
58
|
+
# @return [self]
|
59
|
+
def load
|
60
|
+
resp = @client.describe_placement_groups(group_names: [@name])
|
61
|
+
@data = resp.placementgroups[0]
|
62
|
+
self
|
63
|
+
end
|
64
|
+
alias :reload :load
|
66
65
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
# @return [Types::PlacementGroup]
|
67
|
+
# Returns the data for this {PlacementGroup}. Calls
|
68
|
+
# {Client#describe_placement_groups} if {#data_loaded?} is `false`.
|
69
|
+
def data
|
70
|
+
load unless @data
|
71
|
+
@data
|
72
|
+
end
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
74
|
+
# @return [Boolean]
|
75
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
76
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
77
|
+
def data_loaded?
|
78
|
+
!!@data
|
79
|
+
end
|
81
80
|
|
82
|
-
|
81
|
+
# @!group Actions
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
83
|
+
# @example Request syntax with placeholder values
|
84
|
+
#
|
85
|
+
# placement_group.delete({
|
86
|
+
# dry_run: false,
|
87
|
+
# })
|
88
|
+
# @param [Hash] options ({})
|
89
|
+
# @option options [Boolean] :dry_run
|
90
|
+
# Checks whether you have the required permissions for the action,
|
91
|
+
# without actually making the request, and provides an error response.
|
92
|
+
# If you have the required permissions, the error response is
|
93
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
94
|
+
# @return [EmptyStructure]
|
95
|
+
def delete(options = {})
|
96
|
+
options = options.merge(group_name: @name)
|
97
|
+
resp = @client.delete_placement_group(options)
|
98
|
+
resp.data
|
99
|
+
end
|
101
100
|
|
102
|
-
|
101
|
+
# @!group Associations
|
103
102
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
103
|
+
# @example Request syntax with placeholder values
|
104
|
+
#
|
105
|
+
# instances = placement_group.instances({
|
106
|
+
# dry_run: false,
|
107
|
+
# instance_ids: ["String"],
|
108
|
+
# filters: [
|
109
|
+
# {
|
110
|
+
# name: "String",
|
111
|
+
# values: ["String"],
|
112
|
+
# },
|
113
|
+
# ],
|
114
|
+
# })
|
115
|
+
# @param [Hash] options ({})
|
116
|
+
# @option options [Boolean] :dry_run
|
117
|
+
# Checks whether you have the required permissions for the action,
|
118
|
+
# without actually making the request, and provides an error response.
|
119
|
+
# If you have the required permissions, the error response is
|
120
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
121
|
+
# @option options [Array<String>] :instance_ids
|
122
|
+
# One or more instance IDs.
|
123
|
+
#
|
124
|
+
# Default: Describes all your instances.
|
125
|
+
# @option options [Array<Types::Filter>] :filters
|
126
|
+
# One or more filters.
|
127
|
+
#
|
128
|
+
# * `affinity` - The affinity setting for an instance running on a
|
129
|
+
# Dedicated Host (`default` \| `host`).
|
130
|
+
#
|
131
|
+
# * `architecture` - The instance architecture (`i386` \| `x86_64`).
|
132
|
+
#
|
133
|
+
# * `association.public-ip` - The address of the Elastic IP address
|
134
|
+
# (IPv4) bound to the network interface.
|
135
|
+
#
|
136
|
+
# * `association.ip-owner-id` - The owner of the Elastic IP address
|
137
|
+
# (IPv4) associated with the network interface.
|
138
|
+
#
|
139
|
+
# * `association.allocation-id` - The allocation ID returned when you
|
140
|
+
# allocated the Elastic IP address (IPv4) for your network interface.
|
141
|
+
#
|
142
|
+
# * `association.association-id` - The association ID returned when the
|
143
|
+
# network interface was associated with an IPv4 address.
|
144
|
+
#
|
145
|
+
# * `availability-zone` - The Availability Zone of the instance.
|
146
|
+
#
|
147
|
+
# * `block-device-mapping.attach-time` - The attach time for an EBS
|
148
|
+
# volume mapped to the instance, for example,
|
149
|
+
# `2010-09-15T17:15:20.000Z`.
|
150
|
+
#
|
151
|
+
# * `block-device-mapping.delete-on-termination` - A Boolean that
|
152
|
+
# indicates whether the EBS volume is deleted on instance termination.
|
153
|
+
#
|
154
|
+
# * `block-device-mapping.device-name` - The device name for the EBS
|
155
|
+
# volume (for example, `/dev/sdh` or `xvdh`).
|
156
|
+
#
|
157
|
+
# * `block-device-mapping.status` - The status for the EBS volume
|
158
|
+
# (`attaching` \| `attached` \| `detaching` \| `detached`).
|
159
|
+
#
|
160
|
+
# * `block-device-mapping.volume-id` - The volume ID of the EBS volume.
|
161
|
+
#
|
162
|
+
# * `client-token` - The idempotency token you provided when you
|
163
|
+
# launched the instance.
|
164
|
+
#
|
165
|
+
# * `dns-name` - The public DNS name of the instance.
|
166
|
+
#
|
167
|
+
# * `group-id` - The ID of the security group for the instance.
|
168
|
+
# EC2-Classic only.
|
169
|
+
#
|
170
|
+
# * `group-name` - The name of the security group for the instance.
|
171
|
+
# EC2-Classic only.
|
172
|
+
#
|
173
|
+
# * `host-id` - The ID of the Dedicated Host on which the instance is
|
174
|
+
# running, if applicable.
|
175
|
+
#
|
176
|
+
# * `hypervisor` - The hypervisor type of the instance (`ovm` \| `xen`).
|
177
|
+
#
|
178
|
+
# * `iam-instance-profile.arn` - The instance profile associated with
|
179
|
+
# the instance. Specified as an ARN.
|
180
|
+
#
|
181
|
+
# * `image-id` - The ID of the image used to launch the instance.
|
182
|
+
#
|
183
|
+
# * `instance-id` - The ID of the instance.
|
184
|
+
#
|
185
|
+
# * `instance-lifecycle` - Indicates whether this is a Spot Instance or
|
186
|
+
# a Scheduled Instance (`spot` \| `scheduled`).
|
187
|
+
#
|
188
|
+
# * `instance-state-code` - The state of the instance, as a 16-bit
|
189
|
+
# unsigned integer. The high byte is an opaque internal value and
|
190
|
+
# should be ignored. The low byte is set based on the state
|
191
|
+
# represented. The valid values are: 0 (pending), 16 (running), 32
|
192
|
+
# (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).
|
193
|
+
#
|
194
|
+
# * `instance-state-name` - The state of the instance (`pending` \|
|
195
|
+
# `running` \| `shutting-down` \| `terminated` \| `stopping` \|
|
196
|
+
# `stopped`).
|
197
|
+
#
|
198
|
+
# * `instance-type` - The type of instance (for example, `t2.micro`).
|
199
|
+
#
|
200
|
+
# * `instance.group-id` - The ID of the security group for the instance.
|
201
|
+
#
|
202
|
+
# * `instance.group-name` - The name of the security group for the
|
203
|
+
# instance.
|
204
|
+
#
|
205
|
+
# * `ip-address` - The public IPv4 address of the instance.
|
206
|
+
#
|
207
|
+
# * `kernel-id` - The kernel ID.
|
208
|
+
#
|
209
|
+
# * `key-name` - The name of the key pair used when the instance was
|
210
|
+
# launched.
|
211
|
+
#
|
212
|
+
# * `launch-index` - When launching multiple instances, this is the
|
213
|
+
# index for the instance in the launch group (for example, 0, 1, 2,
|
214
|
+
# and so on).
|
215
|
+
#
|
216
|
+
# * `launch-time` - The time when the instance was launched.
|
217
|
+
#
|
218
|
+
# * `monitoring-state` - Indicates whether detailed monitoring is
|
219
|
+
# enabled (`disabled` \| `enabled`).
|
220
|
+
#
|
221
|
+
# * `network-interface.addresses.private-ip-address` - The private IPv4
|
222
|
+
# address associated with the network interface.
|
223
|
+
#
|
224
|
+
# * `network-interface.addresses.primary` - Specifies whether the IPv4
|
225
|
+
# address of the network interface is the primary private IPv4
|
226
|
+
# address.
|
227
|
+
#
|
228
|
+
# * `network-interface.addresses.association.public-ip` - The ID of the
|
229
|
+
# association of an Elastic IP address (IPv4) with a network
|
230
|
+
# interface.
|
231
|
+
#
|
232
|
+
# * `network-interface.addresses.association.ip-owner-id` - The owner ID
|
233
|
+
# of the private IPv4 address associated with the network interface.
|
234
|
+
#
|
235
|
+
# * `network-interface.attachment.attachment-id` - The ID of the
|
236
|
+
# interface attachment.
|
237
|
+
#
|
238
|
+
# * `network-interface.attachment.instance-id` - The ID of the instance
|
239
|
+
# to which the network interface is attached.
|
240
|
+
#
|
241
|
+
# * `network-interface.attachment.instance-owner-id` - The owner ID of
|
242
|
+
# the instance to which the network interface is attached.
|
243
|
+
#
|
244
|
+
# * `network-interface.attachment.device-index` - The device index to
|
245
|
+
# which the network interface is attached.
|
246
|
+
#
|
247
|
+
# * `network-interface.attachment.status` - The status of the attachment
|
248
|
+
# (`attaching` \| `attached` \| `detaching` \| `detached`).
|
249
|
+
#
|
250
|
+
# * `network-interface.attachment.attach-time` - The time that the
|
251
|
+
# network interface was attached to an instance.
|
252
|
+
#
|
253
|
+
# * `network-interface.attachment.delete-on-termination` - Specifies
|
254
|
+
# whether the attachment is deleted when an instance is terminated.
|
255
|
+
#
|
256
|
+
# * `network-interface.availability-zone` - The Availability Zone for
|
257
|
+
# the network interface.
|
258
|
+
#
|
259
|
+
# * `network-interface.description` - The description of the network
|
260
|
+
# interface.
|
261
|
+
#
|
262
|
+
# * `network-interface.group-id` - The ID of a security group associated
|
263
|
+
# with the network interface.
|
264
|
+
#
|
265
|
+
# * `network-interface.group-name` - The name of a security group
|
266
|
+
# associated with the network interface.
|
267
|
+
#
|
268
|
+
# * `network-interface.ipv6-addresses.ipv6-address` - The IPv6 address
|
269
|
+
# associated with the network interface.
|
270
|
+
#
|
271
|
+
# * `network-interface.mac-address` - The MAC address of the network
|
272
|
+
# interface.
|
273
|
+
#
|
274
|
+
# * `network-interface.network-interface-id` - The ID of the network
|
275
|
+
# interface.
|
276
|
+
#
|
277
|
+
# * `network-interface.owner-id` - The ID of the owner of the network
|
278
|
+
# interface.
|
279
|
+
#
|
280
|
+
# * `network-interface.private-dns-name` - The private DNS name of the
|
281
|
+
# network interface.
|
282
|
+
#
|
283
|
+
# * `network-interface.requester-id` - The requester ID for the network
|
284
|
+
# interface.
|
285
|
+
#
|
286
|
+
# * `network-interface.requester-managed` - Indicates whether the
|
287
|
+
# network interface is being managed by AWS.
|
288
|
+
#
|
289
|
+
# * `network-interface.status` - The status of the network interface
|
290
|
+
# (`available`) \| `in-use`).
|
291
|
+
#
|
292
|
+
# * `network-interface.source-dest-check` - Whether the network
|
293
|
+
# interface performs source/destination checking. A value of `true`
|
294
|
+
# means checking is enabled, and `false` means checking is disabled.
|
295
|
+
# The value must be `false` for the network interface to perform
|
296
|
+
# network address translation (NAT) in your VPC.
|
297
|
+
#
|
298
|
+
# * `network-interface.subnet-id` - The ID of the subnet for the network
|
299
|
+
# interface.
|
300
|
+
#
|
301
|
+
# * `network-interface.vpc-id` - The ID of the VPC for the network
|
302
|
+
# interface.
|
303
|
+
#
|
304
|
+
# * `owner-id` - The AWS account ID of the instance owner.
|
305
|
+
#
|
306
|
+
# * `placement-group-name` - The name of the placement group for the
|
307
|
+
# instance.
|
308
|
+
#
|
309
|
+
# * `platform` - The platform. Use `windows` if you have Windows
|
310
|
+
# instances; otherwise, leave blank.
|
311
|
+
#
|
312
|
+
# * `private-dns-name` - The private IPv4 DNS name of the instance.
|
313
|
+
#
|
314
|
+
# * `private-ip-address` - The private IPv4 address of the instance.
|
315
|
+
#
|
316
|
+
# * `product-code` - The product code associated with the AMI used to
|
317
|
+
# launch the instance.
|
318
|
+
#
|
319
|
+
# * `product-code.type` - The type of product code (`devpay` \|
|
320
|
+
# `marketplace`).
|
321
|
+
#
|
322
|
+
# * `ramdisk-id` - The RAM disk ID.
|
323
|
+
#
|
324
|
+
# * `reason` - The reason for the current state of the instance (for
|
325
|
+
# example, shows "User Initiated \[date\]" when you stop or
|
326
|
+
# terminate the instance). Similar to the state-reason-code filter.
|
327
|
+
#
|
328
|
+
# * `requester-id` - The ID of the entity that launched the instance on
|
329
|
+
# your behalf (for example, AWS Management Console, Auto Scaling, and
|
330
|
+
# so on).
|
331
|
+
#
|
332
|
+
# * `reservation-id` - The ID of the instance's reservation. A
|
333
|
+
# reservation ID is created any time you launch an instance. A
|
334
|
+
# reservation ID has a one-to-one relationship with an instance launch
|
335
|
+
# request, but can be associated with more than one instance if you
|
336
|
+
# launch multiple instances using the same launch request. For
|
337
|
+
# example, if you launch one instance, you'll get one reservation ID.
|
338
|
+
# If you launch ten instances using the same launch request, you'll
|
339
|
+
# also get one reservation ID.
|
340
|
+
#
|
341
|
+
# * `root-device-name` - The name of the root device for the instance
|
342
|
+
# (for example, `/dev/sda1` or `/dev/xvda`).
|
343
|
+
#
|
344
|
+
# * `root-device-type` - The type of root device that the instance uses
|
345
|
+
# (`ebs` \| `instance-store`).
|
346
|
+
#
|
347
|
+
# * `source-dest-check` - Indicates whether the instance performs
|
348
|
+
# source/destination checking. A value of `true` means that checking
|
349
|
+
# is enabled, and `false` means checking is disabled. The value must
|
350
|
+
# be `false` for the instance to perform network address translation
|
351
|
+
# (NAT) in your VPC.
|
352
|
+
#
|
353
|
+
# * `spot-instance-request-id` - The ID of the Spot instance request.
|
354
|
+
#
|
355
|
+
# * `state-reason-code` - The reason code for the state change.
|
356
|
+
#
|
357
|
+
# * `state-reason-message` - A message that describes the state change.
|
358
|
+
#
|
359
|
+
# * `subnet-id` - The ID of the subnet for the instance.
|
360
|
+
#
|
361
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
362
|
+
# to the resource. Specify the key of the tag in the filter name and
|
363
|
+
# the value of the tag in the filter value. For example, for the tag
|
364
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
365
|
+
# filter value.
|
366
|
+
#
|
367
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
368
|
+
# is independent of the `tag-value` filter. For example, if you use
|
369
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
370
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
371
|
+
# of what the tag's value is), and the tag value X (regardless of
|
372
|
+
# what the tag's key is). If you want to list only resources where
|
373
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
374
|
+
#
|
375
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
376
|
+
# filter is independent of the `tag-key` filter.
|
377
|
+
#
|
378
|
+
# * `tenancy` - The tenancy of an instance (`dedicated` \| `default` \|
|
379
|
+
# `host`).
|
380
|
+
#
|
381
|
+
# * `virtualization-type` - The virtualization type of the instance
|
382
|
+
# (`paravirtual` \| `hvm`).
|
383
|
+
#
|
384
|
+
# * `vpc-id` - The ID of the VPC that the instance is running in.
|
385
|
+
# @return [Instance::Collection]
|
386
|
+
def instances(options = {})
|
387
|
+
batches = Enumerator.new do |y|
|
388
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
389
|
+
name: "placement-group-name",
|
390
|
+
values: [@name]
|
391
|
+
}])
|
392
|
+
resp = @client.describe_instances(options)
|
393
|
+
resp.each_page do |page|
|
394
|
+
batch = []
|
395
|
+
page.data.reservations.each do |r|
|
396
|
+
r.instances.each do |i|
|
397
|
+
batch << Instance.new(
|
398
|
+
id: i.instance_id,
|
399
|
+
data: i,
|
400
|
+
client: @client
|
401
|
+
)
|
401
402
|
end
|
402
|
-
y.yield(batch)
|
403
403
|
end
|
404
|
+
y.yield(batch)
|
404
405
|
end
|
405
|
-
Instance::Collection.new(batches)
|
406
406
|
end
|
407
|
+
Instance::Collection.new(batches)
|
408
|
+
end
|
407
409
|
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
410
|
+
# @deprecated
|
411
|
+
# @api private
|
412
|
+
def identifiers
|
413
|
+
{ name: @name }
|
414
|
+
end
|
415
|
+
deprecated(:identifiers)
|
414
416
|
|
415
|
-
|
417
|
+
private
|
416
418
|
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
end
|
419
|
+
def extract_name(args, options)
|
420
|
+
value = args[0] || options.delete(:name)
|
421
|
+
case value
|
422
|
+
when String then value
|
423
|
+
when nil then raise ArgumentError, "missing required option :name"
|
424
|
+
else
|
425
|
+
msg = "expected :name to be a String, got #{value.class}"
|
426
|
+
raise ArgumentError, msg
|
426
427
|
end
|
427
|
-
|
428
|
-
class Collection < Aws::Resources::Collection; end
|
429
428
|
end
|
429
|
+
|
430
|
+
class Collection < Aws::Resources::Collection; end
|
430
431
|
end
|
431
432
|
end
|