aws-sdk-autoscaling 1.0.0.rc1 → 1.0.0.rc2
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.
- checksums.yaml +4 -4
- data/lib/aws-sdk-autoscaling.rb +2 -2
- data/lib/aws-sdk-autoscaling/activity.rb +131 -133
- data/lib/aws-sdk-autoscaling/auto_scaling_group.rb +940 -942
- data/lib/aws-sdk-autoscaling/client.rb +3146 -2674
- data/lib/aws-sdk-autoscaling/client_api.rb +1403 -1405
- data/lib/aws-sdk-autoscaling/errors.rb +4 -13
- data/lib/aws-sdk-autoscaling/instance.rb +351 -359
- data/lib/aws-sdk-autoscaling/launch_configuration.rb +198 -200
- data/lib/aws-sdk-autoscaling/lifecycle_hook.rb +288 -290
- data/lib/aws-sdk-autoscaling/load_balancer.rb +179 -187
- data/lib/aws-sdk-autoscaling/notification_configuration.rb +162 -167
- data/lib/aws-sdk-autoscaling/resource.rb +645 -647
- data/lib/aws-sdk-autoscaling/scaling_policy.rb +216 -218
- data/lib/aws-sdk-autoscaling/scheduled_action.rb +152 -154
- data/lib/aws-sdk-autoscaling/tag.rb +216 -224
- data/lib/aws-sdk-autoscaling/types.rb +3987 -3547
- data/lib/aws-sdk-autoscaling/waiters.rb +126 -127
- metadata +2 -2
@@ -1,23 +1,14 @@
|
|
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
|
-
module
|
10
|
-
module Errors
|
8
|
+
module Aws::AutoScaling
|
9
|
+
module Errors
|
11
10
|
|
12
|
-
|
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
|
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
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
29
|
+
# @!group Read-Only Attributes
|
31
30
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
# @return [String]
|
32
|
+
def group_name
|
33
|
+
@group_name
|
34
|
+
end
|
35
|
+
alias :auto_scaling_group_name :group_name
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
# @return [String]
|
38
|
+
def id
|
39
|
+
@id
|
40
|
+
end
|
41
|
+
alias :instance_id :id
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
# The Availability Zone for the instance.
|
44
|
+
# @return [String]
|
45
|
+
def availability_zone
|
46
|
+
data.availability_zone
|
47
|
+
end
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
-
|
82
|
+
# @!endgroup
|
84
83
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
# @return [Client]
|
85
|
+
def client
|
86
|
+
@client
|
87
|
+
end
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
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
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
-
|
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
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
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
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
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
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
batch
|
175
|
-
|
176
|
-
|
177
|
-
|
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
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
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
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
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
|
-
|
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
|
-
|
260
|
+
# @return [AutoScalingGroup]
|
261
|
+
def group
|
262
|
+
AutoScalingGroup.new(
|
263
|
+
name: @group_name,
|
264
|
+
client: @client
|
265
|
+
)
|
266
|
+
end
|
260
267
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
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
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
}
|
288
|
-
|
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
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
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
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
params[:
|
328
|
-
|
329
|
-
|
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
|
-
|
330
|
+
batch[0].client.attach_instances(params)
|
337
331
|
end
|
332
|
+
nil
|
333
|
+
end
|
338
334
|
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
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
|
-
|
355
|
+
batch[0].client.detach_instances(params)
|
362
356
|
end
|
357
|
+
nil
|
358
|
+
end
|
363
359
|
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
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
|
-
|
382
|
+
batch[0].client.enter_standby(params)
|
389
383
|
end
|
384
|
+
nil
|
385
|
+
end
|
390
386
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
params[:
|
400
|
-
|
401
|
-
|
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
|
-
|
399
|
+
batch[0].client.exit_standby(params)
|
409
400
|
end
|
401
|
+
nil
|
402
|
+
end
|
410
403
|
|
411
|
-
|
404
|
+
# @!endgroup
|
412
405
|
|
413
|
-
end
|
414
406
|
end
|
415
407
|
end
|
416
408
|
end
|