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,480 +1,478 @@
|
|
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 NetworkInterface
|
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
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :network_interface_id :id
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The ID of the subnet.
|
35
|
+
# @return [String]
|
36
|
+
def subnet_id
|
37
|
+
data.subnet_id
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The ID of the VPC.
|
41
|
+
# @return [String]
|
42
|
+
def vpc_id
|
43
|
+
data.vpc_id
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The Availability Zone.
|
47
|
+
# @return [String]
|
48
|
+
def availability_zone
|
49
|
+
data.availability_zone
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
# A description.
|
53
|
+
# @return [String]
|
54
|
+
def description
|
55
|
+
data.description
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
# The AWS account ID of the owner of the network interface.
|
59
|
+
# @return [String]
|
60
|
+
def owner_id
|
61
|
+
data.owner_id
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
64
|
+
# The ID of the entity that launched the instance on your behalf (for
|
65
|
+
# example, AWS Management Console or Auto Scaling).
|
66
|
+
# @return [String]
|
67
|
+
def requester_id
|
68
|
+
data.requester_id
|
69
|
+
end
|
71
70
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
# Indicates whether the network interface is being managed by AWS.
|
72
|
+
# @return [Boolean]
|
73
|
+
def requester_managed
|
74
|
+
data.requester_managed
|
75
|
+
end
|
77
76
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
# The status of the network interface.
|
78
|
+
# @return [String]
|
79
|
+
def status
|
80
|
+
data.status
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
# The MAC address.
|
84
|
+
# @return [String]
|
85
|
+
def mac_address
|
86
|
+
data.mac_address
|
87
|
+
end
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
# The IPv4 address of the network interface within the subnet.
|
90
|
+
# @return [String]
|
91
|
+
def private_ip_address
|
92
|
+
data.private_ip_address
|
93
|
+
end
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
95
|
+
# The private DNS name.
|
96
|
+
# @return [String]
|
97
|
+
def private_dns_name
|
98
|
+
data.private_dns_name
|
99
|
+
end
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
101
|
+
# Indicates whether traffic to or from the instance is validated.
|
102
|
+
# @return [Boolean]
|
103
|
+
def source_dest_check
|
104
|
+
data.source_dest_check
|
105
|
+
end
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
107
|
+
# Any security groups for the network interface.
|
108
|
+
# @return [Array<Types::GroupIdentifier>]
|
109
|
+
def groups
|
110
|
+
data.groups
|
111
|
+
end
|
113
112
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
# The network interface attachment.
|
114
|
+
# @return [Types::NetworkInterfaceAttachment]
|
115
|
+
def attachment
|
116
|
+
data.attachment
|
117
|
+
end
|
119
118
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
119
|
+
# Any tags assigned to the network interface.
|
120
|
+
# @return [Array<Types::Tag>]
|
121
|
+
def tag_set
|
122
|
+
data.tag_set
|
123
|
+
end
|
125
124
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
125
|
+
# The private IPv4 addresses associated with the network interface.
|
126
|
+
# @return [Array<Types::NetworkInterfacePrivateIpAddress>]
|
127
|
+
def private_ip_addresses
|
128
|
+
data.private_ip_addresses
|
129
|
+
end
|
131
130
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
131
|
+
# The IPv6 addresses associated with the network interface.
|
132
|
+
# @return [Array<Types::NetworkInterfaceIpv6Address>]
|
133
|
+
def ipv_6_addresses
|
134
|
+
data.ipv_6_addresses
|
135
|
+
end
|
137
136
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
137
|
+
# The type of interface.
|
138
|
+
# @return [String]
|
139
|
+
def interface_type
|
140
|
+
data.interface_type
|
141
|
+
end
|
143
142
|
|
144
|
-
|
143
|
+
# @!endgroup
|
145
144
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
145
|
+
# @return [Client]
|
146
|
+
def client
|
147
|
+
@client
|
148
|
+
end
|
150
149
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
150
|
+
# Loads, or reloads {#data} for the current {NetworkInterface}.
|
151
|
+
# Returns `self` making it possible to chain methods.
|
152
|
+
#
|
153
|
+
# network_interface.reload.data
|
154
|
+
#
|
155
|
+
# @return [self]
|
156
|
+
def load
|
157
|
+
resp = @client.describe_network_interfaces(network_interface_ids: [@id])
|
158
|
+
@data = resp.networkinterfaces[0]
|
159
|
+
self
|
160
|
+
end
|
161
|
+
alias :reload :load
|
162
|
+
|
163
|
+
# @return [Types::NetworkInterface]
|
164
|
+
# Returns the data for this {NetworkInterface}. Calls
|
165
|
+
# {Client#describe_network_interfaces} if {#data_loaded?} is `false`.
|
166
|
+
def data
|
167
|
+
load unless @data
|
168
|
+
@data
|
169
|
+
end
|
171
170
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
171
|
+
# @return [Boolean]
|
172
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
173
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
174
|
+
def data_loaded?
|
175
|
+
!!@data
|
176
|
+
end
|
178
177
|
|
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
|
-
|
178
|
+
# @!group Actions
|
179
|
+
|
180
|
+
# @example Request syntax with placeholder values
|
181
|
+
#
|
182
|
+
# network_interface.assign_private_ip_addresses({
|
183
|
+
# private_ip_addresses: ["String"],
|
184
|
+
# secondary_private_ip_address_count: 1,
|
185
|
+
# allow_reassignment: false,
|
186
|
+
# })
|
187
|
+
# @param [Hash] options ({})
|
188
|
+
# @option options [Array<String>] :private_ip_addresses
|
189
|
+
# One or more IP addresses to be assigned as a secondary private IP
|
190
|
+
# address to the network interface. You can't specify this parameter
|
191
|
+
# when also specifying a number of secondary IP addresses.
|
192
|
+
#
|
193
|
+
# If you don't specify an IP address, Amazon EC2 automatically selects
|
194
|
+
# an IP address within the subnet range.
|
195
|
+
# @option options [Integer] :secondary_private_ip_address_count
|
196
|
+
# The number of secondary IP addresses to assign to the network
|
197
|
+
# interface. You can't specify this parameter when also specifying
|
198
|
+
# private IP addresses.
|
199
|
+
# @option options [Boolean] :allow_reassignment
|
200
|
+
# Indicates whether to allow an IP address that is already assigned to
|
201
|
+
# another network interface or instance to be reassigned to the
|
202
|
+
# specified network interface.
|
203
|
+
# @return [EmptyStructure]
|
204
|
+
def assign_private_ip_addresses(options = {})
|
205
|
+
options = options.merge(network_interface_id: @id)
|
206
|
+
resp = @client.assign_private_ip_addresses(options)
|
207
|
+
resp.data
|
208
|
+
end
|
210
209
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
210
|
+
# @example Request syntax with placeholder values
|
211
|
+
#
|
212
|
+
# network_interface.attach({
|
213
|
+
# dry_run: false,
|
214
|
+
# instance_id: "String", # required
|
215
|
+
# device_index: 1, # required
|
216
|
+
# })
|
217
|
+
# @param [Hash] options ({})
|
218
|
+
# @option options [Boolean] :dry_run
|
219
|
+
# Checks whether you have the required permissions for the action,
|
220
|
+
# without actually making the request, and provides an error response.
|
221
|
+
# If you have the required permissions, the error response is
|
222
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
223
|
+
# @option options [required, String] :instance_id
|
224
|
+
# The ID of the instance.
|
225
|
+
# @option options [required, Integer] :device_index
|
226
|
+
# The index of the device for the network interface attachment.
|
227
|
+
# @return [Types::AttachNetworkInterfaceResult]
|
228
|
+
def attach(options = {})
|
229
|
+
options = options.merge(network_interface_id: @id)
|
230
|
+
resp = @client.attach_network_interface(options)
|
231
|
+
resp.data
|
232
|
+
end
|
234
233
|
|
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
|
-
|
234
|
+
# @example Request syntax with placeholder values
|
235
|
+
#
|
236
|
+
# tag = network_interface.create_tags({
|
237
|
+
# dry_run: false,
|
238
|
+
# tags: [ # required
|
239
|
+
# {
|
240
|
+
# key: "String",
|
241
|
+
# value: "String",
|
242
|
+
# },
|
243
|
+
# ],
|
244
|
+
# })
|
245
|
+
# @param [Hash] options ({})
|
246
|
+
# @option options [Boolean] :dry_run
|
247
|
+
# Checks whether you have the required permissions for the action,
|
248
|
+
# without actually making the request, and provides an error response.
|
249
|
+
# If you have the required permissions, the error response is
|
250
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
251
|
+
# @option options [required, Array<Types::Tag>] :tags
|
252
|
+
# One or more tags. The `value` parameter is required, but if you don't
|
253
|
+
# want the tag to have a value, specify the parameter with no value, and
|
254
|
+
# we set the value to an empty string.
|
255
|
+
# @return [Tag::Collection]
|
256
|
+
def create_tags(options = {})
|
257
|
+
batch = []
|
258
|
+
options = Aws::Util.deep_merge(options, resources: [@id])
|
259
|
+
resp = @client.create_tags(options)
|
260
|
+
options[:tags].each do |t|
|
261
|
+
batch << Tag.new(
|
262
|
+
resource_id: @id,
|
263
|
+
key: t[:key],
|
264
|
+
value: t[:value],
|
265
|
+
client: @client
|
266
|
+
)
|
267
|
+
end
|
268
|
+
Tag::Collection.new([batch], size: batch.size)
|
269
|
+
end
|
271
270
|
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
271
|
+
# @example Request syntax with placeholder values
|
272
|
+
#
|
273
|
+
# network_interface.delete({
|
274
|
+
# dry_run: false,
|
275
|
+
# })
|
276
|
+
# @param [Hash] options ({})
|
277
|
+
# @option options [Boolean] :dry_run
|
278
|
+
# Checks whether you have the required permissions for the action,
|
279
|
+
# without actually making the request, and provides an error response.
|
280
|
+
# If you have the required permissions, the error response is
|
281
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
282
|
+
# @return [EmptyStructure]
|
283
|
+
def delete(options = {})
|
284
|
+
options = options.merge(network_interface_id: @id)
|
285
|
+
resp = @client.delete_network_interface(options)
|
286
|
+
resp.data
|
287
|
+
end
|
289
288
|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
289
|
+
# @example Request syntax with placeholder values
|
290
|
+
#
|
291
|
+
# network_interface.describe_attribute({
|
292
|
+
# dry_run: false,
|
293
|
+
# attribute: "description", # accepts description, groupSet, sourceDestCheck, attachment
|
294
|
+
# })
|
295
|
+
# @param [Hash] options ({})
|
296
|
+
# @option options [Boolean] :dry_run
|
297
|
+
# Checks whether you have the required permissions for the action,
|
298
|
+
# without actually making the request, and provides an error response.
|
299
|
+
# If you have the required permissions, the error response is
|
300
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
301
|
+
# @option options [String] :attribute
|
302
|
+
# The attribute of the network interface.
|
303
|
+
# @return [Types::DescribeNetworkInterfaceAttributeResult]
|
304
|
+
def describe_attribute(options = {})
|
305
|
+
options = options.merge(network_interface_id: @id)
|
306
|
+
resp = @client.describe_network_interface_attribute(options)
|
307
|
+
resp.data
|
308
|
+
end
|
310
309
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
310
|
+
# @example Request syntax with placeholder values
|
311
|
+
#
|
312
|
+
# network_interface.detach({
|
313
|
+
# dry_run: false,
|
314
|
+
# force: false,
|
315
|
+
# })
|
316
|
+
# @param [Hash] options ({})
|
317
|
+
# @option options [Boolean] :dry_run
|
318
|
+
# Checks whether you have the required permissions for the action,
|
319
|
+
# without actually making the request, and provides an error response.
|
320
|
+
# If you have the required permissions, the error response is
|
321
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
322
|
+
# @option options [Boolean] :force
|
323
|
+
# Specifies whether to force a detachment.
|
324
|
+
# @return [EmptyStructure]
|
325
|
+
def detach(options = {})
|
326
|
+
options = options.merge(attachment_id: data.attachment.attachment_id)
|
327
|
+
resp = @client.detach_network_interface(options)
|
328
|
+
resp.data
|
329
|
+
end
|
331
330
|
|
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
|
-
|
331
|
+
# @example Request syntax with placeholder values
|
332
|
+
#
|
333
|
+
# network_interface.modify_attribute({
|
334
|
+
# dry_run: false,
|
335
|
+
# description: "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
|
336
|
+
# source_dest_check: {
|
337
|
+
# value: false,
|
338
|
+
# },
|
339
|
+
# groups: ["String"],
|
340
|
+
# attachment: {
|
341
|
+
# attachment_id: "String",
|
342
|
+
# delete_on_termination: false,
|
343
|
+
# },
|
344
|
+
# })
|
345
|
+
# @param [Hash] options ({})
|
346
|
+
# @option options [Boolean] :dry_run
|
347
|
+
# Checks whether you have the required permissions for the action,
|
348
|
+
# without actually making the request, and provides an error response.
|
349
|
+
# If you have the required permissions, the error response is
|
350
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
351
|
+
# @option options [Types::AttributeValue] :description
|
352
|
+
# A description for the network interface.
|
353
|
+
# @option options [Types::AttributeBooleanValue] :source_dest_check
|
354
|
+
# Indicates whether source/destination checking is enabled. A value of
|
355
|
+
# `true` means checking is enabled, and `false` means checking is
|
356
|
+
# disabled. This value must be `false` for a NAT instance to perform
|
357
|
+
# NAT. For more information, see [NAT Instances][1] in the *Amazon
|
358
|
+
# Virtual Private Cloud User Guide*.
|
359
|
+
#
|
360
|
+
#
|
361
|
+
#
|
362
|
+
# [1]: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html
|
363
|
+
# @option options [Array<String>] :groups
|
364
|
+
# Changes the security groups for the network interface. The new set of
|
365
|
+
# groups you specify replaces the current set. You must specify at least
|
366
|
+
# one group, even if it's just the default security group in the VPC.
|
367
|
+
# You must specify the ID of the security group, not the name.
|
368
|
+
# @option options [Types::NetworkInterfaceAttachmentChanges] :attachment
|
369
|
+
# Information about the interface attachment. If modifying the 'delete
|
370
|
+
# on termination' attribute, you must specify the ID of the interface
|
371
|
+
# attachment.
|
372
|
+
# @return [EmptyStructure]
|
373
|
+
def modify_attribute(options = {})
|
374
|
+
options = options.merge(network_interface_id: @id)
|
375
|
+
resp = @client.modify_network_interface_attribute(options)
|
376
|
+
resp.data
|
377
|
+
end
|
379
378
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
379
|
+
# @example Request syntax with placeholder values
|
380
|
+
#
|
381
|
+
# network_interface.reset_attribute({
|
382
|
+
# dry_run: false,
|
383
|
+
# source_dest_check: "String",
|
384
|
+
# })
|
385
|
+
# @param [Hash] options ({})
|
386
|
+
# @option options [Boolean] :dry_run
|
387
|
+
# Checks whether you have the required permissions for the action,
|
388
|
+
# without actually making the request, and provides an error response.
|
389
|
+
# If you have the required permissions, the error response is
|
390
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
391
|
+
# @option options [String] :source_dest_check
|
392
|
+
# The source/destination checking attribute. Resets the value to `true`.
|
393
|
+
# @return [EmptyStructure]
|
394
|
+
def reset_attribute(options = {})
|
395
|
+
options = options.merge(network_interface_id: @id)
|
396
|
+
resp = @client.reset_network_interface_attribute(options)
|
397
|
+
resp.data
|
398
|
+
end
|
400
399
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
400
|
+
# @example Request syntax with placeholder values
|
401
|
+
#
|
402
|
+
# network_interface.unassign_private_ip_addresses({
|
403
|
+
# private_ip_addresses: ["String"], # required
|
404
|
+
# })
|
405
|
+
# @param [Hash] options ({})
|
406
|
+
# @option options [required, Array<String>] :private_ip_addresses
|
407
|
+
# The secondary private IP addresses to unassign from the network
|
408
|
+
# interface. You can specify this option multiple times to unassign more
|
409
|
+
# than one IP address.
|
410
|
+
# @return [EmptyStructure]
|
411
|
+
def unassign_private_ip_addresses(options = {})
|
412
|
+
options = options.merge(network_interface_id: @id)
|
413
|
+
resp = @client.unassign_private_ip_addresses(options)
|
414
|
+
resp.data
|
415
|
+
end
|
417
416
|
|
418
|
-
|
419
|
-
|
420
|
-
# @return [NetworkInterfaceAssociation, nil]
|
421
|
-
def association
|
422
|
-
if data.association.association_id
|
423
|
-
NetworkInterfaceAssociation.new(
|
424
|
-
id: data.association.association_id,
|
425
|
-
data: data.association,
|
426
|
-
client: @client
|
427
|
-
)
|
428
|
-
else
|
429
|
-
nil
|
430
|
-
end
|
431
|
-
end
|
417
|
+
# @!group Associations
|
432
418
|
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
419
|
+
# @return [NetworkInterfaceAssociation, nil]
|
420
|
+
def association
|
421
|
+
if data.association.association_id
|
422
|
+
NetworkInterfaceAssociation.new(
|
423
|
+
id: data.association.association_id,
|
424
|
+
data: data.association,
|
425
|
+
client: @client
|
426
|
+
)
|
427
|
+
else
|
428
|
+
nil
|
443
429
|
end
|
430
|
+
end
|
444
431
|
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
end
|
432
|
+
# @return [Subnet, nil]
|
433
|
+
def subnet
|
434
|
+
if data.subnet_id
|
435
|
+
Subnet.new(
|
436
|
+
id: data.subnet_id,
|
437
|
+
client: @client
|
438
|
+
)
|
439
|
+
else
|
440
|
+
nil
|
455
441
|
end
|
442
|
+
end
|
456
443
|
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
def extract_id(args, options)
|
467
|
-
value = args[0] || options.delete(:id)
|
468
|
-
case value
|
469
|
-
when String then value
|
470
|
-
when nil then raise ArgumentError, "missing required option :id"
|
471
|
-
else
|
472
|
-
msg = "expected :id to be a String, got #{value.class}"
|
473
|
-
raise ArgumentError, msg
|
474
|
-
end
|
444
|
+
# @return [Vpc, nil]
|
445
|
+
def vpc
|
446
|
+
if data.vpc_id
|
447
|
+
Vpc.new(
|
448
|
+
id: data.vpc_id,
|
449
|
+
client: @client
|
450
|
+
)
|
451
|
+
else
|
452
|
+
nil
|
475
453
|
end
|
454
|
+
end
|
476
455
|
|
477
|
-
|
456
|
+
# @deprecated
|
457
|
+
# @api private
|
458
|
+
def identifiers
|
459
|
+
{ id: @id }
|
478
460
|
end
|
461
|
+
deprecated(:identifiers)
|
462
|
+
|
463
|
+
private
|
464
|
+
|
465
|
+
def extract_id(args, options)
|
466
|
+
value = args[0] || options.delete(:id)
|
467
|
+
case value
|
468
|
+
when String then value
|
469
|
+
when nil then raise ArgumentError, "missing required option :id"
|
470
|
+
else
|
471
|
+
msg = "expected :id to be a String, got #{value.class}"
|
472
|
+
raise ArgumentError, msg
|
473
|
+
end
|
474
|
+
end
|
475
|
+
|
476
|
+
class Collection < Aws::Resources::Collection; end
|
479
477
|
end
|
480
478
|
end
|