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.
- 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,258 +1,256 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class ScalingPolicy
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class ScalingPolicy
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
# @overload def initialize(name, options = {})
|
14
|
+
# @param [String] name
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :name
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@name = extract_name(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def name
|
30
|
+
@name
|
31
|
+
end
|
32
|
+
alias :policy_name :name
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
34
|
+
# The name of the Auto Scaling group associated with this scaling
|
35
|
+
# policy.
|
36
|
+
# @return [String]
|
37
|
+
def auto_scaling_group_name
|
38
|
+
data.auto_scaling_group_name
|
39
|
+
end
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
# The Amazon Resource Name (ARN) of the policy.
|
42
|
+
# @return [String]
|
43
|
+
def policy_arn
|
44
|
+
data.policy_arn
|
45
|
+
end
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
# The policy type. Valid values are `SimpleScaling` and `StepScaling`.
|
48
|
+
# @return [String]
|
49
|
+
def policy_type
|
50
|
+
data.policy_type
|
51
|
+
end
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
# The adjustment type, which specifies how `ScalingAdjustment` is
|
54
|
+
# interpreted. Valid values are `ChangeInCapacity`, `ExactCapacity`, and
|
55
|
+
# `PercentChangeInCapacity`.
|
56
|
+
# @return [String]
|
57
|
+
def adjustment_type
|
58
|
+
data.adjustment_type
|
59
|
+
end
|
61
60
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
61
|
+
# Available for backward compatibility. Use `MinAdjustmentMagnitude`
|
62
|
+
# instead.
|
63
|
+
# @return [Integer]
|
64
|
+
def min_adjustment_step
|
65
|
+
data.min_adjustment_step
|
66
|
+
end
|
68
67
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
68
|
+
# The minimum number of instances to scale. If the value of
|
69
|
+
# `AdjustmentType` is `PercentChangeInCapacity`, the scaling policy
|
70
|
+
# changes the `DesiredCapacity` of the Auto Scaling group by at least
|
71
|
+
# this many instances. Otherwise, the error is `ValidationError`.
|
72
|
+
# @return [Integer]
|
73
|
+
def min_adjustment_magnitude
|
74
|
+
data.min_adjustment_magnitude
|
75
|
+
end
|
77
76
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
77
|
+
# The amount by which to scale, based on the specified adjustment type.
|
78
|
+
# A positive value adds to the current capacity while a negative number
|
79
|
+
# removes from the current capacity.
|
80
|
+
# @return [Integer]
|
81
|
+
def scaling_adjustment
|
82
|
+
data.scaling_adjustment
|
83
|
+
end
|
85
84
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
85
|
+
# The amount of time, in seconds, after a scaling activity completes
|
86
|
+
# before any further trigger-related scaling activities can start.
|
87
|
+
# @return [Integer]
|
88
|
+
def cooldown
|
89
|
+
data.cooldown
|
90
|
+
end
|
92
91
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
92
|
+
# A set of adjustments that enable you to scale based on the size of the
|
93
|
+
# alarm breach.
|
94
|
+
# @return [Array<Types::StepAdjustment>]
|
95
|
+
def step_adjustments
|
96
|
+
data.step_adjustments
|
97
|
+
end
|
99
98
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
99
|
+
# The aggregation type for the CloudWatch metrics. Valid values are
|
100
|
+
# `Minimum`, `Maximum`, and `Average`.
|
101
|
+
# @return [String]
|
102
|
+
def metric_aggregation_type
|
103
|
+
data.metric_aggregation_type
|
104
|
+
end
|
106
105
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
106
|
+
# The estimated time, in seconds, until a newly launched instance can
|
107
|
+
# contribute to the CloudWatch metrics.
|
108
|
+
# @return [Integer]
|
109
|
+
def estimated_instance_warmup
|
110
|
+
data.estimated_instance_warmup
|
111
|
+
end
|
113
112
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
# The CloudWatch alarms related to the policy.
|
114
|
+
# @return [Array<Types::Alarm>]
|
115
|
+
def alarms
|
116
|
+
data.alarms
|
117
|
+
end
|
119
118
|
|
120
|
-
|
119
|
+
# @!endgroup
|
121
120
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
121
|
+
# @return [Client]
|
122
|
+
def client
|
123
|
+
@client
|
124
|
+
end
|
126
125
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
126
|
+
# Loads, or reloads {#data} for the current {ScalingPolicy}.
|
127
|
+
# Returns `self` making it possible to chain methods.
|
128
|
+
#
|
129
|
+
# scaling_policy.reload.data
|
130
|
+
#
|
131
|
+
# @return [self]
|
132
|
+
def load
|
133
|
+
resp = @client.describe_policies(policy_names: [@name])
|
134
|
+
@data = resp.scalingpolicies[0]
|
135
|
+
self
|
136
|
+
end
|
137
|
+
alias :reload :load
|
139
138
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
139
|
+
# @return [Types::ScalingPolicy]
|
140
|
+
# Returns the data for this {ScalingPolicy}. Calls
|
141
|
+
# {Client#describe_policies} if {#data_loaded?} is `false`.
|
142
|
+
def data
|
143
|
+
load unless @data
|
144
|
+
@data
|
145
|
+
end
|
147
146
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
147
|
+
# @return [Boolean]
|
148
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
149
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
150
|
+
def data_loaded?
|
151
|
+
!!@data
|
152
|
+
end
|
154
153
|
|
155
|
-
|
154
|
+
# @!group Actions
|
156
155
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
156
|
+
# @example Request syntax with placeholder values
|
157
|
+
#
|
158
|
+
# scaling_policy.delete({
|
159
|
+
# auto_scaling_group_name: "ResourceName",
|
160
|
+
# })
|
161
|
+
# @param [Hash] options ({})
|
162
|
+
# @option options [String] :auto_scaling_group_name
|
163
|
+
# The name of the Auto Scaling group.
|
164
|
+
# @return [EmptyStructure]
|
165
|
+
def delete(options = {})
|
166
|
+
options = options.merge(policy_name: @name)
|
167
|
+
resp = @client.delete_policy(options)
|
168
|
+
resp.data
|
169
|
+
end
|
171
170
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
171
|
+
# @example Request syntax with placeholder values
|
172
|
+
#
|
173
|
+
# scaling_policy.execute({
|
174
|
+
# auto_scaling_group_name: "ResourceName",
|
175
|
+
# honor_cooldown: false,
|
176
|
+
# metric_value: 1.0,
|
177
|
+
# breach_threshold: 1.0,
|
178
|
+
# })
|
179
|
+
# @param [Hash] options ({})
|
180
|
+
# @option options [String] :auto_scaling_group_name
|
181
|
+
# The name or Amazon Resource Name (ARN) of the Auto Scaling group.
|
182
|
+
# @option options [Boolean] :honor_cooldown
|
183
|
+
# If this parameter is true, Auto Scaling waits for the cooldown period
|
184
|
+
# to complete before executing the policy. Otherwise, Auto Scaling
|
185
|
+
# executes the policy without waiting for the cooldown period to
|
186
|
+
# complete.
|
187
|
+
#
|
188
|
+
# This parameter is not supported if the policy type is `StepScaling`.
|
189
|
+
#
|
190
|
+
# For more information, see [Auto Scaling Cooldowns][1] in the *Auto
|
191
|
+
# Scaling User Guide*.
|
192
|
+
#
|
193
|
+
#
|
194
|
+
#
|
195
|
+
# [1]: http://docs.aws.amazon.com/autoscaling/latest/userguide/Cooldown.html
|
196
|
+
# @option options [Float] :metric_value
|
197
|
+
# The metric value to compare to `BreachThreshold`. This enables you to
|
198
|
+
# execute a policy of type `StepScaling` and determine which step
|
199
|
+
# adjustment to use. For example, if the breach threshold is 50 and you
|
200
|
+
# want to use a step adjustment with a lower bound of 0 and an upper
|
201
|
+
# bound of 10, you can set the metric value to 59.
|
202
|
+
#
|
203
|
+
# If you specify a metric value that doesn't correspond to a step
|
204
|
+
# adjustment for the policy, the call returns an error.
|
205
|
+
#
|
206
|
+
# This parameter is required if the policy type is `StepScaling` and not
|
207
|
+
# supported otherwise.
|
208
|
+
# @option options [Float] :breach_threshold
|
209
|
+
# The breach threshold for the alarm.
|
210
|
+
#
|
211
|
+
# This parameter is required if the policy type is `StepScaling` and not
|
212
|
+
# supported otherwise.
|
213
|
+
# @return [EmptyStructure]
|
214
|
+
def execute(options = {})
|
215
|
+
options = options.merge(policy_name: @name)
|
216
|
+
resp = @client.execute_policy(options)
|
217
|
+
resp.data
|
218
|
+
end
|
220
219
|
|
221
|
-
|
220
|
+
# @!group Associations
|
222
221
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
end
|
222
|
+
# @return [AutoScalingGroup, nil]
|
223
|
+
def group
|
224
|
+
if data.auto_scaling_group_name
|
225
|
+
AutoScalingGroup.new(
|
226
|
+
name: data.auto_scaling_group_name,
|
227
|
+
client: @client
|
228
|
+
)
|
229
|
+
else
|
230
|
+
nil
|
233
231
|
end
|
232
|
+
end
|
234
233
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
234
|
+
# @deprecated
|
235
|
+
# @api private
|
236
|
+
def identifiers
|
237
|
+
{ name: @name }
|
238
|
+
end
|
239
|
+
deprecated(:identifiers)
|
241
240
|
|
242
|
-
|
241
|
+
private
|
243
242
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
end
|
243
|
+
def extract_name(args, options)
|
244
|
+
value = args[0] || options.delete(:name)
|
245
|
+
case value
|
246
|
+
when String then value
|
247
|
+
when nil then raise ArgumentError, "missing required option :name"
|
248
|
+
else
|
249
|
+
msg = "expected :name to be a String, got #{value.class}"
|
250
|
+
raise ArgumentError, msg
|
253
251
|
end
|
254
|
-
|
255
|
-
class Collection < Aws::Resources::Collection; end
|
256
252
|
end
|
253
|
+
|
254
|
+
class Collection < Aws::Resources::Collection; end
|
257
255
|
end
|
258
256
|
end
|