aws-sdk-rds 1.0.0.rc2 → 1.0.0.rc3
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-rds.rb +2 -2
- data/lib/aws-sdk-rds/account_quota.rb +79 -81
- data/lib/aws-sdk-rds/certificate.rb +99 -101
- data/lib/aws-sdk-rds/client.rb +10575 -9119
- data/lib/aws-sdk-rds/client_api.rb +3049 -3023
- data/lib/aws-sdk-rds/db_cluster.rb +1005 -1007
- data/lib/aws-sdk-rds/db_cluster_parameter_group.rb +204 -206
- data/lib/aws-sdk-rds/db_cluster_snapshot.rb +430 -432
- data/lib/aws-sdk-rds/db_engine.rb +208 -210
- data/lib/aws-sdk-rds/db_engine_version.rb +218 -219
- data/lib/aws-sdk-rds/db_instance.rb +2747 -2567
- data/lib/aws-sdk-rds/db_log_file.rb +145 -147
- data/lib/aws-sdk-rds/db_parameter_group.rb +411 -413
- data/lib/aws-sdk-rds/db_parameter_group_family.rb +135 -137
- data/lib/aws-sdk-rds/db_security_group.rb +316 -318
- data/lib/aws-sdk-rds/db_snapshot.rb +705 -650
- data/lib/aws-sdk-rds/db_snapshot_attribute.rb +137 -139
- data/lib/aws-sdk-rds/db_subnet_group.rb +161 -163
- data/lib/aws-sdk-rds/errors.rb +4 -13
- data/lib/aws-sdk-rds/event.rb +108 -110
- data/lib/aws-sdk-rds/event_category_map.rb +73 -75
- data/lib/aws-sdk-rds/event_subscription.rb +313 -315
- data/lib/aws-sdk-rds/option_group.rb +247 -249
- data/lib/aws-sdk-rds/option_group_option.rb +135 -137
- data/lib/aws-sdk-rds/parameter.rb +116 -118
- data/lib/aws-sdk-rds/pending_maintenance_action.rb +182 -184
- data/lib/aws-sdk-rds/plugins/cross_region_copying.rb +64 -0
- data/lib/aws-sdk-rds/reserved_db_instance.rb +156 -158
- data/lib/aws-sdk-rds/reserved_db_instances_offering.rb +154 -156
- data/lib/aws-sdk-rds/resource.rb +2395 -2288
- data/lib/aws-sdk-rds/resource_pending_maintenance_action_list.rb +89 -91
- data/lib/aws-sdk-rds/types.rb +12091 -10977
- data/lib/aws-sdk-rds/waiters.rb +127 -128
- metadata +3 -2
@@ -1,714 +1,769 @@
|
|
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::RDS
|
9
|
+
class DBSnapshot
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(instance_id, snapshot_id, options = {})
|
14
|
+
# @param [String] instance_id
|
15
|
+
# @param [String] snapshot_id
|
16
|
+
# @option options [Client] :client
|
17
|
+
# @overload def initialize(options = {})
|
18
|
+
# @option options [required, String] :instance_id
|
19
|
+
# @option options [required, String] :snapshot_id
|
20
|
+
# @option options [Client] :client
|
21
|
+
def initialize(*args)
|
22
|
+
options = Hash === args.last ? args.pop.dup : {}
|
23
|
+
@instance_id = extract_instance_id(args, options)
|
24
|
+
@snapshot_id = extract_snapshot_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 instance_id
|
33
|
+
@instance_id
|
34
|
+
end
|
35
|
+
alias :db_instance_identifier :instance_id
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
# @return [String]
|
38
|
+
def snapshot_id
|
39
|
+
@snapshot_id
|
40
|
+
end
|
41
|
+
alias :db_snapshot_identifier :snapshot_id
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
# Provides the time when the snapshot was taken, in Universal
|
44
|
+
# Coordinated Time (UTC).
|
45
|
+
# @return [Time]
|
46
|
+
def snapshot_create_time
|
47
|
+
data.snapshot_create_time
|
48
|
+
end
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
# Specifies the name of the database engine.
|
51
|
+
# @return [String]
|
52
|
+
def engine
|
53
|
+
data.engine
|
54
|
+
end
|
56
55
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
# Specifies the allocated storage size in gigabytes (GB).
|
57
|
+
# @return [Integer]
|
58
|
+
def allocated_storage
|
59
|
+
data.allocated_storage
|
60
|
+
end
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
62
|
+
# Specifies the status of this DB snapshot.
|
63
|
+
# @return [String]
|
64
|
+
def status
|
65
|
+
data.status
|
66
|
+
end
|
68
67
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
# Specifies the port that the database engine was listening on at the
|
69
|
+
# time of the snapshot.
|
70
|
+
# @return [Integer]
|
71
|
+
def port
|
72
|
+
data.port
|
73
|
+
end
|
75
74
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
75
|
+
# Specifies the name of the Availability Zone the DB instance was
|
76
|
+
# located in at the time of the DB snapshot.
|
77
|
+
# @return [String]
|
78
|
+
def availability_zone
|
79
|
+
data.availability_zone
|
80
|
+
end
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
# Provides the VPC ID associated with the DB snapshot.
|
83
|
+
# @return [String]
|
84
|
+
def vpc_id
|
85
|
+
data.vpc_id
|
86
|
+
end
|
88
87
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
88
|
+
# Specifies the time when the snapshot was taken, in Universal
|
89
|
+
# Coordinated Time (UTC).
|
90
|
+
# @return [Time]
|
91
|
+
def instance_create_time
|
92
|
+
data.instance_create_time
|
93
|
+
end
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
95
|
+
# Provides the master username for the DB snapshot.
|
96
|
+
# @return [String]
|
97
|
+
def master_username
|
98
|
+
data.master_username
|
99
|
+
end
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
101
|
+
# Specifies the version of the database engine.
|
102
|
+
# @return [String]
|
103
|
+
def engine_version
|
104
|
+
data.engine_version
|
105
|
+
end
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
107
|
+
# License model information for the restored DB instance.
|
108
|
+
# @return [String]
|
109
|
+
def license_model
|
110
|
+
data.license_model
|
111
|
+
end
|
113
112
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
# Provides the type of the DB snapshot.
|
114
|
+
# @return [String]
|
115
|
+
def snapshot_type
|
116
|
+
data.snapshot_type
|
117
|
+
end
|
119
118
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
119
|
+
# Specifies the Provisioned IOPS (I/O operations per second) value of
|
120
|
+
# the DB instance at the time of the snapshot.
|
121
|
+
# @return [Integer]
|
122
|
+
def iops
|
123
|
+
data.iops
|
124
|
+
end
|
126
125
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
# Provides the option group name for the DB snapshot.
|
127
|
+
# @return [String]
|
128
|
+
def option_group_name
|
129
|
+
data.option_group_name
|
130
|
+
end
|
132
131
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
132
|
+
# The percentage of the estimated data that has been transferred.
|
133
|
+
# @return [Integer]
|
134
|
+
def percent_progress
|
135
|
+
data.percent_progress
|
136
|
+
end
|
138
137
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
138
|
+
# The region that the DB snapshot was created in or copied from.
|
139
|
+
# @return [String]
|
140
|
+
def source_region
|
141
|
+
data.source_region
|
142
|
+
end
|
144
143
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
144
|
+
# The DB snapshot Arn that the DB snapshot was copied from. It only has
|
145
|
+
# value in case of cross customer or cross region copy.
|
146
|
+
# @return [String]
|
147
|
+
def source_db_snapshot_identifier
|
148
|
+
data.source_db_snapshot_identifier
|
149
|
+
end
|
151
150
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
151
|
+
# Specifies the storage type associated with DB snapshot.
|
152
|
+
# @return [String]
|
153
|
+
def storage_type
|
154
|
+
data.storage_type
|
155
|
+
end
|
157
156
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
157
|
+
# The ARN from the key store with which to associate the instance for
|
158
|
+
# TDE encryption.
|
159
|
+
# @return [String]
|
160
|
+
def tde_credential_arn
|
161
|
+
data.tde_credential_arn
|
162
|
+
end
|
164
163
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
164
|
+
# Specifies whether the DB snapshot is encrypted.
|
165
|
+
# @return [Boolean]
|
166
|
+
def encrypted
|
167
|
+
data.encrypted
|
168
|
+
end
|
170
169
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
170
|
+
# If `Encrypted` is true, the KMS key identifier for the encrypted DB
|
171
|
+
# snapshot.
|
172
|
+
# @return [String]
|
173
|
+
def kms_key_id
|
174
|
+
data.kms_key_id
|
175
|
+
end
|
177
176
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
177
|
+
# The Amazon Resource Name (ARN) for the DB snapshot.
|
178
|
+
# @return [String]
|
179
|
+
def db_snapshot_arn
|
180
|
+
data.db_snapshot_arn
|
181
|
+
end
|
183
182
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
183
|
+
# The time zone of the DB snapshot. In most cases, the `Timezone`
|
184
|
+
# element is empty. `Timezone` content appears only for snapshots taken
|
185
|
+
# from Microsoft SQL Server DB instances that were created with a time
|
186
|
+
# zone specified.
|
187
|
+
# @return [String]
|
188
|
+
def timezone
|
189
|
+
data.timezone
|
190
|
+
end
|
192
191
|
|
193
|
-
|
192
|
+
# @!endgroup
|
194
193
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
194
|
+
# @return [Client]
|
195
|
+
def client
|
196
|
+
@client
|
197
|
+
end
|
199
198
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
199
|
+
# Loads, or reloads {#data} for the current {DBSnapshot}.
|
200
|
+
# Returns `self` making it possible to chain methods.
|
201
|
+
#
|
202
|
+
# db_snapshot.reload.data
|
203
|
+
#
|
204
|
+
# @return [self]
|
205
|
+
def load
|
206
|
+
resp = @client.describe_db_snapshots(db_snapshot_identifier: @snapshot_id)
|
207
|
+
@data = resp.dbsnapshots[0]
|
208
|
+
self
|
209
|
+
end
|
210
|
+
alias :reload :load
|
211
|
+
|
212
|
+
# @return [Types::DBSnapshot]
|
213
|
+
# Returns the data for this {DBSnapshot}. Calls
|
214
|
+
# {Client#describe_db_snapshots} if {#data_loaded?} is `false`.
|
215
|
+
def data
|
216
|
+
load unless @data
|
217
|
+
@data
|
218
|
+
end
|
220
219
|
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
220
|
+
# @return [Boolean]
|
221
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
222
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
223
|
+
def data_loaded?
|
224
|
+
!!@data
|
225
|
+
end
|
227
226
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
227
|
+
# @!group Actions
|
228
|
+
|
229
|
+
# @example Request syntax with placeholder values
|
230
|
+
#
|
231
|
+
# dbsnapshot = db_snapshot.create({
|
232
|
+
# tags: [
|
233
|
+
# {
|
234
|
+
# key: "String",
|
235
|
+
# value: "String",
|
236
|
+
# },
|
237
|
+
# ],
|
238
|
+
# })
|
239
|
+
# @param [Hash] options ({})
|
240
|
+
# @option options [Array<Types::Tag>] :tags
|
241
|
+
# A list of tags.
|
242
|
+
# @return [DBSnapshot]
|
243
|
+
def create(options = {})
|
244
|
+
options = options.merge(
|
245
|
+
db_instance_identifier: @instance_id,
|
246
|
+
db_snapshot_identifier: @snapshot_id
|
247
|
+
)
|
248
|
+
resp = @client.create_db_snapshot(options)
|
249
|
+
DBSnapshot.new(
|
250
|
+
instance_id: resp.data.db_snapshot.db_instance_identifier,
|
251
|
+
snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
|
252
|
+
data: resp.data.db_snapshot,
|
253
|
+
client: @client
|
254
|
+
)
|
255
|
+
end
|
257
256
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
257
|
+
# @example Request syntax with placeholder values
|
258
|
+
#
|
259
|
+
# dbsnapshot = db_snapshot.copy({
|
260
|
+
# target_db_snapshot_identifier: "String", # required
|
261
|
+
# kms_key_id: "String",
|
262
|
+
# tags: [
|
263
|
+
# {
|
264
|
+
# key: "String",
|
265
|
+
# value: "String",
|
266
|
+
# },
|
267
|
+
# ],
|
268
|
+
# copy_tags: false,
|
269
|
+
# pre_signed_url: "String",
|
270
|
+
# destination_region: "String",
|
271
|
+
# })
|
272
|
+
# @param [Hash] options ({})
|
273
|
+
# @option options [required, String] :target_db_snapshot_identifier
|
274
|
+
# The identifier for the copied snapshot.
|
275
|
+
#
|
276
|
+
# Constraints:
|
277
|
+
#
|
278
|
+
# * Cannot be null, empty, or blank
|
279
|
+
#
|
280
|
+
# * Must contain from 1 to 255 alphanumeric characters or hyphens
|
281
|
+
#
|
282
|
+
# * First character must be a letter
|
283
|
+
#
|
284
|
+
# * Cannot end with a hyphen or contain two consecutive hyphens
|
285
|
+
#
|
286
|
+
# Example: `my-db-snapshot`
|
287
|
+
# @option options [String] :kms_key_id
|
288
|
+
# The AWS KMS key ID for an encrypted DB snapshot. The KMS key ID is the
|
289
|
+
# Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias
|
290
|
+
# for the KMS encryption key.
|
291
|
+
#
|
292
|
+
# If you copy an unencrypted DB snapshot and specify a value for the
|
293
|
+
# `KmsKeyId` parameter, Amazon RDS encrypts the target DB snapshot using
|
294
|
+
# the specified KMS encryption key.
|
295
|
+
#
|
296
|
+
# If you copy an encrypted DB snapshot from your AWS account, you can
|
297
|
+
# specify a value for `KmsKeyId` to encrypt the copy with a new KMS
|
298
|
+
# encryption key. If you don't specify a value for `KmsKeyId`, then the
|
299
|
+
# copy of the DB snapshot is encrypted with the same KMS key as the
|
300
|
+
# source DB snapshot.
|
301
|
+
#
|
302
|
+
# If you copy an encrypted snapshot to a different AWS region, then you
|
303
|
+
# must specify a KMS key for the destination AWS region.
|
304
|
+
#
|
305
|
+
# If you copy an encrypted DB snapshot that is shared from another AWS
|
306
|
+
# account, then you must specify a value for `KmsKeyId`.
|
307
|
+
#
|
308
|
+
# To copy an encrypted DB snapshot to another region, you must set
|
309
|
+
# `KmsKeyId` to the KMS key ID used to encrypt the copy of the DB
|
310
|
+
# snapshot in the destination region. KMS encryption keys are specific
|
311
|
+
# to the region that they are created in, and you cannot use encryption
|
312
|
+
# keys from one region in another region.
|
313
|
+
# @option options [Array<Types::Tag>] :tags
|
314
|
+
# A list of tags.
|
315
|
+
# @option options [Boolean] :copy_tags
|
316
|
+
# True to copy all tags from the source DB snapshot to the target DB
|
317
|
+
# snapshot; otherwise false. The default is false.
|
318
|
+
# @option options [String] :pre_signed_url
|
319
|
+
# The URL that contains a Signature Version 4 signed request for the
|
320
|
+
# `CopyDBSnapshot` API action in the AWS region that contains the source
|
321
|
+
# DB snapshot to copy. The `PreSignedUrl` parameter must be used when
|
322
|
+
# copying an encrypted DB snapshot from another AWS region.
|
323
|
+
#
|
324
|
+
# The presigned URL must be a valid request for the `CopyDBSnapshot` API
|
325
|
+
# action that can be executed in the source region that contains the
|
326
|
+
# encrypted DB snapshot to be copied. The presigned URL request must
|
327
|
+
# contain the following parameter values:
|
328
|
+
#
|
329
|
+
# * `DestinationRegion` - The AWS Region that the encrypted DB snapshot
|
330
|
+
# will be copied to. This region is the same one where the
|
331
|
+
# `CopyDBSnapshot` action is called that contains this presigned URL.
|
332
|
+
#
|
333
|
+
# For example, if you copy an encrypted DB snapshot from the us-west-2
|
334
|
+
# region to the us-east-1 region, then you will call the
|
335
|
+
# `CopyDBSnapshot` action in the us-east-1 region and provide a
|
336
|
+
# presigned URL that contains a call to the `CopyDBSnapshot` action in
|
337
|
+
# the us-west-2 region. For this example, the `DestinationRegion` in
|
338
|
+
# the presigned URL must be set to the us-east-1 region.
|
339
|
+
#
|
340
|
+
# * `KmsKeyId` - The KMS key identifier for the key to use to encrypt
|
341
|
+
# the copy of the DB snapshot in the destination region. This is the
|
342
|
+
# same identifier for both the `CopyDBSnapshot` action that is called
|
343
|
+
# in the destination region, and the action contained in the presigned
|
344
|
+
# URL.
|
345
|
+
#
|
346
|
+
# * `SourceDBSnapshotIdentifier` - The DB snapshot identifier for the
|
347
|
+
# encrypted snapshot to be copied. This identifier must be in the
|
348
|
+
# Amazon Resource Name (ARN) format for the source region. For
|
349
|
+
# example, if you are copying an encrypted DB snapshot from the
|
350
|
+
# us-west-2 region, then your `SourceDBSnapshotIdentifier` would look
|
351
|
+
# like Example:
|
352
|
+
# `arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115`.
|
353
|
+
#
|
354
|
+
# To learn how to generate a Signature Version 4 signed request, see [
|
355
|
+
# Authenticating Requests: Using Query Parameters (AWS Signature Version
|
356
|
+
# 4)][1] and [ Signature Version 4 Signing Process][2].
|
357
|
+
#
|
358
|
+
#
|
359
|
+
#
|
360
|
+
# [1]: http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
|
361
|
+
# [2]: http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
|
362
|
+
# @option options [String] :destination_region
|
363
|
+
# @return [DBSnapshot]
|
364
|
+
def copy(options = {})
|
365
|
+
options = options.merge(source_db_snapshot_identifier: @snapshot_id)
|
366
|
+
resp = @client.copy_db_snapshot(options)
|
367
|
+
DBSnapshot.new(
|
368
|
+
instance_id: resp.data.db_snapshot.db_instance_identifier,
|
369
|
+
snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
|
370
|
+
data: resp.data.db_snapshot,
|
371
|
+
client: @client
|
372
|
+
)
|
373
|
+
end
|
319
374
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
375
|
+
# @example Request syntax with placeholder values
|
376
|
+
#
|
377
|
+
# db_snapshot.delete()
|
378
|
+
# @param [Hash] options ({})
|
379
|
+
# @return [DBSnapshot]
|
380
|
+
def delete(options = {})
|
381
|
+
options = options.merge(db_snapshot_identifier: @snapshot_id)
|
382
|
+
resp = @client.delete_db_snapshot(options)
|
383
|
+
DBSnapshot.new(
|
384
|
+
instance_id: resp.data.db_snapshot.db_instance_identifier,
|
385
|
+
snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
|
386
|
+
data: resp.data.db_snapshot,
|
387
|
+
client: @client
|
388
|
+
)
|
389
|
+
end
|
335
390
|
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
391
|
+
# @example Request syntax with placeholder values
|
392
|
+
#
|
393
|
+
# dbinstance = db_snapshot.restore({
|
394
|
+
# db_instance_identifier: "String", # required
|
395
|
+
# db_instance_class: "String",
|
396
|
+
# port: 1,
|
397
|
+
# availability_zone: "String",
|
398
|
+
# db_subnet_group_name: "String",
|
399
|
+
# multi_az: false,
|
400
|
+
# publicly_accessible: false,
|
401
|
+
# auto_minor_version_upgrade: false,
|
402
|
+
# license_model: "String",
|
403
|
+
# db_name: "String",
|
404
|
+
# engine: "String",
|
405
|
+
# iops: 1,
|
406
|
+
# option_group_name: "String",
|
407
|
+
# tags: [
|
408
|
+
# {
|
409
|
+
# key: "String",
|
410
|
+
# value: "String",
|
411
|
+
# },
|
412
|
+
# ],
|
413
|
+
# storage_type: "String",
|
414
|
+
# tde_credential_arn: "String",
|
415
|
+
# tde_credential_password: "String",
|
416
|
+
# domain: "String",
|
417
|
+
# copy_tags_to_snapshot: false,
|
418
|
+
# domain_iam_role_name: "String",
|
419
|
+
# })
|
420
|
+
# @param [Hash] options ({})
|
421
|
+
# @option options [required, String] :db_instance_identifier
|
422
|
+
# Name of the DB instance to create from the DB snapshot. This parameter
|
423
|
+
# isn't case-sensitive.
|
424
|
+
#
|
425
|
+
# Constraints:
|
426
|
+
#
|
427
|
+
# * Must contain from 1 to 63 alphanumeric characters or hyphens (1 to
|
428
|
+
# 15 for SQL Server)
|
429
|
+
#
|
430
|
+
# * First character must be a letter
|
431
|
+
#
|
432
|
+
# * Cannot end with a hyphen or contain two consecutive hyphens
|
433
|
+
#
|
434
|
+
# Example: `my-snapshot-id`
|
435
|
+
# @option options [String] :db_instance_class
|
436
|
+
# The compute and memory capacity of the Amazon RDS DB instance.
|
437
|
+
#
|
438
|
+
# Valid Values: `db.t1.micro | db.m1.small | db.m1.medium | db.m1.large
|
439
|
+
# | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge | db.m3.medium |
|
440
|
+
# db.m3.large | db.m3.xlarge | db.m3.2xlarge | db.m4.large |
|
441
|
+
# db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge | db.m4.10xlarge |
|
442
|
+
# db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge |
|
443
|
+
# db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium |
|
444
|
+
# db.t2.large`
|
445
|
+
# @option options [Integer] :port
|
446
|
+
# The port number on which the database accepts connections.
|
447
|
+
#
|
448
|
+
# Default: The same port as the original DB instance
|
449
|
+
#
|
450
|
+
# Constraints: Value must be `1150-65535`
|
451
|
+
# @option options [String] :availability_zone
|
452
|
+
# The EC2 Availability Zone that the database instance will be created
|
453
|
+
# in.
|
454
|
+
#
|
455
|
+
# Default: A random, system-chosen Availability Zone.
|
456
|
+
#
|
457
|
+
# Constraint: You cannot specify the AvailabilityZone parameter if the
|
458
|
+
# MultiAZ parameter is set to `true`.
|
459
|
+
#
|
460
|
+
# Example: `us-east-1a`
|
461
|
+
# @option options [String] :db_subnet_group_name
|
462
|
+
# The DB subnet group name to use for the new instance.
|
463
|
+
#
|
464
|
+
# Constraints: Must contain no more than 255 alphanumeric characters,
|
465
|
+
# periods, underscores, spaces, or hyphens. Must not be default.
|
466
|
+
#
|
467
|
+
# Example: `mySubnetgroup`
|
468
|
+
# @option options [Boolean] :multi_az
|
469
|
+
# Specifies if the DB instance is a Multi-AZ deployment.
|
470
|
+
#
|
471
|
+
# Constraint: You cannot specify the AvailabilityZone parameter if the
|
472
|
+
# MultiAZ parameter is set to `true`.
|
473
|
+
# @option options [Boolean] :publicly_accessible
|
474
|
+
# Specifies the accessibility options for the DB instance. A value of
|
475
|
+
# true specifies an Internet-facing instance with a publicly resolvable
|
476
|
+
# DNS name, which resolves to a public IP address. A value of false
|
477
|
+
# specifies an internal instance with a DNS name that resolves to a
|
478
|
+
# private IP address.
|
479
|
+
#
|
480
|
+
# Default: The default behavior varies depending on whether a VPC has
|
481
|
+
# been requested or not. The following list shows the default behavior
|
482
|
+
# in each case.
|
483
|
+
#
|
484
|
+
# * **Default VPC:** true
|
485
|
+
#
|
486
|
+
# * **VPC:** false
|
487
|
+
#
|
488
|
+
# If no DB subnet group has been specified as part of the request and
|
489
|
+
# the PubliclyAccessible value has not been set, the DB instance will be
|
490
|
+
# publicly accessible. If a specific DB subnet group has been specified
|
491
|
+
# as part of the request and the PubliclyAccessible value has not been
|
492
|
+
# set, the DB instance will be private.
|
493
|
+
# @option options [Boolean] :auto_minor_version_upgrade
|
494
|
+
# Indicates that minor version upgrades will be applied automatically to
|
495
|
+
# the DB instance during the maintenance window.
|
496
|
+
# @option options [String] :license_model
|
497
|
+
# License model information for the restored DB instance.
|
498
|
+
#
|
499
|
+
# Default: Same as source.
|
500
|
+
#
|
501
|
+
# Valid values: `license-included` \| `bring-your-own-license` \|
|
502
|
+
# `general-public-license`
|
503
|
+
# @option options [String] :db_name
|
504
|
+
# The database name for the restored DB instance.
|
505
|
+
#
|
506
|
+
# <note markdown="1"> This parameter doesn't apply to the MySQL, PostgreSQL, or MariaDB
|
507
|
+
# engines.
|
508
|
+
#
|
509
|
+
# </note>
|
510
|
+
# @option options [String] :engine
|
511
|
+
# The database engine to use for the new instance.
|
512
|
+
#
|
513
|
+
# Default: The same as source
|
514
|
+
#
|
515
|
+
# Constraint: Must be compatible with the engine of the source. You can
|
516
|
+
# restore a MariaDB 10.1 DB instance from a MySQL 5.6 snapshot.
|
517
|
+
#
|
518
|
+
# Valid Values: `MySQL` \| `mariadb` \| `oracle-se1` \| `oracle-se` \|
|
519
|
+
# `oracle-ee` \| `sqlserver-ee` \| `sqlserver-se` \| `sqlserver-ex` \|
|
520
|
+
# `sqlserver-web` \| `postgres` \| `aurora`
|
521
|
+
# @option options [Integer] :iops
|
522
|
+
# Specifies the amount of provisioned IOPS for the DB instance,
|
523
|
+
# expressed in I/O operations per second. If this parameter is not
|
524
|
+
# specified, the IOPS value will be taken from the backup. If this
|
525
|
+
# parameter is set to 0, the new instance will be converted to a
|
526
|
+
# non-PIOPS instance, which will take additional time, though your DB
|
527
|
+
# instance will be available for connections before the conversion
|
528
|
+
# starts.
|
529
|
+
#
|
530
|
+
# Constraints: Must be an integer greater than 1000.
|
531
|
+
#
|
532
|
+
# **SQL Server**
|
533
|
+
#
|
534
|
+
# Setting the IOPS value for the SQL Server database engine is not
|
535
|
+
# supported.
|
536
|
+
# @option options [String] :option_group_name
|
537
|
+
# The name of the option group to be used for the restored DB instance.
|
538
|
+
#
|
539
|
+
# Permanent options, such as the TDE option for Oracle Advanced Security
|
540
|
+
# TDE, cannot be removed from an option group, and that option group
|
541
|
+
# cannot be removed from a DB instance once it is associated with a DB
|
542
|
+
# instance
|
543
|
+
# @option options [Array<Types::Tag>] :tags
|
544
|
+
# A list of tags.
|
545
|
+
# @option options [String] :storage_type
|
546
|
+
# Specifies the storage type to be associated with the DB instance.
|
547
|
+
#
|
548
|
+
# Valid values: `standard | gp2 | io1`
|
549
|
+
#
|
550
|
+
# If you specify `io1`, you must also include a value for the `Iops`
|
551
|
+
# parameter.
|
552
|
+
#
|
553
|
+
# Default: `io1` if the `Iops` parameter is specified; otherwise
|
554
|
+
# `standard`
|
555
|
+
# @option options [String] :tde_credential_arn
|
556
|
+
# The ARN from the Key Store with which to associate the instance for
|
557
|
+
# TDE encryption.
|
558
|
+
# @option options [String] :tde_credential_password
|
559
|
+
# The password for the given ARN from the Key Store in order to access
|
560
|
+
# the device.
|
561
|
+
# @option options [String] :domain
|
562
|
+
# Specify the Active Directory Domain to restore the instance in.
|
563
|
+
# @option options [Boolean] :copy_tags_to_snapshot
|
564
|
+
# True to copy all tags from the restored DB instance to snapshots of
|
565
|
+
# the DB instance; otherwise false. The default is false.
|
566
|
+
# @option options [String] :domain_iam_role_name
|
567
|
+
# Specify the name of the IAM role to be used when making API calls to
|
568
|
+
# the Directory Service.
|
569
|
+
# @return [DBInstance]
|
570
|
+
def restore(options = {})
|
571
|
+
options = options.merge(db_snapshot_identifier: @snapshot_id)
|
572
|
+
resp = @client.restore_db_instance_from_db_snapshot(options)
|
573
|
+
DBInstance.new(
|
574
|
+
id: resp.data.db_instance.db_instance_identifier,
|
575
|
+
data: resp.data.db_instance,
|
576
|
+
client: @client
|
577
|
+
)
|
578
|
+
end
|
523
579
|
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
580
|
+
# @example Request syntax with placeholder values
|
581
|
+
#
|
582
|
+
# eventsubscription = db_snapshot.subscribe_to({
|
583
|
+
# subscription_name: "String", # required
|
584
|
+
# })
|
585
|
+
# @param [Hash] options ({})
|
586
|
+
# @option options [required, String] :subscription_name
|
587
|
+
# The name of the RDS event notification subscription you want to add a
|
588
|
+
# source identifier to.
|
589
|
+
# @return [EventSubscription]
|
590
|
+
def subscribe_to(options = {})
|
591
|
+
options = options.merge(source_identifier: @snapshot_id)
|
592
|
+
resp = @client.add_source_identifier_to_subscription(options)
|
593
|
+
EventSubscription.new(
|
594
|
+
name: resp.data.event_subscription.cust_subscription_id,
|
595
|
+
data: resp.data.event_subscription,
|
596
|
+
client: @client
|
597
|
+
)
|
598
|
+
end
|
543
599
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
600
|
+
# @example Request syntax with placeholder values
|
601
|
+
#
|
602
|
+
# eventsubscription = db_snapshot.unsubscribe_from({
|
603
|
+
# subscription_name: "String", # required
|
604
|
+
# })
|
605
|
+
# @param [Hash] options ({})
|
606
|
+
# @option options [required, String] :subscription_name
|
607
|
+
# The name of the RDS event notification subscription you want to remove
|
608
|
+
# a source identifier from.
|
609
|
+
# @return [EventSubscription]
|
610
|
+
def unsubscribe_from(options = {})
|
611
|
+
options = options.merge(source_identifier: @snapshot_id)
|
612
|
+
resp = @client.remove_source_identifier_from_subscription(options)
|
613
|
+
EventSubscription.new(
|
614
|
+
name: resp.data.event_subscription.cust_subscription_id,
|
615
|
+
data: resp.data.event_subscription,
|
616
|
+
client: @client
|
617
|
+
)
|
618
|
+
end
|
619
|
+
|
620
|
+
# @!group Associations
|
563
621
|
|
564
|
-
|
622
|
+
# @example Request syntax with placeholder values
|
623
|
+
#
|
624
|
+
# db_snapshot.attributes()
|
625
|
+
# @param [Hash] options ({})
|
626
|
+
# @return [DBSnapshotAttribute::Collection]
|
627
|
+
def attributes(options = {})
|
628
|
+
batches = Enumerator.new do |y|
|
629
|
+
batch = []
|
630
|
+
options = options.merge(db_snapshot_identifier: @snapshot_id)
|
631
|
+
resp = @client.describe_db_snapshot_attributes(options)
|
632
|
+
resp.data.db_snapshot_attributes_result.db_snapshot_attributes.each do |d|
|
633
|
+
batch << DBSnapshotAttribute.new(
|
634
|
+
snapshot_id: @snapshot_id,
|
635
|
+
name: d.attribute_name,
|
636
|
+
data: d,
|
637
|
+
client: @client
|
638
|
+
)
|
639
|
+
end
|
640
|
+
y.yield(batch)
|
641
|
+
end
|
642
|
+
DBSnapshotAttribute::Collection.new(batches)
|
643
|
+
end
|
565
644
|
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
645
|
+
# @example Request syntax with placeholder values
|
646
|
+
#
|
647
|
+
# events = db_snapshot.events({
|
648
|
+
# start_time: Time.now,
|
649
|
+
# end_time: Time.now,
|
650
|
+
# duration: 1,
|
651
|
+
# event_categories: ["String"],
|
652
|
+
# filters: [
|
653
|
+
# {
|
654
|
+
# name: "String", # required
|
655
|
+
# values: ["String"], # required
|
656
|
+
# },
|
657
|
+
# ],
|
658
|
+
# })
|
659
|
+
# @param [Hash] options ({})
|
660
|
+
# @option options [Time,DateTime,Date,Integer,String] :start_time
|
661
|
+
# The beginning of the time interval to retrieve events for, specified
|
662
|
+
# in ISO 8601 format. For more information about ISO 8601, go to the
|
663
|
+
# [ISO8601 Wikipedia page.][1]
|
664
|
+
#
|
665
|
+
# Example: 2009-07-08T18:00Z
|
666
|
+
#
|
667
|
+
#
|
668
|
+
#
|
669
|
+
# [1]: http://en.wikipedia.org/wiki/ISO_8601
|
670
|
+
# @option options [Time,DateTime,Date,Integer,String] :end_time
|
671
|
+
# The end of the time interval for which to retrieve events, specified
|
672
|
+
# in ISO 8601 format. For more information about ISO 8601, go to the
|
673
|
+
# [ISO8601 Wikipedia page.][1]
|
674
|
+
#
|
675
|
+
# Example: 2009-07-08T18:00Z
|
676
|
+
#
|
677
|
+
#
|
678
|
+
#
|
679
|
+
# [1]: http://en.wikipedia.org/wiki/ISO_8601
|
680
|
+
# @option options [Integer] :duration
|
681
|
+
# The number of minutes to retrieve events for.
|
682
|
+
#
|
683
|
+
# Default: 60
|
684
|
+
# @option options [Array<String>] :event_categories
|
685
|
+
# A list of event categories that trigger notifications for a event
|
686
|
+
# notification subscription.
|
687
|
+
# @option options [Array<Types::Filter>] :filters
|
688
|
+
# This parameter is not currently supported.
|
689
|
+
# @return [Event::Collection]
|
690
|
+
def events(options = {})
|
691
|
+
batches = Enumerator.new do |y|
|
692
|
+
options = options.merge(
|
693
|
+
source_type: "db-snapshot",
|
694
|
+
source_identifier: @snapshot_id
|
695
|
+
)
|
696
|
+
resp = @client.describe_events(options)
|
697
|
+
resp.each_page do |page|
|
573
698
|
batch = []
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
name: d.attribute_name,
|
580
|
-
data: d,
|
699
|
+
page.data.events.each do |e|
|
700
|
+
batch << Event.new(
|
701
|
+
source_id: e.source_identifier,
|
702
|
+
date: e.date,
|
703
|
+
data: e,
|
581
704
|
client: @client
|
582
705
|
)
|
583
706
|
end
|
584
707
|
y.yield(batch)
|
585
708
|
end
|
586
|
-
DBSnapshotAttribute::Collection.new(batches)
|
587
709
|
end
|
710
|
+
Event::Collection.new(batches)
|
711
|
+
end
|
588
712
|
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
# filters: [
|
597
|
-
# {
|
598
|
-
# name: "String", # required
|
599
|
-
# values: ["String"], # required
|
600
|
-
# },
|
601
|
-
# ],
|
602
|
-
# })
|
603
|
-
# @param [Hash] options ({})
|
604
|
-
# @option options [Time,DateTime,Date,Integer,String] :start_time
|
605
|
-
# The beginning of the time interval to retrieve events for, specified
|
606
|
-
# in ISO 8601 format. For more information about ISO 8601, go to the
|
607
|
-
# [ISO8601 Wikipedia page.][1]
|
608
|
-
#
|
609
|
-
# Example: 2009-07-08T18:00Z
|
610
|
-
#
|
611
|
-
#
|
612
|
-
#
|
613
|
-
# [1]: http://en.wikipedia.org/wiki/ISO_8601
|
614
|
-
# @option options [Time,DateTime,Date,Integer,String] :end_time
|
615
|
-
# The end of the time interval for which to retrieve events, specified
|
616
|
-
# in ISO 8601 format. For more information about ISO 8601, go to the
|
617
|
-
# [ISO8601 Wikipedia page.][1]
|
618
|
-
#
|
619
|
-
# Example: 2009-07-08T18:00Z
|
620
|
-
#
|
621
|
-
#
|
622
|
-
#
|
623
|
-
# [1]: http://en.wikipedia.org/wiki/ISO_8601
|
624
|
-
# @option options [Integer] :duration
|
625
|
-
# The number of minutes to retrieve events for.
|
626
|
-
#
|
627
|
-
# Default: 60
|
628
|
-
# @option options [Array<String>] :event_categories
|
629
|
-
# A list of event categories that trigger notifications for a event
|
630
|
-
# notification subscription.
|
631
|
-
# @option options [Array<Types::Filter>] :filters
|
632
|
-
# This parameter is not currently supported.
|
633
|
-
# @return [Event::Collection]
|
634
|
-
def events(options = {})
|
635
|
-
batches = Enumerator.new do |y|
|
636
|
-
options = options.merge(
|
637
|
-
source_type: "db-snapshot",
|
638
|
-
source_identifier: @snapshot_id
|
639
|
-
)
|
640
|
-
resp = @client.describe_events(options)
|
641
|
-
resp.each_page do |page|
|
642
|
-
batch = []
|
643
|
-
page.data.events.each do |e|
|
644
|
-
batch << Event.new(
|
645
|
-
source_id: e.source_identifier,
|
646
|
-
date: e.date,
|
647
|
-
data: e,
|
648
|
-
client: @client
|
649
|
-
)
|
650
|
-
end
|
651
|
-
y.yield(batch)
|
652
|
-
end
|
653
|
-
end
|
654
|
-
Event::Collection.new(batches)
|
655
|
-
end
|
713
|
+
# @return [DBInstance]
|
714
|
+
def instance
|
715
|
+
DBInstance.new(
|
716
|
+
id: @instance_id,
|
717
|
+
client: @client
|
718
|
+
)
|
719
|
+
end
|
656
720
|
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
721
|
+
# @return [OptionGroup, nil]
|
722
|
+
def option_group
|
723
|
+
if data.db_snapshot.option_group_name
|
724
|
+
OptionGroup.new(
|
725
|
+
name: data.db_snapshot.option_group_name,
|
661
726
|
client: @client
|
662
727
|
)
|
728
|
+
else
|
729
|
+
nil
|
663
730
|
end
|
731
|
+
end
|
664
732
|
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
end
|
675
|
-
end
|
733
|
+
# @deprecated
|
734
|
+
# @api private
|
735
|
+
def identifiers
|
736
|
+
{
|
737
|
+
instance_id: @instance_id,
|
738
|
+
snapshot_id: @snapshot_id
|
739
|
+
}
|
740
|
+
end
|
741
|
+
deprecated(:identifiers)
|
676
742
|
|
677
|
-
|
678
|
-
# @api private
|
679
|
-
def identifiers
|
680
|
-
{
|
681
|
-
instance_id: @instance_id,
|
682
|
-
snapshot_id: @snapshot_id
|
683
|
-
}
|
684
|
-
end
|
685
|
-
deprecated(:identifiers)
|
686
|
-
|
687
|
-
private
|
688
|
-
|
689
|
-
def extract_instance_id(args, options)
|
690
|
-
value = args[0] || options.delete(:instance_id)
|
691
|
-
case value
|
692
|
-
when String then value
|
693
|
-
when nil then raise ArgumentError, "missing required option :instance_id"
|
694
|
-
else
|
695
|
-
msg = "expected :instance_id to be a String, got #{value.class}"
|
696
|
-
raise ArgumentError, msg
|
697
|
-
end
|
698
|
-
end
|
743
|
+
private
|
699
744
|
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
end
|
745
|
+
def extract_instance_id(args, options)
|
746
|
+
value = args[0] || options.delete(:instance_id)
|
747
|
+
case value
|
748
|
+
when String then value
|
749
|
+
when nil then raise ArgumentError, "missing required option :instance_id"
|
750
|
+
else
|
751
|
+
msg = "expected :instance_id to be a String, got #{value.class}"
|
752
|
+
raise ArgumentError, msg
|
709
753
|
end
|
754
|
+
end
|
710
755
|
|
711
|
-
|
756
|
+
def extract_snapshot_id(args, options)
|
757
|
+
value = args[1] || options.delete(:snapshot_id)
|
758
|
+
case value
|
759
|
+
when String then value
|
760
|
+
when nil then raise ArgumentError, "missing required option :snapshot_id"
|
761
|
+
else
|
762
|
+
msg = "expected :snapshot_id to be a String, got #{value.class}"
|
763
|
+
raise ArgumentError, msg
|
764
|
+
end
|
712
765
|
end
|
766
|
+
|
767
|
+
class Collection < Aws::Resources::Collection; end
|
713
768
|
end
|
714
769
|
end
|