aws-sdk-autoscaling 1.0.0.rc1 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,14 @@
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 AutoScaling
10
- module Errors
8
+ module Aws::AutoScaling
9
+ module Errors
11
10
 
12
- extend Aws::Errors::DynamicErrors
11
+ extend Aws::Errors::DynamicErrors
13
12
 
14
- # Raised when calling #load or #data on a resource class that can not be
15
- # loaded. This can happen when:
16
- #
17
- # * A resource class has identifiers, but no data attributes.
18
- # * Resource data is only available when making an API call that
19
- # enumerates all resources of that type.
20
- class ResourceNotLoadable < RuntimeError; end
21
- end
22
13
  end
23
14
  end
@@ -1,416 +1,408 @@
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 AutoScaling
10
- class Instance
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(group_name, id, options = {})
15
- # @param [String] group_name
16
- # @param [String] id
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :group_name
20
- # @option options [required, String] :id
21
- # @option options [Client] :client
22
- def initialize(*args)
23
- options = Hash === args.last ? args.pop.dup : {}
24
- @group_name = extract_group_name(args, options)
25
- @id = extract_id(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
28
- end
8
+ module Aws::AutoScaling
9
+ class Instance
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(group_name, id, options = {})
14
+ # @param [String] group_name
15
+ # @param [String] id
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :group_name
19
+ # @option options [required, String] :id
20
+ # @option options [Client] :client
21
+ def initialize(*args)
22
+ options = Hash === args.last ? args.pop.dup : {}
23
+ @group_name = extract_group_name(args, options)
24
+ @id = extract_id(args, options)
25
+ @data = options.delete(:data)
26
+ @client = options.delete(:client) || Client.new(options)
27
+ end
29
28
 
30
- # @!group Read-Only Attributes
29
+ # @!group Read-Only Attributes
31
30
 
32
- # @return [String]
33
- def group_name
34
- @group_name
35
- end
36
- alias :auto_scaling_group_name :group_name
31
+ # @return [String]
32
+ def group_name
33
+ @group_name
34
+ end
35
+ alias :auto_scaling_group_name :group_name
37
36
 
38
- # @return [String]
39
- def id
40
- @id
41
- end
42
- alias :instance_id :id
37
+ # @return [String]
38
+ def id
39
+ @id
40
+ end
41
+ alias :instance_id :id
43
42
 
44
- # The Availability Zone for the instance.
45
- # @return [String]
46
- def availability_zone
47
- data.availability_zone
48
- end
43
+ # The Availability Zone for the instance.
44
+ # @return [String]
45
+ def availability_zone
46
+ data.availability_zone
47
+ end
49
48
 
50
- # The lifecycle state for the instance. For more information, see [Auto
51
- # Scaling Lifecycle][1] in the *Auto Scaling User Guide*.
52
- #
53
- #
54
- #
55
- # [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html
56
- # @return [String]
57
- def lifecycle_state
58
- data.lifecycle_state
59
- end
49
+ # The lifecycle state for the instance. For more information, see [Auto
50
+ # Scaling Lifecycle][1] in the *Auto Scaling User Guide*.
51
+ #
52
+ #
53
+ #
54
+ # [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroupLifecycle.html
55
+ # @return [String]
56
+ def lifecycle_state
57
+ data.lifecycle_state
58
+ end
60
59
 
61
- # The last reported health status of this instance. "Healthy" means
62
- # that the instance is healthy and should remain in service.
63
- # "Unhealthy" means that the instance is unhealthy and Auto Scaling
64
- # should terminate and replace it.
65
- # @return [String]
66
- def health_status
67
- data.health_status
68
- end
60
+ # The last reported health status of this instance. "Healthy" means
61
+ # that the instance is healthy and should remain in service.
62
+ # "Unhealthy" means that the instance is unhealthy and Auto Scaling
63
+ # should terminate and replace it.
64
+ # @return [String]
65
+ def health_status
66
+ data.health_status
67
+ end
69
68
 
70
- # The launch configuration associated with the instance.
71
- # @return [String]
72
- def launch_configuration_name
73
- data.launch_configuration_name
74
- end
69
+ # The launch configuration associated with the instance.
70
+ # @return [String]
71
+ def launch_configuration_name
72
+ data.launch_configuration_name
73
+ end
75
74
 
76
- # Indicates whether the instance is protected from termination by Auto
77
- # Scaling when scaling in.
78
- # @return [Boolean]
79
- def protected_from_scale_in
80
- data.protected_from_scale_in
81
- end
75
+ # Indicates whether the instance is protected from termination by Auto
76
+ # Scaling when scaling in.
77
+ # @return [Boolean]
78
+ def protected_from_scale_in
79
+ data.protected_from_scale_in
80
+ end
82
81
 
83
- # @!endgroup
82
+ # @!endgroup
84
83
 
85
- # @return [Client]
86
- def client
87
- @client
88
- end
84
+ # @return [Client]
85
+ def client
86
+ @client
87
+ end
89
88
 
90
- # Loads, or reloads {#data} for the current {Instance}.
91
- # Returns `self` making it possible to chain methods.
92
- #
93
- # instance.reload.data
94
- #
95
- # @return [self]
96
- def load
97
- resp = @client.describe_auto_scaling_instances(instance_ids: [@id])
98
- @data = resp.autoscalinginstances[0]
99
- self
100
- end
101
- alias :reload :load
102
-
103
- # @return [Types::AutoScalingInstanceDetails]
104
- # Returns the data for this {Instance}. Calls
105
- # {Client#describe_auto_scaling_instances} if {#data_loaded?} is `false`.
106
- def data
107
- load unless @data
108
- @data
109
- end
89
+ # Loads, or reloads {#data} for the current {Instance}.
90
+ # Returns `self` making it possible to chain methods.
91
+ #
92
+ # instance.reload.data
93
+ #
94
+ # @return [self]
95
+ def load
96
+ resp = @client.describe_auto_scaling_instances(instance_ids: [@id])
97
+ @data = resp.autoscalinginstances[0]
98
+ self
99
+ end
100
+ alias :reload :load
101
+
102
+ # @return [Types::AutoScalingInstanceDetails]
103
+ # Returns the data for this {Instance}. Calls
104
+ # {Client#describe_auto_scaling_instances} if {#data_loaded?} is `false`.
105
+ def data
106
+ load unless @data
107
+ @data
108
+ end
110
109
 
111
- # @return [Boolean]
112
- # Returns `true` if this resource is loaded. Accessing attributes or
113
- # {#data} on an unloaded resource will trigger a call to {#load}.
114
- def data_loaded?
115
- !!@data
116
- end
110
+ # @return [Boolean]
111
+ # Returns `true` if this resource is loaded. Accessing attributes or
112
+ # {#data} on an unloaded resource will trigger a call to {#load}.
113
+ def data_loaded?
114
+ !!@data
115
+ end
117
116
 
118
- # @!group Actions
117
+ # @!group Actions
118
+
119
+ # @example Request syntax with placeholder values
120
+ #
121
+ # instance.attach()
122
+ # @param [Hash] options ({})
123
+ # @return [EmptyStructure]
124
+ def attach(options = {})
125
+ options = Aws::Util.deep_merge(options,
126
+ auto_scaling_group_name: @group_name,
127
+ instance_ids: [@id]
128
+ )
129
+ resp = @client.attach_instances(options)
130
+ resp.data
131
+ end
119
132
 
120
- # @example Request syntax with placeholder values
121
- #
122
- # instance.attach()
123
- # @param [Hash] options ({})
124
- # @return [EmptyStructure]
125
- def attach(options = {})
126
- options = Aws::Util.deep_merge(options,
127
- auto_scaling_group_name: @group_name,
128
- instance_ids: [@id]
133
+ # @example Request syntax with placeholder values
134
+ #
135
+ # activity = instance.detach({
136
+ # should_decrement_desired_capacity: false, # required
137
+ # })
138
+ # @param [Hash] options ({})
139
+ # @option options [required, Boolean] :should_decrement_desired_capacity
140
+ # If `True`, the Auto Scaling group decrements the desired capacity
141
+ # value by the number of instances detached.
142
+ # @return [Activity::Collection]
143
+ def detach(options = {})
144
+ batch = []
145
+ options = Aws::Util.deep_merge(options,
146
+ auto_scaling_group_name: @group_name,
147
+ instance_ids: [@id]
148
+ )
149
+ resp = @client.detach_instances(options)
150
+ resp.data.activities.each do |a|
151
+ batch << Activity.new(
152
+ id: a.activity_id,
153
+ data: a,
154
+ client: @client
129
155
  )
130
- resp = @client.attach_instances(options)
131
- resp.data
132
156
  end
157
+ Activity::Collection.new([batch], size: batch.size)
158
+ end
133
159
 
134
- # @example Request syntax with placeholder values
135
- #
136
- # activity = instance.detach({
137
- # should_decrement_desired_capacity: false, # required
138
- # })
139
- # @param [Hash] options ({})
140
- # @option options [required, Boolean] :should_decrement_desired_capacity
141
- # If `True`, the Auto Scaling group decrements the desired capacity
142
- # value by the number of instances detached.
143
- # @return [Activity::Collection]
144
- def detach(options = {})
145
- batch = []
146
- options = Aws::Util.deep_merge(options,
147
- auto_scaling_group_name: @group_name,
148
- instance_ids: [@id]
160
+ # @example Request syntax with placeholder values
161
+ #
162
+ # activity = instance.enter_standby({
163
+ # should_decrement_desired_capacity: false, # required
164
+ # })
165
+ # @param [Hash] options ({})
166
+ # @option options [required, Boolean] :should_decrement_desired_capacity
167
+ # Specifies whether the instances moved to `Standby` mode count as part
168
+ # of the Auto Scaling group's desired capacity. If set, the desired
169
+ # capacity for the Auto Scaling group decrements by the number of
170
+ # instances moved to `Standby` mode.
171
+ # @return [Activity::Collection]
172
+ def enter_standby(options = {})
173
+ batch = []
174
+ options = Aws::Util.deep_merge(options,
175
+ auto_scaling_group_name: @group_name,
176
+ instance_ids: [@id]
177
+ )
178
+ resp = @client.enter_standby(options)
179
+ resp.data.activities.each do |a|
180
+ batch << Activity.new(
181
+ id: a.activity_id,
182
+ data: a,
183
+ client: @client
149
184
  )
150
- resp = @client.detach_instances(options)
151
- resp.data.activities.each do |a|
152
- batch << Activity.new(
153
- id: a.activity_id,
154
- data: a,
155
- client: @client
156
- )
157
- end
158
- Activity::Collection.new([batch], size: batch.size)
159
185
  end
186
+ Activity::Collection.new([batch], size: batch.size)
187
+ end
160
188
 
161
- # @example Request syntax with placeholder values
162
- #
163
- # activity = instance.enter_standby({
164
- # should_decrement_desired_capacity: false, # required
165
- # })
166
- # @param [Hash] options ({})
167
- # @option options [required, Boolean] :should_decrement_desired_capacity
168
- # Specifies whether the instances moved to `Standby` mode count as part
169
- # of the Auto Scaling group's desired capacity. If set, the desired
170
- # capacity for the Auto Scaling group decrements by the number of
171
- # instances moved to `Standby` mode.
172
- # @return [Activity::Collection]
173
- def enter_standby(options = {})
174
- batch = []
175
- options = Aws::Util.deep_merge(options,
176
- auto_scaling_group_name: @group_name,
177
- instance_ids: [@id]
189
+ # @example Request syntax with placeholder values
190
+ #
191
+ # instance.exit_standby()
192
+ # @param [Hash] options ({})
193
+ # @return [Activity::Collection]
194
+ def exit_standby(options = {})
195
+ batch = []
196
+ options = Aws::Util.deep_merge(options,
197
+ auto_scaling_group_name: @group_name,
198
+ instance_ids: [@id]
199
+ )
200
+ resp = @client.exit_standby(options)
201
+ resp.data.activities.each do |a|
202
+ batch << Activity.new(
203
+ id: a.activity_id,
204
+ data: a,
205
+ client: @client
178
206
  )
179
- resp = @client.enter_standby(options)
180
- resp.data.activities.each do |a|
181
- batch << Activity.new(
182
- id: a.activity_id,
183
- data: a,
184
- client: @client
185
- )
186
- end
187
- Activity::Collection.new([batch], size: batch.size)
188
207
  end
208
+ Activity::Collection.new([batch], size: batch.size)
209
+ end
189
210
 
190
- # @example Request syntax with placeholder values
191
- #
192
- # activity = instance.exit_standby()
193
- # @param [Hash] options ({})
194
- # @return [Activity::Collection]
195
- def exit_standby(options = {})
196
- batch = []
197
- options = Aws::Util.deep_merge(options,
198
- auto_scaling_group_name: @group_name,
199
- instance_ids: [@id]
200
- )
201
- resp = @client.exit_standby(options)
202
- resp.data.activities.each do |a|
203
- batch << Activity.new(
204
- id: a.activity_id,
205
- data: a,
206
- client: @client
207
- )
208
- end
209
- Activity::Collection.new([batch], size: batch.size)
210
- end
211
+ # @example Request syntax with placeholder values
212
+ #
213
+ # instance.set_health({
214
+ # health_status: "XmlStringMaxLen32", # required
215
+ # should_respect_grace_period: false,
216
+ # })
217
+ # @param [Hash] options ({})
218
+ # @option options [required, String] :health_status
219
+ # The health status of the instance. Set to `Healthy` if you want the
220
+ # instance to remain in service. Set to `Unhealthy` if you want the
221
+ # instance to be out of service. Auto Scaling will terminate and replace
222
+ # the unhealthy instance.
223
+ # @option options [Boolean] :should_respect_grace_period
224
+ # If the Auto Scaling group of the specified instance has a
225
+ # `HealthCheckGracePeriod` specified for the group, by default, this
226
+ # call will respect the grace period. Set this to `False`, if you do not
227
+ # want the call to respect the grace period associated with the group.
228
+ #
229
+ # For more information, see the description of the health check grace
230
+ # period for CreateAutoScalingGroup.
231
+ # @return [EmptyStructure]
232
+ def set_health(options = {})
233
+ options = options.merge(instance_id: @id)
234
+ resp = @client.set_instance_health(options)
235
+ resp.data
236
+ end
211
237
 
212
- # @example Request syntax with placeholder values
213
- #
214
- # instance.set_health({
215
- # health_status: "XmlStringMaxLen32", # required
216
- # should_respect_grace_period: false,
217
- # })
218
- # @param [Hash] options ({})
219
- # @option options [required, String] :health_status
220
- # The health status of the instance. Set to `Healthy` if you want the
221
- # instance to remain in service. Set to `Unhealthy` if you want the
222
- # instance to be out of service. Auto Scaling will terminate and replace
223
- # the unhealthy instance.
224
- # @option options [Boolean] :should_respect_grace_period
225
- # If the Auto Scaling group of the specified instance has a
226
- # `HealthCheckGracePeriod` specified for the group, by default, this
227
- # call will respect the grace period. Set this to `False`, if you do not
228
- # want the call to respect the grace period associated with the group.
229
- #
230
- # For more information, see the description of the health check grace
231
- # period for CreateAutoScalingGroup.
232
- # @return [EmptyStructure]
233
- def set_health(options = {})
234
- options = options.merge(instance_id: @id)
235
- resp = @client.set_instance_health(options)
236
- resp.data
237
- end
238
+ # @example Request syntax with placeholder values
239
+ #
240
+ # activity = instance.terminate({
241
+ # should_decrement_desired_capacity: false, # required
242
+ # })
243
+ # @param [Hash] options ({})
244
+ # @option options [required, Boolean] :should_decrement_desired_capacity
245
+ # If `true`, terminating the instance also decrements the size of the
246
+ # Auto Scaling group.
247
+ # @return [Activity]
248
+ def terminate(options = {})
249
+ options = options.merge(instance_id: @id)
250
+ resp = @client.terminate_instance_in_auto_scaling_group(options)
251
+ Activity.new(
252
+ id: resp.data.activity.activity_id,
253
+ data: resp.data.activity,
254
+ client: @client
255
+ )
256
+ end
238
257
 
239
- # @example Request syntax with placeholder values
240
- #
241
- # activity = instance.terminate({
242
- # should_decrement_desired_capacity: false, # required
243
- # })
244
- # @param [Hash] options ({})
245
- # @option options [required, Boolean] :should_decrement_desired_capacity
246
- # If `true`, terminating the instance also decrements the size of the
247
- # Auto Scaling group.
248
- # @return [Activity]
249
- def terminate(options = {})
250
- options = options.merge(instance_id: @id)
251
- resp = @client.terminate_instance_in_auto_scaling_group(options)
252
- Activity.new(
253
- id: resp.data.activity.activity_id,
254
- data: resp.data.activity,
255
- client: @client
256
- )
257
- end
258
+ # @!group Associations
258
259
 
259
- # @!group Associations
260
+ # @return [AutoScalingGroup]
261
+ def group
262
+ AutoScalingGroup.new(
263
+ name: @group_name,
264
+ client: @client
265
+ )
266
+ end
260
267
 
261
- # @return [AutoScalingGroup]
262
- def group
263
- AutoScalingGroup.new(
264
- name: @group_name,
268
+ # @return [LaunchConfiguration, nil]
269
+ def launch_configuration
270
+ if data.launch_configuration_name
271
+ LaunchConfiguration.new(
272
+ name: data.launch_configuration_name,
265
273
  client: @client
266
274
  )
275
+ else
276
+ nil
267
277
  end
278
+ end
268
279
 
269
- # @return [LaunchConfiguration, nil]
270
- def launch_configuration
271
- if data.launch_configuration_name
272
- LaunchConfiguration.new(
273
- name: data.launch_configuration_name,
274
- client: @client
275
- )
276
- else
277
- nil
278
- end
279
- end
280
-
281
- # @deprecated
282
- # @api private
283
- def identifiers
284
- {
285
- group_name: @group_name,
286
- id: @id
287
- }
288
- end
289
- deprecated(:identifiers)
290
-
291
- private
292
-
293
- def extract_group_name(args, options)
294
- value = args[0] || options.delete(:group_name)
295
- case value
296
- when String then value
297
- when nil then raise ArgumentError, "missing required option :group_name"
298
- else
299
- msg = "expected :group_name to be a String, got #{value.class}"
300
- raise ArgumentError, msg
301
- end
280
+ # @deprecated
281
+ # @api private
282
+ def identifiers
283
+ {
284
+ group_name: @group_name,
285
+ id: @id
286
+ }
287
+ end
288
+ deprecated(:identifiers)
289
+
290
+ private
291
+
292
+ def extract_group_name(args, options)
293
+ value = args[0] || options.delete(:group_name)
294
+ case value
295
+ when String then value
296
+ when nil then raise ArgumentError, "missing required option :group_name"
297
+ else
298
+ msg = "expected :group_name to be a String, got #{value.class}"
299
+ raise ArgumentError, msg
302
300
  end
301
+ end
303
302
 
304
- def extract_id(args, options)
305
- value = args[1] || options.delete(:id)
306
- case value
307
- when String then value
308
- when nil then raise ArgumentError, "missing required option :id"
309
- else
310
- msg = "expected :id to be a String, got #{value.class}"
311
- raise ArgumentError, msg
312
- end
303
+ def extract_id(args, options)
304
+ value = args[1] || options.delete(:id)
305
+ case value
306
+ when String then value
307
+ when nil then raise ArgumentError, "missing required option :id"
308
+ else
309
+ msg = "expected :id to be a String, got #{value.class}"
310
+ raise ArgumentError, msg
313
311
  end
312
+ end
314
313
 
315
- class Collection < Aws::Resources::Collection
316
-
317
- # @!group Batch Actions
318
-
319
- # @example Request syntax with placeholder values
320
- #
321
- # instance.batch_attach()
322
- # @param options ({})
323
- # @return [void]
324
- def batch_attach(options = {})
325
- batch_enum.each do |batch|
326
- params = Aws::Util.copy_hash(options)
327
- params[:auto_scaling_group_name] = batch[0].group_name
328
- params[:instance_ids] ||= []
329
- batch.each do |item|
330
- params[:instance_ids] << {
331
- id: item.id
332
- }
333
- end
334
- batch[0].client.attach_instances(params)
314
+ class Collection < Aws::Resources::Collection
315
+
316
+ # @!group Batch Actions
317
+
318
+ # @param options ({})
319
+ # @return [void]
320
+ def batch_attach(options = {})
321
+ batch_enum.each do |batch|
322
+ params = Aws::Util.copy_hash(options)
323
+ params[:auto_scaling_group_name] = batch[0].group_name
324
+ params[:instance_ids] ||= []
325
+ batch.each do |item|
326
+ params[:instance_ids] << {
327
+ id: item.id
328
+ }
335
329
  end
336
- nil
330
+ batch[0].client.attach_instances(params)
337
331
  end
332
+ nil
333
+ end
338
334
 
339
- # @example Request syntax with placeholder values
340
- #
341
- # instance.batch_detach({
342
- # should_decrement_desired_capacity: false, # required
343
- # })
344
- # @param options ({})
345
- # @option options [required, Boolean] :should_decrement_desired_capacity
346
- # If `True`, the Auto Scaling group decrements the desired capacity
347
- # value by the number of instances detached.
348
- # @return [void]
349
- def batch_detach(options = {})
350
- batch_enum.each do |batch|
351
- params = Aws::Util.copy_hash(options)
352
- params[:auto_scaling_group_name] = batch[0].group_name
353
- params[:instance_ids] ||= []
354
- batch.each do |item|
355
- params[:instance_ids] << {
356
- id: item.id
357
- }
358
- end
359
- batch[0].client.detach_instances(params)
335
+ # @example Request syntax with placeholder values
336
+ #
337
+ # instance.batch_detach({
338
+ # should_decrement_desired_capacity: false, # required
339
+ # })
340
+ # @param options ({})
341
+ # @option options [required, Boolean] :should_decrement_desired_capacity
342
+ # If `True`, the Auto Scaling group decrements the desired capacity
343
+ # value by the number of instances detached.
344
+ # @return [void]
345
+ def batch_detach(options = {})
346
+ batch_enum.each do |batch|
347
+ params = Aws::Util.copy_hash(options)
348
+ params[:auto_scaling_group_name] = batch[0].group_name
349
+ params[:instance_ids] ||= []
350
+ batch.each do |item|
351
+ params[:instance_ids] << {
352
+ id: item.id
353
+ }
360
354
  end
361
- nil
355
+ batch[0].client.detach_instances(params)
362
356
  end
357
+ nil
358
+ end
363
359
 
364
- # @example Request syntax with placeholder values
365
- #
366
- # instance.batch_enter_standby({
367
- # should_decrement_desired_capacity: false, # required
368
- # })
369
- # @param options ({})
370
- # @option options [required, Boolean] :should_decrement_desired_capacity
371
- # Specifies whether the instances moved to `Standby` mode count as part
372
- # of the Auto Scaling group's desired capacity. If set, the desired
373
- # capacity for the Auto Scaling group decrements by the number of
374
- # instances moved to `Standby` mode.
375
- # @return [void]
376
- def batch_enter_standby(options = {})
377
- batch_enum.each do |batch|
378
- params = Aws::Util.copy_hash(options)
379
- params[:auto_scaling_group_name] = batch[0].group_name
380
- params[:instance_ids] ||= []
381
- batch.each do |item|
382
- params[:instance_ids] << {
383
- id: item.id
384
- }
385
- end
386
- batch[0].client.enter_standby(params)
360
+ # @example Request syntax with placeholder values
361
+ #
362
+ # instance.batch_enter_standby({
363
+ # should_decrement_desired_capacity: false, # required
364
+ # })
365
+ # @param options ({})
366
+ # @option options [required, Boolean] :should_decrement_desired_capacity
367
+ # Specifies whether the instances moved to `Standby` mode count as part
368
+ # of the Auto Scaling group's desired capacity. If set, the desired
369
+ # capacity for the Auto Scaling group decrements by the number of
370
+ # instances moved to `Standby` mode.
371
+ # @return [void]
372
+ def batch_enter_standby(options = {})
373
+ batch_enum.each do |batch|
374
+ params = Aws::Util.copy_hash(options)
375
+ params[:auto_scaling_group_name] = batch[0].group_name
376
+ params[:instance_ids] ||= []
377
+ batch.each do |item|
378
+ params[:instance_ids] << {
379
+ id: item.id
380
+ }
387
381
  end
388
- nil
382
+ batch[0].client.enter_standby(params)
389
383
  end
384
+ nil
385
+ end
390
386
 
391
- # @example Request syntax with placeholder values
392
- #
393
- # instance.batch_exit_standby()
394
- # @param options ({})
395
- # @return [void]
396
- def batch_exit_standby(options = {})
397
- batch_enum.each do |batch|
398
- params = Aws::Util.copy_hash(options)
399
- params[:auto_scaling_group_name] = batch[0].group_name
400
- params[:instance_ids] ||= []
401
- batch.each do |item|
402
- params[:instance_ids] << {
403
- id: item.id
404
- }
405
- end
406
- batch[0].client.exit_standby(params)
387
+ # @param options ({})
388
+ # @return [void]
389
+ def batch_exit_standby(options = {})
390
+ batch_enum.each do |batch|
391
+ params = Aws::Util.copy_hash(options)
392
+ params[:auto_scaling_group_name] = batch[0].group_name
393
+ params[:instance_ids] ||= []
394
+ batch.each do |item|
395
+ params[:instance_ids] << {
396
+ id: item.id
397
+ }
407
398
  end
408
- nil
399
+ batch[0].client.exit_standby(params)
409
400
  end
401
+ nil
402
+ end
410
403
 
411
- # @!endgroup
404
+ # @!endgroup
412
405
 
413
- end
414
406
  end
415
407
  end
416
408
  end