aws-sdk-rds 1.0.0.rc2 → 1.0.0.rc3

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aws-sdk-rds.rb +2 -2
  3. data/lib/aws-sdk-rds/account_quota.rb +79 -81
  4. data/lib/aws-sdk-rds/certificate.rb +99 -101
  5. data/lib/aws-sdk-rds/client.rb +10575 -9119
  6. data/lib/aws-sdk-rds/client_api.rb +3049 -3023
  7. data/lib/aws-sdk-rds/db_cluster.rb +1005 -1007
  8. data/lib/aws-sdk-rds/db_cluster_parameter_group.rb +204 -206
  9. data/lib/aws-sdk-rds/db_cluster_snapshot.rb +430 -432
  10. data/lib/aws-sdk-rds/db_engine.rb +208 -210
  11. data/lib/aws-sdk-rds/db_engine_version.rb +218 -219
  12. data/lib/aws-sdk-rds/db_instance.rb +2747 -2567
  13. data/lib/aws-sdk-rds/db_log_file.rb +145 -147
  14. data/lib/aws-sdk-rds/db_parameter_group.rb +411 -413
  15. data/lib/aws-sdk-rds/db_parameter_group_family.rb +135 -137
  16. data/lib/aws-sdk-rds/db_security_group.rb +316 -318
  17. data/lib/aws-sdk-rds/db_snapshot.rb +705 -650
  18. data/lib/aws-sdk-rds/db_snapshot_attribute.rb +137 -139
  19. data/lib/aws-sdk-rds/db_subnet_group.rb +161 -163
  20. data/lib/aws-sdk-rds/errors.rb +4 -13
  21. data/lib/aws-sdk-rds/event.rb +108 -110
  22. data/lib/aws-sdk-rds/event_category_map.rb +73 -75
  23. data/lib/aws-sdk-rds/event_subscription.rb +313 -315
  24. data/lib/aws-sdk-rds/option_group.rb +247 -249
  25. data/lib/aws-sdk-rds/option_group_option.rb +135 -137
  26. data/lib/aws-sdk-rds/parameter.rb +116 -118
  27. data/lib/aws-sdk-rds/pending_maintenance_action.rb +182 -184
  28. data/lib/aws-sdk-rds/plugins/cross_region_copying.rb +64 -0
  29. data/lib/aws-sdk-rds/reserved_db_instance.rb +156 -158
  30. data/lib/aws-sdk-rds/reserved_db_instances_offering.rb +154 -156
  31. data/lib/aws-sdk-rds/resource.rb +2395 -2288
  32. data/lib/aws-sdk-rds/resource_pending_maintenance_action_list.rb +89 -91
  33. data/lib/aws-sdk-rds/types.rb +12091 -10977
  34. data/lib/aws-sdk-rds/waiters.rb +127 -128
  35. metadata +3 -2
@@ -1,714 +1,769 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module RDS
10
- class DBSnapshot
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(instance_id, snapshot_id, options = {})
15
- # @param [String] instance_id
16
- # @param [String] snapshot_id
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :instance_id
20
- # @option options [required, String] :snapshot_id
21
- # @option options [Client] :client
22
- def initialize(*args)
23
- options = Hash === args.last ? args.pop.dup : {}
24
- @instance_id = extract_instance_id(args, options)
25
- @snapshot_id = extract_snapshot_id(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
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
- # @!group Read-Only Attributes
29
+ # @!group Read-Only Attributes
31
30
 
32
- # @return [String]
33
- def instance_id
34
- @instance_id
35
- end
36
- alias :db_instance_identifier :instance_id
31
+ # @return [String]
32
+ def instance_id
33
+ @instance_id
34
+ end
35
+ alias :db_instance_identifier :instance_id
37
36
 
38
- # @return [String]
39
- def snapshot_id
40
- @snapshot_id
41
- end
42
- alias :db_snapshot_identifier :snapshot_id
37
+ # @return [String]
38
+ def snapshot_id
39
+ @snapshot_id
40
+ end
41
+ alias :db_snapshot_identifier :snapshot_id
43
42
 
44
- # Provides the time when the snapshot was taken, in Universal
45
- # Coordinated Time (UTC).
46
- # @return [Time]
47
- def snapshot_create_time
48
- data.snapshot_create_time
49
- end
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
- # Specifies the name of the database engine.
52
- # @return [String]
53
- def engine
54
- data.engine
55
- end
50
+ # Specifies the name of the database engine.
51
+ # @return [String]
52
+ def engine
53
+ data.engine
54
+ end
56
55
 
57
- # Specifies the allocated storage size in gigabytes (GB).
58
- # @return [Integer]
59
- def allocated_storage
60
- data.allocated_storage
61
- end
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
- # Specifies the status of this DB snapshot.
64
- # @return [String]
65
- def status
66
- data.status
67
- end
62
+ # Specifies the status of this DB snapshot.
63
+ # @return [String]
64
+ def status
65
+ data.status
66
+ end
68
67
 
69
- # Specifies the port that the database engine was listening on at the
70
- # time of the snapshot.
71
- # @return [Integer]
72
- def port
73
- data.port
74
- end
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
- # Specifies the name of the Availability Zone the DB instance was
77
- # located in at the time of the DB snapshot.
78
- # @return [String]
79
- def availability_zone
80
- data.availability_zone
81
- end
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
- # Provides the VPC ID associated with the DB snapshot.
84
- # @return [String]
85
- def vpc_id
86
- data.vpc_id
87
- end
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
- # Specifies the time when the snapshot was taken, in Universal
90
- # Coordinated Time (UTC).
91
- # @return [Time]
92
- def instance_create_time
93
- data.instance_create_time
94
- end
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
- # Provides the master username for the DB snapshot.
97
- # @return [String]
98
- def master_username
99
- data.master_username
100
- end
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
- # Specifies the version of the database engine.
103
- # @return [String]
104
- def engine_version
105
- data.engine_version
106
- end
101
+ # Specifies the version of the database engine.
102
+ # @return [String]
103
+ def engine_version
104
+ data.engine_version
105
+ end
107
106
 
108
- # License model information for the restored DB instance.
109
- # @return [String]
110
- def license_model
111
- data.license_model
112
- end
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
- # Provides the type of the DB snapshot.
115
- # @return [String]
116
- def snapshot_type
117
- data.snapshot_type
118
- end
113
+ # Provides the type of the DB snapshot.
114
+ # @return [String]
115
+ def snapshot_type
116
+ data.snapshot_type
117
+ end
119
118
 
120
- # Specifies the Provisioned IOPS (I/O operations per second) value of
121
- # the DB instance at the time of the snapshot.
122
- # @return [Integer]
123
- def iops
124
- data.iops
125
- end
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
- # Provides the option group name for the DB snapshot.
128
- # @return [String]
129
- def option_group_name
130
- data.option_group_name
131
- end
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
- # The percentage of the estimated data that has been transferred.
134
- # @return [Integer]
135
- def percent_progress
136
- data.percent_progress
137
- end
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
- # The region that the DB snapshot was created in or copied from.
140
- # @return [String]
141
- def source_region
142
- data.source_region
143
- end
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
- # The DB snapshot Arn that the DB snapshot was copied from. It only has
146
- # value in case of cross customer or cross region copy.
147
- # @return [String]
148
- def source_db_snapshot_identifier
149
- data.source_db_snapshot_identifier
150
- end
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
- # Specifies the storage type associated with DB snapshot.
153
- # @return [String]
154
- def storage_type
155
- data.storage_type
156
- end
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
- # The ARN from the key store with which to associate the instance for
159
- # TDE encryption.
160
- # @return [String]
161
- def tde_credential_arn
162
- data.tde_credential_arn
163
- end
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
- # Specifies whether the DB snapshot is encrypted.
166
- # @return [Boolean]
167
- def encrypted
168
- data.encrypted
169
- end
164
+ # Specifies whether the DB snapshot is encrypted.
165
+ # @return [Boolean]
166
+ def encrypted
167
+ data.encrypted
168
+ end
170
169
 
171
- # If `Encrypted` is true, the KMS key identifier for the encrypted DB
172
- # snapshot.
173
- # @return [String]
174
- def kms_key_id
175
- data.kms_key_id
176
- end
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
- # The Amazon Resource Name (ARN) for the DB snapshot.
179
- # @return [String]
180
- def db_snapshot_arn
181
- data.db_snapshot_arn
182
- end
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
- # The time zone of the DB snapshot. In most cases, the `Timezone`
185
- # element is empty. `Timezone` content appears only for snapshots taken
186
- # from Microsoft SQL Server DB instances that were created with a time
187
- # zone specified.
188
- # @return [String]
189
- def timezone
190
- data.timezone
191
- end
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
- # @!endgroup
192
+ # @!endgroup
194
193
 
195
- # @return [Client]
196
- def client
197
- @client
198
- end
194
+ # @return [Client]
195
+ def client
196
+ @client
197
+ end
199
198
 
200
- # Loads, or reloads {#data} for the current {DBSnapshot}.
201
- # Returns `self` making it possible to chain methods.
202
- #
203
- # db_snapshot.reload.data
204
- #
205
- # @return [self]
206
- def load
207
- resp = @client.describe_db_snapshots(db_snapshot_identifier: @snapshot_id)
208
- @data = resp.dbsnapshots[0]
209
- self
210
- end
211
- alias :reload :load
212
-
213
- # @return [Types::DBSnapshot]
214
- # Returns the data for this {DBSnapshot}. Calls
215
- # {Client#describe_db_snapshots} if {#data_loaded?} is `false`.
216
- def data
217
- load unless @data
218
- @data
219
- end
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
- # @return [Boolean]
222
- # Returns `true` if this resource is loaded. Accessing attributes or
223
- # {#data} on an unloaded resource will trigger a call to {#load}.
224
- def data_loaded?
225
- !!@data
226
- end
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
- # @!group Actions
229
-
230
- # @example Request syntax with placeholder values
231
- #
232
- # dbsnapshot = db_snapshot.create({
233
- # tags: [
234
- # {
235
- # key: "String",
236
- # value: "String",
237
- # },
238
- # ],
239
- # })
240
- # @param [Hash] options ({})
241
- # @option options [Array<Types::Tag>] :tags
242
- # A list of tags.
243
- # @return [DBSnapshot]
244
- def create(options = {})
245
- options = options.merge(
246
- db_instance_identifier: @instance_id,
247
- db_snapshot_identifier: @snapshot_id
248
- )
249
- resp = @client.create_db_snapshot(options)
250
- DBSnapshot.new(
251
- instance_id: resp.data.db_snapshot.db_instance_identifier,
252
- snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
253
- data: resp.data.db_snapshot,
254
- client: @client
255
- )
256
- end
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
- # @example Request syntax with placeholder values
259
- #
260
- # dbsnapshot = db_snapshot.copy({
261
- # target_db_snapshot_identifier: "String", # required
262
- # kms_key_id: "String",
263
- # tags: [
264
- # {
265
- # key: "String",
266
- # value: "String",
267
- # },
268
- # ],
269
- # copy_tags: false,
270
- # })
271
- # @param [Hash] options ({})
272
- # @option options [required, String] :target_db_snapshot_identifier
273
- # The identifier for the copied snapshot.
274
- #
275
- # Constraints:
276
- #
277
- # * Cannot be null, empty, or blank
278
- #
279
- # * Must contain from 1 to 255 alphanumeric characters or hyphens
280
- #
281
- # * First character must be a letter
282
- #
283
- # * Cannot end with a hyphen or contain two consecutive hyphens
284
- #
285
- # Example: `my-db-snapshot`
286
- # @option options [String] :kms_key_id
287
- # The AWS KMS key ID for an encrypted DB snapshot. The KMS key ID is the
288
- # Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias
289
- # for the KMS encryption key.
290
- #
291
- # If you copy an unencrypted DB snapshot and specify a value for the
292
- # `KmsKeyId` parameter, Amazon RDS encrypts the target DB snapshot using
293
- # the specified KMS encryption key.
294
- #
295
- # If you copy an encrypted DB snapshot from your AWS account, you can
296
- # specify a value for `KmsKeyId` to encrypt the copy with a new KMS
297
- # encryption key. If you don't specify a value for `KmsKeyId`, then the
298
- # copy of the DB snapshot is encrypted with the same KMS key as the
299
- # source DB snapshot.
300
- #
301
- # If you copy an encrypted DB snapshot that is shared from another AWS
302
- # account, then you must specify a value for `KmsKeyId`.
303
- # @option options [Array<Types::Tag>] :tags
304
- # A list of tags.
305
- # @option options [Boolean] :copy_tags
306
- # True to copy all tags from the source DB snapshot to the target DB
307
- # snapshot; otherwise false. The default is false.
308
- # @return [DBSnapshot]
309
- def copy(options = {})
310
- options = options.merge(source_db_snapshot_identifier: @snapshot_id)
311
- resp = @client.copy_db_snapshot(options)
312
- DBSnapshot.new(
313
- instance_id: resp.data.db_snapshot.db_instance_identifier,
314
- snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
315
- data: resp.data.db_snapshot,
316
- client: @client
317
- )
318
- end
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
- # @example Request syntax with placeholder values
321
- #
322
- # dbsnapshot = db_snapshot.delete()
323
- # @param [Hash] options ({})
324
- # @return [DBSnapshot]
325
- def delete(options = {})
326
- options = options.merge(db_snapshot_identifier: @snapshot_id)
327
- resp = @client.delete_db_snapshot(options)
328
- DBSnapshot.new(
329
- instance_id: resp.data.db_snapshot.db_instance_identifier,
330
- snapshot_id: resp.data.db_snapshot.db_snapshot_identifier,
331
- data: resp.data.db_snapshot,
332
- client: @client
333
- )
334
- end
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
- # @example Request syntax with placeholder values
337
- #
338
- # dbinstance = db_snapshot.restore({
339
- # db_instance_identifier: "String", # required
340
- # db_instance_class: "String",
341
- # port: 1,
342
- # availability_zone: "String",
343
- # db_subnet_group_name: "String",
344
- # multi_az: false,
345
- # publicly_accessible: false,
346
- # auto_minor_version_upgrade: false,
347
- # license_model: "String",
348
- # db_name: "String",
349
- # engine: "String",
350
- # iops: 1,
351
- # option_group_name: "String",
352
- # tags: [
353
- # {
354
- # key: "String",
355
- # value: "String",
356
- # },
357
- # ],
358
- # storage_type: "String",
359
- # tde_credential_arn: "String",
360
- # tde_credential_password: "String",
361
- # domain: "String",
362
- # copy_tags_to_snapshot: false,
363
- # domain_iam_role_name: "String",
364
- # })
365
- # @param [Hash] options ({})
366
- # @option options [required, String] :db_instance_identifier
367
- # Name of the DB instance to create from the DB snapshot. This parameter
368
- # isn't case-sensitive.
369
- #
370
- # Constraints:
371
- #
372
- # * Must contain from 1 to 63 alphanumeric characters or hyphens (1 to
373
- # 15 for SQL Server)
374
- #
375
- # * First character must be a letter
376
- #
377
- # * Cannot end with a hyphen or contain two consecutive hyphens
378
- #
379
- # Example: `my-snapshot-id`
380
- # @option options [String] :db_instance_class
381
- # The compute and memory capacity of the Amazon RDS DB instance.
382
- #
383
- # Valid Values: `db.t1.micro | db.m1.small | db.m1.medium | db.m1.large
384
- # | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge | db.m3.medium |
385
- # db.m3.large | db.m3.xlarge | db.m3.2xlarge | db.m4.large |
386
- # db.m4.xlarge | db.m4.2xlarge | db.m4.4xlarge | db.m4.10xlarge |
387
- # db.r3.large | db.r3.xlarge | db.r3.2xlarge | db.r3.4xlarge |
388
- # db.r3.8xlarge | db.t2.micro | db.t2.small | db.t2.medium |
389
- # db.t2.large`
390
- # @option options [Integer] :port
391
- # The port number on which the database accepts connections.
392
- #
393
- # Default: The same port as the original DB instance
394
- #
395
- # Constraints: Value must be `1150-65535`
396
- # @option options [String] :availability_zone
397
- # The EC2 Availability Zone that the database instance will be created
398
- # in.
399
- #
400
- # Default: A random, system-chosen Availability Zone.
401
- #
402
- # Constraint: You cannot specify the AvailabilityZone parameter if the
403
- # MultiAZ parameter is set to `true`.
404
- #
405
- # Example: `us-east-1a`
406
- # @option options [String] :db_subnet_group_name
407
- # The DB subnet group name to use for the new instance.
408
- #
409
- # Constraints: Must contain no more than 255 alphanumeric characters,
410
- # periods, underscores, spaces, or hyphens. Must not be default.
411
- #
412
- # Example: `mySubnetgroup`
413
- # @option options [Boolean] :multi_az
414
- # Specifies if the DB instance is a Multi-AZ deployment.
415
- #
416
- # Constraint: You cannot specify the AvailabilityZone parameter if the
417
- # MultiAZ parameter is set to `true`.
418
- # @option options [Boolean] :publicly_accessible
419
- # Specifies the accessibility options for the DB instance. A value of
420
- # true specifies an Internet-facing instance with a publicly resolvable
421
- # DNS name, which resolves to a public IP address. A value of false
422
- # specifies an internal instance with a DNS name that resolves to a
423
- # private IP address.
424
- #
425
- # Default: The default behavior varies depending on whether a VPC has
426
- # been requested or not. The following list shows the default behavior
427
- # in each case.
428
- #
429
- # * **Default VPC:** true
430
- #
431
- # * **VPC:** false
432
- #
433
- # If no DB subnet group has been specified as part of the request and
434
- # the PubliclyAccessible value has not been set, the DB instance will be
435
- # publicly accessible. If a specific DB subnet group has been specified
436
- # as part of the request and the PubliclyAccessible value has not been
437
- # set, the DB instance will be private.
438
- # @option options [Boolean] :auto_minor_version_upgrade
439
- # Indicates that minor version upgrades will be applied automatically to
440
- # the DB instance during the maintenance window.
441
- # @option options [String] :license_model
442
- # License model information for the restored DB instance.
443
- #
444
- # Default: Same as source.
445
- #
446
- # Valid values: `license-included` \| `bring-your-own-license` \|
447
- # `general-public-license`
448
- # @option options [String] :db_name
449
- # The database name for the restored DB instance.
450
- #
451
- # <note markdown="1"> This parameter doesn't apply to the MySQL, PostgreSQL, or MariaDB
452
- # engines.
453
- #
454
- # </note>
455
- # @option options [String] :engine
456
- # The database engine to use for the new instance.
457
- #
458
- # Default: The same as source
459
- #
460
- # Constraint: Must be compatible with the engine of the source
461
- #
462
- # Valid Values: `MySQL` \| `mariadb` \| `oracle-se1` \| `oracle-se` \|
463
- # `oracle-ee` \| `sqlserver-ee` \| `sqlserver-se` \| `sqlserver-ex` \|
464
- # `sqlserver-web` \| `postgres` \| `aurora`
465
- # @option options [Integer] :iops
466
- # Specifies the amount of provisioned IOPS for the DB instance,
467
- # expressed in I/O operations per second. If this parameter is not
468
- # specified, the IOPS value will be taken from the backup. If this
469
- # parameter is set to 0, the new instance will be converted to a
470
- # non-PIOPS instance, which will take additional time, though your DB
471
- # instance will be available for connections before the conversion
472
- # starts.
473
- #
474
- # Constraints: Must be an integer greater than 1000.
475
- #
476
- # **SQL Server**
477
- #
478
- # Setting the IOPS value for the SQL Server database engine is not
479
- # supported.
480
- # @option options [String] :option_group_name
481
- # The name of the option group to be used for the restored DB instance.
482
- #
483
- # Permanent options, such as the TDE option for Oracle Advanced Security
484
- # TDE, cannot be removed from an option group, and that option group
485
- # cannot be removed from a DB instance once it is associated with a DB
486
- # instance
487
- # @option options [Array<Types::Tag>] :tags
488
- # A list of tags.
489
- # @option options [String] :storage_type
490
- # Specifies the storage type to be associated with the DB instance.
491
- #
492
- # Valid values: `standard | gp2 | io1`
493
- #
494
- # If you specify `io1`, you must also include a value for the `Iops`
495
- # parameter.
496
- #
497
- # Default: `io1` if the `Iops` parameter is specified; otherwise
498
- # `standard`
499
- # @option options [String] :tde_credential_arn
500
- # The ARN from the Key Store with which to associate the instance for
501
- # TDE encryption.
502
- # @option options [String] :tde_credential_password
503
- # The password for the given ARN from the Key Store in order to access
504
- # the device.
505
- # @option options [String] :domain
506
- # Specify the Active Directory Domain to restore the instance in.
507
- # @option options [Boolean] :copy_tags_to_snapshot
508
- # True to copy all tags from the restored DB instance to snapshots of
509
- # the DB instance; otherwise false. The default is false.
510
- # @option options [String] :domain_iam_role_name
511
- # Specify the name of the IAM role to be used when making API calls to
512
- # the Directory Service.
513
- # @return [DBInstance]
514
- def restore(options = {})
515
- options = options.merge(db_snapshot_identifier: @snapshot_id)
516
- resp = @client.restore_db_instance_from_db_snapshot(options)
517
- DBInstance.new(
518
- id: resp.data.db_instance.db_instance_identifier,
519
- data: resp.data.db_instance,
520
- client: @client
521
- )
522
- end
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
- # @example Request syntax with placeholder values
525
- #
526
- # eventsubscription = db_snapshot.subscribe_to({
527
- # subscription_name: "String", # required
528
- # })
529
- # @param [Hash] options ({})
530
- # @option options [required, String] :subscription_name
531
- # The name of the RDS event notification subscription you want to add a
532
- # source identifier to.
533
- # @return [EventSubscription]
534
- def subscribe_to(options = {})
535
- options = options.merge(source_identifier: @snapshot_id)
536
- resp = @client.add_source_identifier_to_subscription(options)
537
- EventSubscription.new(
538
- name: resp.data.event_subscription.cust_subscription_id,
539
- data: resp.data.event_subscription,
540
- client: @client
541
- )
542
- end
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
- # @example Request syntax with placeholder values
545
- #
546
- # eventsubscription = db_snapshot.unsubscribe_from({
547
- # subscription_name: "String", # required
548
- # })
549
- # @param [Hash] options ({})
550
- # @option options [required, String] :subscription_name
551
- # The name of the RDS event notification subscription you want to remove
552
- # a source identifier from.
553
- # @return [EventSubscription]
554
- def unsubscribe_from(options = {})
555
- options = options.merge(source_identifier: @snapshot_id)
556
- resp = @client.remove_source_identifier_from_subscription(options)
557
- EventSubscription.new(
558
- name: resp.data.event_subscription.cust_subscription_id,
559
- data: resp.data.event_subscription,
560
- client: @client
561
- )
562
- end
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
- # @!group Associations
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
- # @example Request syntax with placeholder values
567
- #
568
- # attributes = db_snapshot.attributes()
569
- # @param [Hash] options ({})
570
- # @return [DBSnapshotAttribute::Collection]
571
- def attributes(options = {})
572
- batches = Enumerator.new do |y|
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
- options = options.merge(db_snapshot_identifier: @snapshot_id)
575
- resp = @client.describe_db_snapshot_attributes(options)
576
- resp.data.db_snapshot_attributes_result.db_snapshot_attributes.each do |d|
577
- batch << DBSnapshotAttribute.new(
578
- snapshot_id: @snapshot_id,
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
- # @example Request syntax with placeholder values
590
- #
591
- # events = db_snapshot.events({
592
- # start_time: Time.now,
593
- # end_time: Time.now,
594
- # duration: 1,
595
- # event_categories: ["String"],
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
- # @return [DBInstance]
658
- def instance
659
- DBInstance.new(
660
- id: @instance_id,
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
- # @return [OptionGroup, nil]
666
- def option_group
667
- if data.db_snapshot.option_group_name
668
- OptionGroup.new(
669
- name: data.db_snapshot.option_group_name,
670
- client: @client
671
- )
672
- else
673
- nil
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
- # @deprecated
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
- def extract_snapshot_id(args, options)
701
- value = args[1] || options.delete(:snapshot_id)
702
- case value
703
- when String then value
704
- when nil then raise ArgumentError, "missing required option :snapshot_id"
705
- else
706
- msg = "expected :snapshot_id to be a String, got #{value.class}"
707
- raise ArgumentError, msg
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
- class Collection < Aws::Resources::Collection; end
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