aws-sdk-cloudwatch 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-cloudwatch.rb +2 -2
- data/lib/aws-sdk-cloudwatch/alarm.rb +385 -386
- data/lib/aws-sdk-cloudwatch/client.rb +1125 -930
- data/lib/aws-sdk-cloudwatch/client_api.rb +415 -411
- data/lib/aws-sdk-cloudwatch/errors.rb +4 -13
- data/lib/aws-sdk-cloudwatch/metric.rb +417 -388
- data/lib/aws-sdk-cloudwatch/resource.rb +99 -101
- data/lib/aws-sdk-cloudwatch/types.rb +1129 -991
- data/lib/aws-sdk-cloudwatch/waiters.rb +34 -35
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1320a76999cf9b13afb99256ecc500df2bda6d7
|
4
|
+
data.tar.gz: 73feb079d0b938d2e5255a6f994c49493a968d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c016de4971ebbd09f2f8e9cb70624ecfb27188e65041702facf9766b9a028de6b0e4523ef48ab7fe977699b64a7b5cafebfd15e0a1a48a7957013865556b948
|
7
|
+
data.tar.gz: 9769b979d1284d0d8975b0d4b433a12c424dbb36a96e78890fd941a80e7c98f0d9e382df93a629547b68e3a9b9e0695736bf0fa6cde0cdab24bc3122ed92ab14
|
data/lib/aws-sdk-cloudwatch.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
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
|
@@ -45,6 +45,6 @@ require_relative 'aws-sdk-cloudwatch/customizations'
|
|
45
45
|
# @service
|
46
46
|
module Aws::CloudWatch
|
47
47
|
|
48
|
-
GEM_VERSION = '1.0.0.
|
48
|
+
GEM_VERSION = '1.0.0.rc2'
|
49
49
|
|
50
50
|
end
|
@@ -1,451 +1,450 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::CloudWatch
|
9
|
+
class Alarm
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
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 :alarm_name :name
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The Amazon Resource Name (ARN) of the alarm.
|
35
|
+
# @return [String]
|
36
|
+
def alarm_arn
|
37
|
+
data.alarm_arn
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The description of the alarm.
|
41
|
+
# @return [String]
|
42
|
+
def alarm_description
|
43
|
+
data.alarm_description
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The time stamp of the last update to the alarm configuration.
|
47
|
+
# @return [Time]
|
48
|
+
def alarm_configuration_updated_timestamp
|
49
|
+
data.alarm_configuration_updated_timestamp
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
52
|
+
# Indicates whether actions should be executed during any changes to the
|
53
|
+
# alarm state.
|
54
|
+
# @return [Boolean]
|
55
|
+
def actions_enabled
|
56
|
+
data.actions_enabled
|
57
|
+
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
# The actions to execute when this alarm transitions to the `OK` state
|
60
|
+
# from any other state. Each action is specified as an Amazon Resource
|
61
|
+
# Name (ARN).
|
62
|
+
# @return [Array<String>]
|
63
|
+
def ok_actions
|
64
|
+
data.ok_actions
|
65
|
+
end
|
67
66
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
67
|
+
# The actions to execute when this alarm transitions to the `ALARM`
|
68
|
+
# state from any other state. Each action is specified as an Amazon
|
69
|
+
# Resource Name (ARN).
|
70
|
+
# @return [Array<String>]
|
71
|
+
def alarm_actions
|
72
|
+
data.alarm_actions
|
73
|
+
end
|
75
74
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
75
|
+
# The actions to execute when this alarm transitions to the
|
76
|
+
# `INSUFFICIENT_DATA` state from any other state. Each action is
|
77
|
+
# specified as an Amazon Resource Name (ARN).
|
78
|
+
# @return [Array<String>]
|
79
|
+
def insufficient_data_actions
|
80
|
+
data.insufficient_data_actions
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
# The state value for the alarm.
|
84
|
+
# @return [String]
|
85
|
+
def state_value
|
86
|
+
data.state_value
|
87
|
+
end
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
# An explanation for the alarm state, in text format.
|
90
|
+
# @return [String]
|
91
|
+
def state_reason
|
92
|
+
data.state_reason
|
93
|
+
end
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
95
|
+
# An explanation for the alarm state, in JSON format.
|
96
|
+
# @return [String]
|
97
|
+
def state_reason_data
|
98
|
+
data.state_reason_data
|
99
|
+
end
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
101
|
+
# The time stamp of the last update to the alarm state.
|
102
|
+
# @return [Time]
|
103
|
+
def state_updated_timestamp
|
104
|
+
data.state_updated_timestamp
|
105
|
+
end
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
107
|
+
# The name of the metric associated with the alarm.
|
108
|
+
# @return [String]
|
109
|
+
def metric_name
|
110
|
+
data.metric_name
|
111
|
+
end
|
113
112
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
# The namespace of the metric associated with the alarm.
|
114
|
+
# @return [String]
|
115
|
+
def namespace
|
116
|
+
data.namespace
|
117
|
+
end
|
119
118
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
119
|
+
# The statistic for the metric associated with the alarm, other than
|
120
|
+
# percentile. For percentile statistics, use `ExtendedStatistic`.
|
121
|
+
# @return [String]
|
122
|
+
def statistic
|
123
|
+
data.statistic
|
124
|
+
end
|
126
125
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
126
|
+
# The percentile statistic for the metric associated with the alarm.
|
127
|
+
# Specify a value between p0.0 and p100.
|
128
|
+
# @return [String]
|
129
|
+
def extended_statistic
|
130
|
+
data.extended_statistic
|
131
|
+
end
|
133
132
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
133
|
+
# The dimensions for the metric associated with the alarm.
|
134
|
+
# @return [Array<Types::Dimension>]
|
135
|
+
def dimensions
|
136
|
+
data.dimensions
|
137
|
+
end
|
139
138
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
139
|
+
# The period, in seconds, over which the statistic is applied.
|
140
|
+
# @return [Integer]
|
141
|
+
def period
|
142
|
+
data.period
|
143
|
+
end
|
145
144
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
145
|
+
# The unit of the metric associated with the alarm.
|
146
|
+
# @return [String]
|
147
|
+
def unit
|
148
|
+
data.unit
|
149
|
+
end
|
151
150
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
151
|
+
# The number of periods over which data is compared to the specified
|
152
|
+
# threshold.
|
153
|
+
# @return [Integer]
|
154
|
+
def evaluation_periods
|
155
|
+
data.evaluation_periods
|
156
|
+
end
|
158
157
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
158
|
+
# The value to compare with the specified statistic.
|
159
|
+
# @return [Float]
|
160
|
+
def threshold
|
161
|
+
data.threshold
|
162
|
+
end
|
164
163
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
164
|
+
# The arithmetic operation to use when comparing the specified statistic
|
165
|
+
# and threshold. The specified statistic value is used as the first
|
166
|
+
# operand.
|
167
|
+
# @return [String]
|
168
|
+
def comparison_operator
|
169
|
+
data.comparison_operator
|
170
|
+
end
|
172
171
|
|
173
|
-
|
172
|
+
# @return [String]
|
173
|
+
def treat_missing_data
|
174
|
+
data.treat_missing_data
|
175
|
+
end
|
174
176
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
177
|
+
# @return [String]
|
178
|
+
def evaluate_low_sample_count_percentile
|
179
|
+
data.evaluate_low_sample_count_percentile
|
180
|
+
end
|
179
181
|
|
180
|
-
|
181
|
-
# Returns `self` making it possible to chain methods.
|
182
|
-
#
|
183
|
-
# alarm.reload.data
|
184
|
-
#
|
185
|
-
# @return [self]
|
186
|
-
def load
|
187
|
-
resp = @client.describe_alarms(alarm_names: [@name])
|
188
|
-
@data = resp.metricalarms[0]
|
189
|
-
self
|
190
|
-
end
|
191
|
-
alias :reload :load
|
192
|
-
|
193
|
-
# @return [Types::MetricAlarm]
|
194
|
-
# Returns the data for this {Alarm}. Calls
|
195
|
-
# {Client#describe_alarms} if {#data_loaded?} is `false`.
|
196
|
-
def data
|
197
|
-
load unless @data
|
198
|
-
@data
|
199
|
-
end
|
182
|
+
# @!endgroup
|
200
183
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
!!@data
|
206
|
-
end
|
184
|
+
# @return [Client]
|
185
|
+
def client
|
186
|
+
@client
|
187
|
+
end
|
207
188
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
189
|
+
# Loads, or reloads {#data} for the current {Alarm}.
|
190
|
+
# Returns `self` making it possible to chain methods.
|
191
|
+
#
|
192
|
+
# alarm.reload.data
|
193
|
+
#
|
194
|
+
# @return [self]
|
195
|
+
def load
|
196
|
+
resp = @client.describe_alarms(alarm_names: [@name])
|
197
|
+
@data = resp.metricalarms[0]
|
198
|
+
self
|
199
|
+
end
|
200
|
+
alias :reload :load
|
201
|
+
|
202
|
+
# @return [Types::MetricAlarm]
|
203
|
+
# Returns the data for this {Alarm}. Calls
|
204
|
+
# {Client#describe_alarms} if {#data_loaded?} is `false`.
|
205
|
+
def data
|
206
|
+
load unless @data
|
207
|
+
@data
|
208
|
+
end
|
221
209
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
def wait_until_exists(options = {})
|
229
|
-
options, params = separate_params_and_options(options)
|
230
|
-
waiter = Waiters::AlarmExists.new(options)
|
231
|
-
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
232
|
-
waiter.wait(params.merge(alarm_names: [@name]))
|
233
|
-
Alarm.new({
|
234
|
-
name: @name,
|
235
|
-
client: @client
|
236
|
-
})
|
237
|
-
end
|
210
|
+
# @return [Boolean]
|
211
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
212
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
213
|
+
def data_loaded?
|
214
|
+
!!@data
|
215
|
+
end
|
238
216
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
217
|
+
# @param [Hash] options ({})
|
218
|
+
# @return [Boolean]
|
219
|
+
# Returns `true` if the Alarm exists.
|
220
|
+
def exists?(options = {})
|
221
|
+
begin
|
222
|
+
wait_until_exists(options.merge(max_attempts: 1))
|
223
|
+
true
|
224
|
+
rescue Aws::Waiters::Errors::UnexpectedError => e
|
225
|
+
raise e.error
|
226
|
+
rescue Aws::Waiters::Errors::WaiterFailed
|
227
|
+
false
|
250
228
|
end
|
229
|
+
end
|
251
230
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
# @option options [Integer] :max_records
|
269
|
-
# The maximum number of alarm history records to retrieve.
|
270
|
-
# @option options [String] :next_token
|
271
|
-
# The token returned by a previous call to indicate that there is more
|
272
|
-
# data available.
|
273
|
-
# @return [Types::DescribeAlarmHistoryOutput]
|
274
|
-
def describe_history(options = {})
|
275
|
-
options = options.merge(alarm_name: @name)
|
276
|
-
resp = @client.describe_alarm_history(options)
|
277
|
-
resp.data
|
278
|
-
end
|
231
|
+
# @param [Hash] options ({})
|
232
|
+
# @option options [Integer] :max_attempts (40)
|
233
|
+
# @option options [Float] :delay (5)
|
234
|
+
# @option options [Proc] :before_attempt
|
235
|
+
# @option options [Proc] :before_wait
|
236
|
+
# @return [Alarm]
|
237
|
+
def wait_until_exists(options = {})
|
238
|
+
options, params = separate_params_and_options(options)
|
239
|
+
waiter = Waiters::AlarmExists.new(options)
|
240
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
241
|
+
waiter.wait(params.merge(alarm_names: [@name]))
|
242
|
+
Alarm.new({
|
243
|
+
name: @name,
|
244
|
+
client: @client
|
245
|
+
})
|
246
|
+
end
|
279
247
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
248
|
+
# @!group Actions
|
249
|
+
|
250
|
+
# @example Request syntax with placeholder values
|
251
|
+
#
|
252
|
+
# alarm.delete()
|
253
|
+
# @param [Hash] options ({})
|
254
|
+
# @return [EmptyStructure]
|
255
|
+
def delete(options = {})
|
256
|
+
options = Aws::Util.deep_merge(options, alarm_names: [@name])
|
257
|
+
resp = @client.delete_alarms(options)
|
258
|
+
resp.data
|
259
|
+
end
|
290
260
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
261
|
+
# @example Request syntax with placeholder values
|
262
|
+
#
|
263
|
+
# alarm.describe_history({
|
264
|
+
# history_item_type: "ConfigurationUpdate", # accepts ConfigurationUpdate, StateUpdate, Action
|
265
|
+
# start_date: Time.now,
|
266
|
+
# end_date: Time.now,
|
267
|
+
# max_records: 1,
|
268
|
+
# next_token: "NextToken",
|
269
|
+
# })
|
270
|
+
# @param [Hash] options ({})
|
271
|
+
# @option options [String] :history_item_type
|
272
|
+
# The type of alarm histories to retrieve.
|
273
|
+
# @option options [Time,DateTime,Date,Integer,String] :start_date
|
274
|
+
# The starting date to retrieve alarm history.
|
275
|
+
# @option options [Time,DateTime,Date,Integer,String] :end_date
|
276
|
+
# The ending date to retrieve alarm history.
|
277
|
+
# @option options [Integer] :max_records
|
278
|
+
# The maximum number of alarm history records to retrieve.
|
279
|
+
# @option options [String] :next_token
|
280
|
+
# The token returned by a previous call to indicate that there is more
|
281
|
+
# data available.
|
282
|
+
# @return [Types::DescribeAlarmHistoryOutput]
|
283
|
+
def describe_history(options = {})
|
284
|
+
options = options.merge(alarm_name: @name)
|
285
|
+
resp = @client.describe_alarm_history(options)
|
286
|
+
resp.data
|
287
|
+
end
|
301
288
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
# @option options [required, String] :state_reason
|
313
|
-
# The reason that this alarm is set to this specific state, in text
|
314
|
-
# format.
|
315
|
-
# @option options [String] :state_reason_data
|
316
|
-
# The reason that this alarm is set to this specific state, in JSON
|
317
|
-
# format.
|
318
|
-
# @return [EmptyStructure]
|
319
|
-
def set_state(options = {})
|
320
|
-
options = options.merge(alarm_name: @name)
|
321
|
-
resp = @client.set_alarm_state(options)
|
322
|
-
resp.data
|
323
|
-
end
|
289
|
+
# @example Request syntax with placeholder values
|
290
|
+
#
|
291
|
+
# alarm.disable_actions()
|
292
|
+
# @param [Hash] options ({})
|
293
|
+
# @return [EmptyStructure]
|
294
|
+
def disable_actions(options = {})
|
295
|
+
options = Aws::Util.deep_merge(options, alarm_names: [@name])
|
296
|
+
resp = @client.disable_alarm_actions(options)
|
297
|
+
resp.data
|
298
|
+
end
|
324
299
|
|
325
|
-
|
300
|
+
# @example Request syntax with placeholder values
|
301
|
+
#
|
302
|
+
# alarm.enable_actions()
|
303
|
+
# @param [Hash] options ({})
|
304
|
+
# @return [EmptyStructure]
|
305
|
+
def enable_actions(options = {})
|
306
|
+
options = Aws::Util.deep_merge(options, alarm_names: [@name])
|
307
|
+
resp = @client.enable_alarm_actions(options)
|
308
|
+
resp.data
|
309
|
+
end
|
326
310
|
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
311
|
+
# @example Request syntax with placeholder values
|
312
|
+
#
|
313
|
+
# alarm.set_state({
|
314
|
+
# state_value: "OK", # required, accepts OK, ALARM, INSUFFICIENT_DATA
|
315
|
+
# state_reason: "StateReason", # required
|
316
|
+
# state_reason_data: "StateReasonData",
|
317
|
+
# })
|
318
|
+
# @param [Hash] options ({})
|
319
|
+
# @option options [required, String] :state_value
|
320
|
+
# The value of the state.
|
321
|
+
# @option options [required, String] :state_reason
|
322
|
+
# The reason that this alarm is set to this specific state, in text
|
323
|
+
# format.
|
324
|
+
# @option options [String] :state_reason_data
|
325
|
+
# The reason that this alarm is set to this specific state, in JSON
|
326
|
+
# format.
|
327
|
+
# @return [EmptyStructure]
|
328
|
+
def set_state(options = {})
|
329
|
+
options = options.merge(alarm_name: @name)
|
330
|
+
resp = @client.set_alarm_state(options)
|
331
|
+
resp.data
|
332
|
+
end
|
339
333
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
334
|
+
# @!group Associations
|
335
|
+
|
336
|
+
# @return [Metric, nil]
|
337
|
+
def metric
|
338
|
+
if data.namespace && data.metric_name
|
339
|
+
Metric.new(
|
340
|
+
namespace: data.namespace,
|
341
|
+
name: data.metric_name,
|
342
|
+
client: @client
|
343
|
+
)
|
344
|
+
else
|
345
|
+
nil
|
344
346
|
end
|
345
|
-
|
347
|
+
end
|
346
348
|
|
347
|
-
|
349
|
+
# @deprecated
|
350
|
+
# @api private
|
351
|
+
def identifiers
|
352
|
+
{ name: @name }
|
353
|
+
end
|
354
|
+
deprecated(:identifiers)
|
348
355
|
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
356
|
+
private
|
357
|
+
|
358
|
+
def extract_name(args, options)
|
359
|
+
value = args[0] || options.delete(:name)
|
360
|
+
case value
|
361
|
+
when String then value
|
362
|
+
when nil then raise ArgumentError, "missing required option :name"
|
363
|
+
else
|
364
|
+
msg = "expected :name to be a String, got #{value.class}"
|
365
|
+
raise ArgumentError, msg
|
358
366
|
end
|
367
|
+
end
|
359
368
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
end
|
367
|
-
yield(waiter.waiter)
|
369
|
+
def yield_waiter_and_warn(waiter, &block)
|
370
|
+
if !@waiter_block_warned
|
371
|
+
msg = "pass options to configure the waiter; "
|
372
|
+
msg << "yielding the waiter is deprecated"
|
373
|
+
warn(msg)
|
374
|
+
@waiter_block_warned = true
|
368
375
|
end
|
376
|
+
yield(waiter.waiter)
|
377
|
+
end
|
369
378
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
end
|
379
|
+
def separate_params_and_options(options)
|
380
|
+
opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
|
381
|
+
waiter_opts = {}
|
382
|
+
waiter_params = {}
|
383
|
+
options.each_pair do |key, value|
|
384
|
+
if opts.include?(key)
|
385
|
+
waiter_opts[key] = value
|
386
|
+
else
|
387
|
+
waiter_params[key] = value
|
380
388
|
end
|
381
|
-
waiter_opts[:client] ||= @client
|
382
|
-
[waiter_opts, waiter_params]
|
383
389
|
end
|
390
|
+
waiter_opts[:client] ||= @client
|
391
|
+
[waiter_opts, waiter_params]
|
392
|
+
end
|
393
|
+
|
394
|
+
class Collection < Aws::Resources::Collection
|
395
|
+
|
396
|
+
# @!group Batch Actions
|
384
397
|
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
batch_enum.each do |batch|
|
396
|
-
params = Aws::Util.copy_hash(options)
|
397
|
-
params[:alarm_names] ||= []
|
398
|
-
batch.each do |item|
|
399
|
-
params[:alarm_names] << {
|
400
|
-
name: item.name
|
401
|
-
}
|
402
|
-
end
|
403
|
-
batch[0].client.delete_alarms(params)
|
398
|
+
# @param options ({})
|
399
|
+
# @return [void]
|
400
|
+
def batch_delete!(options = {})
|
401
|
+
batch_enum.each do |batch|
|
402
|
+
params = Aws::Util.copy_hash(options)
|
403
|
+
params[:alarm_names] ||= []
|
404
|
+
batch.each do |item|
|
405
|
+
params[:alarm_names] << {
|
406
|
+
name: item.name
|
407
|
+
}
|
404
408
|
end
|
405
|
-
|
409
|
+
batch[0].client.delete_alarms(params)
|
406
410
|
end
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
}
|
421
|
-
end
|
422
|
-
batch[0].client.disable_alarm_actions(params)
|
411
|
+
nil
|
412
|
+
end
|
413
|
+
|
414
|
+
# @param options ({})
|
415
|
+
# @return [void]
|
416
|
+
def batch_disable_actions(options = {})
|
417
|
+
batch_enum.each do |batch|
|
418
|
+
params = Aws::Util.copy_hash(options)
|
419
|
+
params[:alarm_names] ||= []
|
420
|
+
batch.each do |item|
|
421
|
+
params[:alarm_names] << {
|
422
|
+
name: item.name
|
423
|
+
}
|
423
424
|
end
|
424
|
-
|
425
|
+
batch[0].client.disable_alarm_actions(params)
|
425
426
|
end
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
}
|
440
|
-
end
|
441
|
-
batch[0].client.enable_alarm_actions(params)
|
427
|
+
nil
|
428
|
+
end
|
429
|
+
|
430
|
+
# @param options ({})
|
431
|
+
# @return [void]
|
432
|
+
def batch_enable_actions(options = {})
|
433
|
+
batch_enum.each do |batch|
|
434
|
+
params = Aws::Util.copy_hash(options)
|
435
|
+
params[:alarm_names] ||= []
|
436
|
+
batch.each do |item|
|
437
|
+
params[:alarm_names] << {
|
438
|
+
name: item.name
|
439
|
+
}
|
442
440
|
end
|
443
|
-
|
441
|
+
batch[0].client.enable_alarm_actions(params)
|
444
442
|
end
|
443
|
+
nil
|
444
|
+
end
|
445
445
|
|
446
|
-
|
446
|
+
# @!endgroup
|
447
447
|
|
448
|
-
end
|
449
448
|
end
|
450
449
|
end
|
451
450
|
end
|