aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3

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