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.
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,1088 +1,1086 @@
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 DBCluster
8
+ module Aws::RDS
9
+ class DBCluster
11
10
 
12
- extend Aws::Deprecations
11
+ extend Aws::Deprecations
13
12
 
14
- # @overload def initialize(id, options = {})
15
- # @param [String] id
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :id
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @id = extract_id(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
13
+ # @overload def initialize(id, options = {})
14
+ # @param [String] id
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :id
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @id = extract_id(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def id
31
- @id
32
- end
33
- alias :db_cluster_identifier :id
28
+ # @return [String]
29
+ def id
30
+ @id
31
+ end
32
+ alias :db_cluster_identifier :id
34
33
 
35
- # Specifies the allocated storage size in gigabytes (GB).
36
- # @return [Integer]
37
- def allocated_storage
38
- data.allocated_storage
39
- end
34
+ # Specifies the allocated storage size in gigabytes (GB).
35
+ # @return [Integer]
36
+ def allocated_storage
37
+ data.allocated_storage
38
+ end
40
39
 
41
- # Provides the list of EC2 Availability Zones that instances in the DB
42
- # cluster can be created in.
43
- # @return [Array<String>]
44
- def availability_zones
45
- data.availability_zones
46
- end
40
+ # Provides the list of EC2 Availability Zones that instances in the DB
41
+ # cluster can be created in.
42
+ # @return [Array<String>]
43
+ def availability_zones
44
+ data.availability_zones
45
+ end
47
46
 
48
- # Specifies the number of days for which automatic DB snapshots are
49
- # retained.
50
- # @return [Integer]
51
- def backup_retention_period
52
- data.backup_retention_period
53
- end
47
+ # Specifies the number of days for which automatic DB snapshots are
48
+ # retained.
49
+ # @return [Integer]
50
+ def backup_retention_period
51
+ data.backup_retention_period
52
+ end
54
53
 
55
- # If present, specifies the name of the character set that this cluster
56
- # is associated with.
57
- # @return [String]
58
- def character_set_name
59
- data.character_set_name
60
- end
54
+ # If present, specifies the name of the character set that this cluster
55
+ # is associated with.
56
+ # @return [String]
57
+ def character_set_name
58
+ data.character_set_name
59
+ end
61
60
 
62
- # Contains the name of the initial database of this DB cluster that was
63
- # provided at create time, if one was specified when the DB cluster was
64
- # created. This same name is returned for the life of the DB cluster.
65
- # @return [String]
66
- def database_name
67
- data.database_name
68
- end
61
+ # Contains the name of the initial database of this DB cluster that was
62
+ # provided at create time, if one was specified when the DB cluster was
63
+ # created. This same name is returned for the life of the DB cluster.
64
+ # @return [String]
65
+ def database_name
66
+ data.database_name
67
+ end
69
68
 
70
- # Specifies the name of the DB cluster parameter group for the DB
71
- # cluster.
72
- # @return [String]
73
- def db_cluster_parameter_group
74
- data.db_cluster_parameter_group
75
- end
69
+ # Specifies the name of the DB cluster parameter group for the DB
70
+ # cluster.
71
+ # @return [String]
72
+ def db_cluster_parameter_group
73
+ data.db_cluster_parameter_group
74
+ end
76
75
 
77
- # Specifies information on the subnet group associated with the DB
78
- # cluster, including the name, description, and subnets in the subnet
79
- # group.
80
- # @return [String]
81
- def db_subnet_group
82
- data.db_subnet_group
83
- end
76
+ # Specifies information on the subnet group associated with the DB
77
+ # cluster, including the name, description, and subnets in the subnet
78
+ # group.
79
+ # @return [String]
80
+ def db_subnet_group
81
+ data.db_subnet_group
82
+ end
84
83
 
85
- # Specifies the current state of this DB cluster.
86
- # @return [String]
87
- def status
88
- data.status
89
- end
84
+ # Specifies the current state of this DB cluster.
85
+ # @return [String]
86
+ def status
87
+ data.status
88
+ end
90
89
 
91
- # Specifies the progress of the operation as a percentage.
92
- # @return [String]
93
- def percent_progress
94
- data.percent_progress
95
- end
90
+ # Specifies the progress of the operation as a percentage.
91
+ # @return [String]
92
+ def percent_progress
93
+ data.percent_progress
94
+ end
96
95
 
97
- # Specifies the earliest time to which a database can be restored with
98
- # point-in-time restore.
99
- # @return [Time]
100
- def earliest_restorable_time
101
- data.earliest_restorable_time
102
- end
96
+ # Specifies the earliest time to which a database can be restored with
97
+ # point-in-time restore.
98
+ # @return [Time]
99
+ def earliest_restorable_time
100
+ data.earliest_restorable_time
101
+ end
103
102
 
104
- # Specifies the connection endpoint for the primary instance of the DB
105
- # cluster.
106
- # @return [String]
107
- def endpoint
108
- data.endpoint
109
- end
103
+ # Specifies the connection endpoint for the primary instance of the DB
104
+ # cluster.
105
+ # @return [String]
106
+ def endpoint
107
+ data.endpoint
108
+ end
110
109
 
111
- # The reader endpoint for the DB cluster. The reader endpoint for a DB
112
- # cluster load-balances connections across the Aurora Replicas that are
113
- # available in a DB cluster. As clients request new connections to the
114
- # reader endpoint, Aurora distributes the connection requests among the
115
- # Aurora Replicas in the DB cluster. This functionality can help balance
116
- # your read workload across multiple Aurora Replicas in your DB cluster.
117
- #
118
- # If a failover occurs, and the Aurora Replica that you are connected to
119
- # is promoted to be the primary instance, your connection will be
120
- # dropped. To continue sending your read workload to other Aurora
121
- # Replicas in the cluster, you can then recoonect to the reader
122
- # endpoint.
123
- # @return [String]
124
- def reader_endpoint
125
- data.reader_endpoint
126
- end
110
+ # The reader endpoint for the DB cluster. The reader endpoint for a DB
111
+ # cluster load-balances connections across the Aurora Replicas that are
112
+ # available in a DB cluster. As clients request new connections to the
113
+ # reader endpoint, Aurora distributes the connection requests among the
114
+ # Aurora Replicas in the DB cluster. This functionality can help balance
115
+ # your read workload across multiple Aurora Replicas in your DB cluster.
116
+ #
117
+ # If a failover occurs, and the Aurora Replica that you are connected to
118
+ # is promoted to be the primary instance, your connection will be
119
+ # dropped. To continue sending your read workload to other Aurora
120
+ # Replicas in the cluster, you can then recoonect to the reader
121
+ # endpoint.
122
+ # @return [String]
123
+ def reader_endpoint
124
+ data.reader_endpoint
125
+ end
127
126
 
128
- # Specifies whether the DB cluster has instances in multiple
129
- # Availability Zones.
130
- # @return [Boolean]
131
- def multi_az
132
- data.multi_az
133
- end
127
+ # Specifies whether the DB cluster has instances in multiple
128
+ # Availability Zones.
129
+ # @return [Boolean]
130
+ def multi_az
131
+ data.multi_az
132
+ end
134
133
 
135
- # Provides the name of the database engine to be used for this DB
136
- # cluster.
137
- # @return [String]
138
- def engine
139
- data.engine
140
- end
134
+ # Provides the name of the database engine to be used for this DB
135
+ # cluster.
136
+ # @return [String]
137
+ def engine
138
+ data.engine
139
+ end
141
140
 
142
- # Indicates the database engine version.
143
- # @return [String]
144
- def engine_version
145
- data.engine_version
146
- end
141
+ # Indicates the database engine version.
142
+ # @return [String]
143
+ def engine_version
144
+ data.engine_version
145
+ end
147
146
 
148
- # Specifies the latest time to which a database can be restored with
149
- # point-in-time restore.
150
- # @return [Time]
151
- def latest_restorable_time
152
- data.latest_restorable_time
153
- end
147
+ # Specifies the latest time to which a database can be restored with
148
+ # point-in-time restore.
149
+ # @return [Time]
150
+ def latest_restorable_time
151
+ data.latest_restorable_time
152
+ end
154
153
 
155
- # Specifies the port that the database engine is listening on.
156
- # @return [Integer]
157
- def port
158
- data.port
159
- end
154
+ # Specifies the port that the database engine is listening on.
155
+ # @return [Integer]
156
+ def port
157
+ data.port
158
+ end
160
159
 
161
- # Contains the master username for the DB cluster.
162
- # @return [String]
163
- def master_username
164
- data.master_username
165
- end
160
+ # Contains the master username for the DB cluster.
161
+ # @return [String]
162
+ def master_username
163
+ data.master_username
164
+ end
166
165
 
167
- # Provides the list of option group memberships for this DB cluster.
168
- # @return [Array<Types::DBClusterOptionGroupStatus>]
169
- def db_cluster_option_group_memberships
170
- data.db_cluster_option_group_memberships
171
- end
166
+ # Provides the list of option group memberships for this DB cluster.
167
+ # @return [Array<Types::DBClusterOptionGroupStatus>]
168
+ def db_cluster_option_group_memberships
169
+ data.db_cluster_option_group_memberships
170
+ end
172
171
 
173
- # Specifies the daily time range during which automated backups are
174
- # created if automated backups are enabled, as determined by the
175
- # `BackupRetentionPeriod`.
176
- # @return [String]
177
- def preferred_backup_window
178
- data.preferred_backup_window
179
- end
172
+ # Specifies the daily time range during which automated backups are
173
+ # created if automated backups are enabled, as determined by the
174
+ # `BackupRetentionPeriod`.
175
+ # @return [String]
176
+ def preferred_backup_window
177
+ data.preferred_backup_window
178
+ end
180
179
 
181
- # Specifies the weekly time range during which system maintenance can
182
- # occur, in Universal Coordinated Time (UTC).
183
- # @return [String]
184
- def preferred_maintenance_window
185
- data.preferred_maintenance_window
186
- end
180
+ # Specifies the weekly time range during which system maintenance can
181
+ # occur, in Universal Coordinated Time (UTC).
182
+ # @return [String]
183
+ def preferred_maintenance_window
184
+ data.preferred_maintenance_window
185
+ end
187
186
 
188
- # Contains the identifier of the source DB cluster if this DB cluster is
189
- # a Read Replica.
190
- # @return [String]
191
- def replication_source_identifier
192
- data.replication_source_identifier
193
- end
187
+ # Contains the identifier of the source DB cluster if this DB cluster is
188
+ # a Read Replica.
189
+ # @return [String]
190
+ def replication_source_identifier
191
+ data.replication_source_identifier
192
+ end
194
193
 
195
- # Contains one or more identifiers of the Read Replicas associated with
196
- # this DB cluster.
197
- # @return [Array<String>]
198
- def read_replica_identifiers
199
- data.read_replica_identifiers
200
- end
194
+ # Contains one or more identifiers of the Read Replicas associated with
195
+ # this DB cluster.
196
+ # @return [Array<String>]
197
+ def read_replica_identifiers
198
+ data.read_replica_identifiers
199
+ end
201
200
 
202
- # Provides the list of instances that make up the DB cluster.
203
- # @return [Array<Types::DBClusterMember>]
204
- def db_cluster_members
205
- data.db_cluster_members
206
- end
201
+ # Provides the list of instances that make up the DB cluster.
202
+ # @return [Array<Types::DBClusterMember>]
203
+ def db_cluster_members
204
+ data.db_cluster_members
205
+ end
207
206
 
208
- # Provides a list of VPC security groups that the DB cluster belongs to.
209
- # @return [Array<Types::VpcSecurityGroupMembership>]
210
- def vpc_security_groups
211
- data.vpc_security_groups
212
- end
207
+ # Provides a list of VPC security groups that the DB cluster belongs to.
208
+ # @return [Array<Types::VpcSecurityGroupMembership>]
209
+ def vpc_security_groups
210
+ data.vpc_security_groups
211
+ end
213
212
 
214
- # Specifies the ID that Amazon Route 53 assigns when you create a hosted
215
- # zone.
216
- # @return [String]
217
- def hosted_zone_id
218
- data.hosted_zone_id
219
- end
213
+ # Specifies the ID that Amazon Route 53 assigns when you create a hosted
214
+ # zone.
215
+ # @return [String]
216
+ def hosted_zone_id
217
+ data.hosted_zone_id
218
+ end
220
219
 
221
- # Specifies whether the DB cluster is encrypted.
222
- # @return [Boolean]
223
- def storage_encrypted
224
- data.storage_encrypted
225
- end
220
+ # Specifies whether the DB cluster is encrypted.
221
+ # @return [Boolean]
222
+ def storage_encrypted
223
+ data.storage_encrypted
224
+ end
226
225
 
227
- # If `StorageEncrypted` is true, the KMS key identifier for the
228
- # encrypted DB cluster.
229
- # @return [String]
230
- def kms_key_id
231
- data.kms_key_id
232
- end
226
+ # If `StorageEncrypted` is true, the KMS key identifier for the
227
+ # encrypted DB cluster.
228
+ # @return [String]
229
+ def kms_key_id
230
+ data.kms_key_id
231
+ end
233
232
 
234
- # The region-unique, immutable identifier for the DB cluster. This
235
- # identifier is found in AWS CloudTrail log entries whenever the KMS key
236
- # for the DB cluster is accessed.
237
- # @return [String]
238
- def db_cluster_resource_id
239
- data.db_cluster_resource_id
240
- end
233
+ # The region-unique, immutable identifier for the DB cluster. This
234
+ # identifier is found in AWS CloudTrail log entries whenever the KMS key
235
+ # for the DB cluster is accessed.
236
+ # @return [String]
237
+ def db_cluster_resource_id
238
+ data.db_cluster_resource_id
239
+ end
241
240
 
242
- # The Amazon Resource Name (ARN) for the DB cluster.
243
- # @return [String]
244
- def db_cluster_arn
245
- data.db_cluster_arn
246
- end
241
+ # The Amazon Resource Name (ARN) for the DB cluster.
242
+ # @return [String]
243
+ def db_cluster_arn
244
+ data.db_cluster_arn
245
+ end
247
246
 
248
- # Provides a list of the AWS Identity and Access Management (IAM) roles
249
- # that are associated with the DB cluster. IAM roles that are associated
250
- # with a DB cluster grant permission for the DB cluster to access other
251
- # AWS services on your behalf.
252
- # @return [Array<Types::DBClusterRole>]
253
- def associated_roles
254
- data.associated_roles
255
- end
247
+ # Provides a list of the AWS Identity and Access Management (IAM) roles
248
+ # that are associated with the DB cluster. IAM roles that are associated
249
+ # with a DB cluster grant permission for the DB cluster to access other
250
+ # AWS services on your behalf.
251
+ # @return [Array<Types::DBClusterRole>]
252
+ def associated_roles
253
+ data.associated_roles
254
+ end
256
255
 
257
- # Specifies the time when the DB cluster was created, in Universal
258
- # Coordinated Time (UTC).
259
- # @return [Time]
260
- def cluster_create_time
261
- data.cluster_create_time
262
- end
256
+ # Specifies the time when the DB cluster was created, in Universal
257
+ # Coordinated Time (UTC).
258
+ # @return [Time]
259
+ def cluster_create_time
260
+ data.cluster_create_time
261
+ end
263
262
 
264
- # @!endgroup
263
+ # @!endgroup
265
264
 
266
- # @return [Client]
267
- def client
268
- @client
269
- end
265
+ # @return [Client]
266
+ def client
267
+ @client
268
+ end
270
269
 
271
- # Loads, or reloads {#data} for the current {DBCluster}.
272
- # Returns `self` making it possible to chain methods.
273
- #
274
- # db_cluster.reload.data
275
- #
276
- # @return [self]
277
- def load
278
- resp = @client.describe_db_clusters(db_cluster_identifier: @id)
279
- @data = resp.dbclusters[0]
280
- self
281
- end
282
- alias :reload :load
270
+ # Loads, or reloads {#data} for the current {DBCluster}.
271
+ # Returns `self` making it possible to chain methods.
272
+ #
273
+ # db_cluster.reload.data
274
+ #
275
+ # @return [self]
276
+ def load
277
+ resp = @client.describe_db_clusters(db_cluster_identifier: @id)
278
+ @data = resp.dbclusters[0]
279
+ self
280
+ end
281
+ alias :reload :load
283
282
 
284
- # @return [Types::DBCluster]
285
- # Returns the data for this {DBCluster}. Calls
286
- # {Client#describe_db_clusters} if {#data_loaded?} is `false`.
287
- def data
288
- load unless @data
289
- @data
290
- end
283
+ # @return [Types::DBCluster]
284
+ # Returns the data for this {DBCluster}. Calls
285
+ # {Client#describe_db_clusters} if {#data_loaded?} is `false`.
286
+ def data
287
+ load unless @data
288
+ @data
289
+ end
291
290
 
292
- # @return [Boolean]
293
- # Returns `true` if this resource is loaded. Accessing attributes or
294
- # {#data} on an unloaded resource will trigger a call to {#load}.
295
- def data_loaded?
296
- !!@data
297
- end
291
+ # @return [Boolean]
292
+ # Returns `true` if this resource is loaded. Accessing attributes or
293
+ # {#data} on an unloaded resource will trigger a call to {#load}.
294
+ def data_loaded?
295
+ !!@data
296
+ end
298
297
 
299
- # @!group Actions
298
+ # @!group Actions
300
299
 
301
- # @example Request syntax with placeholder values
302
- #
303
- # dbcluster = db_cluster.create({
304
- # availability_zones: ["String"],
305
- # backup_retention_period: 1,
306
- # character_set_name: "String",
307
- # database_name: "String",
308
- # db_cluster_parameter_group_name: "String",
309
- # vpc_security_group_ids: ["String"],
310
- # db_subnet_group_name: "String",
311
- # engine: "String", # required
312
- # engine_version: "String",
313
- # port: 1,
314
- # master_username: "String",
315
- # master_user_password: "String",
316
- # option_group_name: "String",
317
- # preferred_backup_window: "String",
318
- # preferred_maintenance_window: "String",
319
- # replication_source_identifier: "String",
320
- # tags: [
321
- # {
322
- # key: "String",
323
- # value: "String",
324
- # },
325
- # ],
326
- # storage_encrypted: false,
327
- # kms_key_id: "String",
328
- # })
329
- # @param [Hash] options ({})
330
- # @option options [Array<String>] :availability_zones
331
- # A list of EC2 Availability Zones that instances in the DB cluster can
332
- # be created in. For information on regions and Availability Zones, see
333
- # [Regions and Availability Zones][1].
334
- #
335
- #
336
- #
337
- # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
338
- # @option options [Integer] :backup_retention_period
339
- # The number of days for which automated backups are retained. You must
340
- # specify a minimum value of 1.
341
- #
342
- # Default: 1
343
- #
344
- # Constraints:
345
- #
346
- # * Must be a value from 1 to 35
347
- #
348
- # ^
349
- # @option options [String] :character_set_name
350
- # A value that indicates that the DB cluster should be associated with
351
- # the specified CharacterSet.
352
- # @option options [String] :database_name
353
- # The name for your database of up to 8 alpha-numeric characters. If you
354
- # do not provide a name, Amazon RDS will not create a database in the DB
355
- # cluster you are creating.
356
- # @option options [String] :db_cluster_parameter_group_name
357
- # The name of the DB cluster parameter group to associate with this DB
358
- # cluster. If this argument is omitted, `default.aurora5.6` will be
359
- # used.
360
- #
361
- # Constraints:
362
- #
363
- # * Must be 1 to 255 alphanumeric characters
364
- #
365
- # * First character must be a letter
366
- #
367
- # * Cannot end with a hyphen or contain two consecutive hyphens
368
- # @option options [Array<String>] :vpc_security_group_ids
369
- # A list of EC2 VPC security groups to associate with this DB cluster.
370
- # @option options [String] :db_subnet_group_name
371
- # A DB subnet group to associate with this DB cluster.
372
- #
373
- # Constraints: Must contain no more than 255 alphanumeric characters,
374
- # periods, underscores, spaces, or hyphens. Must not be default.
375
- #
376
- # Example: `mySubnetgroup`
377
- # @option options [required, String] :engine
378
- # The name of the database engine to be used for this DB cluster.
379
- #
380
- # Valid Values: `aurora`
381
- # @option options [String] :engine_version
382
- # The version number of the database engine to use.
383
- #
384
- # **Aurora**
385
- #
386
- # Example: `5.6.10a`
387
- # @option options [Integer] :port
388
- # The port number on which the instances in the DB cluster accept
389
- # connections.
390
- #
391
- # Default: `3306`
392
- # @option options [String] :master_username
393
- # The name of the master user for the DB cluster.
394
- #
395
- # Constraints:
396
- #
397
- # * Must be 1 to 16 alphanumeric characters.
398
- #
399
- # * First character must be a letter.
400
- #
401
- # * Cannot be a reserved word for the chosen database engine.
402
- # @option options [String] :master_user_password
403
- # The password for the master database user. This password can contain
404
- # any printable ASCII character except "/", """, or "@".
405
- #
406
- # Constraints: Must contain from 8 to 41 characters.
407
- # @option options [String] :option_group_name
408
- # A value that indicates that the DB cluster should be associated with
409
- # the specified option group.
410
- #
411
- # Permanent options cannot be removed from an option group. The option
412
- # group cannot be removed from a DB cluster once it is associated with a
413
- # DB cluster.
414
- # @option options [String] :preferred_backup_window
415
- # The daily time range during which automated backups are created if
416
- # automated backups are enabled using the `BackupRetentionPeriod`
417
- # parameter.
418
- #
419
- # Default: A 30-minute window selected at random from an 8-hour block of
420
- # time per region. To see the time blocks available, see [ Adjusting the
421
- # Preferred Maintenance Window][1] in the *Amazon RDS User Guide.*
422
- #
423
- # Constraints:
424
- #
425
- # * Must be in the format `hh24:mi-hh24:mi`.
426
- #
427
- # * Times should be in Universal Coordinated Time (UTC).
428
- #
429
- # * Must not conflict with the preferred maintenance window.
430
- #
431
- # * Must be at least 30 minutes.
432
- #
433
- #
434
- #
435
- # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
436
- # @option options [String] :preferred_maintenance_window
437
- # The weekly time range during which system maintenance can occur, in
438
- # Universal Coordinated Time (UTC).
439
- #
440
- # Format: `ddd:hh24:mi-ddd:hh24:mi`
441
- #
442
- # Default: A 30-minute window selected at random from an 8-hour block of
443
- # time per region, occurring on a random day of the week. To see the
444
- # time blocks available, see [ Adjusting the Preferred Maintenance
445
- # Window][1] in the *Amazon RDS User Guide.*
446
- #
447
- # Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
448
- #
449
- # Constraints: Minimum 30-minute window.
450
- #
451
- #
452
- #
453
- # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
454
- # @option options [String] :replication_source_identifier
455
- # The Amazon Resource Name (ARN) of the source DB cluster if this DB
456
- # cluster is created as a Read Replica.
457
- # @option options [Array<Types::Tag>] :tags
458
- # A list of tags.
459
- # @option options [Boolean] :storage_encrypted
460
- # Specifies whether the DB cluster is encrypted.
461
- # @option options [String] :kms_key_id
462
- # The KMS key identifier for an encrypted DB cluster.
463
- #
464
- # The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
465
- # encryption key. If you are creating a DB cluster with the same AWS
466
- # account that owns the KMS encryption key used to encrypt the new DB
467
- # cluster, then you can use the KMS key alias instead of the ARN for the
468
- # KM encryption key.
469
- #
470
- # If the `StorageEncrypted` parameter is true, and you do not specify a
471
- # value for the `KmsKeyId` parameter, then Amazon RDS will use your
472
- # default encryption key. AWS KMS creates the default encryption key for
473
- # your AWS account. Your AWS account has a different default encryption
474
- # key for each AWS region.
475
- # @return [DBCluster]
476
- def create(options = {})
477
- options = options.merge(db_cluster_identifier: @id)
478
- resp = @client.create_db_cluster(options)
479
- DBCluster.new(
480
- id: resp.data.db_cluster.db_cluster_identifier,
481
- data: resp.data.db_cluster,
482
- client: @client
483
- )
484
- end
300
+ # @example Request syntax with placeholder values
301
+ #
302
+ # dbcluster = db_cluster.create({
303
+ # availability_zones: ["String"],
304
+ # backup_retention_period: 1,
305
+ # character_set_name: "String",
306
+ # database_name: "String",
307
+ # db_cluster_parameter_group_name: "String",
308
+ # vpc_security_group_ids: ["String"],
309
+ # db_subnet_group_name: "String",
310
+ # engine: "String", # required
311
+ # engine_version: "String",
312
+ # port: 1,
313
+ # master_username: "String",
314
+ # master_user_password: "String",
315
+ # option_group_name: "String",
316
+ # preferred_backup_window: "String",
317
+ # preferred_maintenance_window: "String",
318
+ # replication_source_identifier: "String",
319
+ # tags: [
320
+ # {
321
+ # key: "String",
322
+ # value: "String",
323
+ # },
324
+ # ],
325
+ # storage_encrypted: false,
326
+ # kms_key_id: "String",
327
+ # })
328
+ # @param [Hash] options ({})
329
+ # @option options [Array<String>] :availability_zones
330
+ # A list of EC2 Availability Zones that instances in the DB cluster can
331
+ # be created in. For information on regions and Availability Zones, see
332
+ # [Regions and Availability Zones][1].
333
+ #
334
+ #
335
+ #
336
+ # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
337
+ # @option options [Integer] :backup_retention_period
338
+ # The number of days for which automated backups are retained. You must
339
+ # specify a minimum value of 1.
340
+ #
341
+ # Default: 1
342
+ #
343
+ # Constraints:
344
+ #
345
+ # * Must be a value from 1 to 35
346
+ #
347
+ # ^
348
+ # @option options [String] :character_set_name
349
+ # A value that indicates that the DB cluster should be associated with
350
+ # the specified CharacterSet.
351
+ # @option options [String] :database_name
352
+ # The name for your database of up to 8 alpha-numeric characters. If you
353
+ # do not provide a name, Amazon RDS will not create a database in the DB
354
+ # cluster you are creating.
355
+ # @option options [String] :db_cluster_parameter_group_name
356
+ # The name of the DB cluster parameter group to associate with this DB
357
+ # cluster. If this argument is omitted, `default.aurora5.6` will be
358
+ # used.
359
+ #
360
+ # Constraints:
361
+ #
362
+ # * Must be 1 to 255 alphanumeric characters
363
+ #
364
+ # * First character must be a letter
365
+ #
366
+ # * Cannot end with a hyphen or contain two consecutive hyphens
367
+ # @option options [Array<String>] :vpc_security_group_ids
368
+ # A list of EC2 VPC security groups to associate with this DB cluster.
369
+ # @option options [String] :db_subnet_group_name
370
+ # A DB subnet group to associate with this DB cluster.
371
+ #
372
+ # Constraints: Must contain no more than 255 alphanumeric characters,
373
+ # periods, underscores, spaces, or hyphens. Must not be default.
374
+ #
375
+ # Example: `mySubnetgroup`
376
+ # @option options [required, String] :engine
377
+ # The name of the database engine to be used for this DB cluster.
378
+ #
379
+ # Valid Values: `aurora`
380
+ # @option options [String] :engine_version
381
+ # The version number of the database engine to use.
382
+ #
383
+ # **Aurora**
384
+ #
385
+ # Example: `5.6.10a`
386
+ # @option options [Integer] :port
387
+ # The port number on which the instances in the DB cluster accept
388
+ # connections.
389
+ #
390
+ # Default: `3306`
391
+ # @option options [String] :master_username
392
+ # The name of the master user for the DB cluster.
393
+ #
394
+ # Constraints:
395
+ #
396
+ # * Must be 1 to 16 alphanumeric characters.
397
+ #
398
+ # * First character must be a letter.
399
+ #
400
+ # * Cannot be a reserved word for the chosen database engine.
401
+ # @option options [String] :master_user_password
402
+ # The password for the master database user. This password can contain
403
+ # any printable ASCII character except "/", """, or "@".
404
+ #
405
+ # Constraints: Must contain from 8 to 41 characters.
406
+ # @option options [String] :option_group_name
407
+ # A value that indicates that the DB cluster should be associated with
408
+ # the specified option group.
409
+ #
410
+ # Permanent options cannot be removed from an option group. The option
411
+ # group cannot be removed from a DB cluster once it is associated with a
412
+ # DB cluster.
413
+ # @option options [String] :preferred_backup_window
414
+ # The daily time range during which automated backups are created if
415
+ # automated backups are enabled using the `BackupRetentionPeriod`
416
+ # parameter.
417
+ #
418
+ # Default: A 30-minute window selected at random from an 8-hour block of
419
+ # time per region. To see the time blocks available, see [ Adjusting the
420
+ # Preferred Maintenance Window][1] in the *Amazon RDS User Guide.*
421
+ #
422
+ # Constraints:
423
+ #
424
+ # * Must be in the format `hh24:mi-hh24:mi`.
425
+ #
426
+ # * Times should be in Universal Coordinated Time (UTC).
427
+ #
428
+ # * Must not conflict with the preferred maintenance window.
429
+ #
430
+ # * Must be at least 30 minutes.
431
+ #
432
+ #
433
+ #
434
+ # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
435
+ # @option options [String] :preferred_maintenance_window
436
+ # The weekly time range during which system maintenance can occur, in
437
+ # Universal Coordinated Time (UTC).
438
+ #
439
+ # Format: `ddd:hh24:mi-ddd:hh24:mi`
440
+ #
441
+ # Default: A 30-minute window selected at random from an 8-hour block of
442
+ # time per region, occurring on a random day of the week. To see the
443
+ # time blocks available, see [ Adjusting the Preferred Maintenance
444
+ # Window][1] in the *Amazon RDS User Guide.*
445
+ #
446
+ # Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
447
+ #
448
+ # Constraints: Minimum 30-minute window.
449
+ #
450
+ #
451
+ #
452
+ # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
453
+ # @option options [String] :replication_source_identifier
454
+ # The Amazon Resource Name (ARN) of the source DB instance or DB cluster
455
+ # if this DB cluster is created as a Read Replica.
456
+ # @option options [Array<Types::Tag>] :tags
457
+ # A list of tags.
458
+ # @option options [Boolean] :storage_encrypted
459
+ # Specifies whether the DB cluster is encrypted.
460
+ # @option options [String] :kms_key_id
461
+ # The KMS key identifier for an encrypted DB cluster.
462
+ #
463
+ # The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
464
+ # encryption key. If you are creating a DB cluster with the same AWS
465
+ # account that owns the KMS encryption key used to encrypt the new DB
466
+ # cluster, then you can use the KMS key alias instead of the ARN for the
467
+ # KM encryption key.
468
+ #
469
+ # If the `StorageEncrypted` parameter is true, and you do not specify a
470
+ # value for the `KmsKeyId` parameter, then Amazon RDS will use your
471
+ # default encryption key. AWS KMS creates the default encryption key for
472
+ # your AWS account. Your AWS account has a different default encryption
473
+ # key for each AWS region.
474
+ # @return [DBCluster]
475
+ def create(options = {})
476
+ options = options.merge(db_cluster_identifier: @id)
477
+ resp = @client.create_db_cluster(options)
478
+ DBCluster.new(
479
+ id: resp.data.db_cluster.db_cluster_identifier,
480
+ data: resp.data.db_cluster,
481
+ client: @client
482
+ )
483
+ end
485
484
 
486
- # @example Request syntax with placeholder values
487
- #
488
- # dbclustersnapshot = db_cluster.create_snapshot({
489
- # db_cluster_snapshot_identifier: "String", # required
490
- # tags: [
491
- # {
492
- # key: "String",
493
- # value: "String",
494
- # },
495
- # ],
496
- # })
497
- # @param [Hash] options ({})
498
- # @option options [required, String] :db_cluster_snapshot_identifier
499
- # The identifier of the DB cluster snapshot. This parameter is stored as
500
- # a lowercase string.
501
- #
502
- # Constraints:
503
- #
504
- # * Must contain from 1 to 63 alphanumeric characters or hyphens.
505
- #
506
- # * First character must be a letter.
507
- #
508
- # * Cannot end with a hyphen or contain two consecutive hyphens.
509
- #
510
- # Example: `my-cluster1-snapshot1`
511
- # @option options [Array<Types::Tag>] :tags
512
- # The tags to be assigned to the DB cluster snapshot.
513
- # @return [DBClusterSnapshot]
514
- def create_snapshot(options = {})
515
- options = options.merge(db_cluster_identifier: @id)
516
- resp = @client.create_db_cluster_snapshot(options)
517
- DBClusterSnapshot.new(
518
- cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
519
- snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
520
- data: resp.data.db_cluster_snapshot,
521
- client: @client
522
- )
523
- end
485
+ # @example Request syntax with placeholder values
486
+ #
487
+ # dbclustersnapshot = db_cluster.create_snapshot({
488
+ # db_cluster_snapshot_identifier: "String", # required
489
+ # tags: [
490
+ # {
491
+ # key: "String",
492
+ # value: "String",
493
+ # },
494
+ # ],
495
+ # })
496
+ # @param [Hash] options ({})
497
+ # @option options [required, String] :db_cluster_snapshot_identifier
498
+ # The identifier of the DB cluster snapshot. This parameter is stored as
499
+ # a lowercase string.
500
+ #
501
+ # Constraints:
502
+ #
503
+ # * Must contain from 1 to 63 alphanumeric characters or hyphens.
504
+ #
505
+ # * First character must be a letter.
506
+ #
507
+ # * Cannot end with a hyphen or contain two consecutive hyphens.
508
+ #
509
+ # Example: `my-cluster1-snapshot1`
510
+ # @option options [Array<Types::Tag>] :tags
511
+ # The tags to be assigned to the DB cluster snapshot.
512
+ # @return [DBClusterSnapshot]
513
+ def create_snapshot(options = {})
514
+ options = options.merge(db_cluster_identifier: @id)
515
+ resp = @client.create_db_cluster_snapshot(options)
516
+ DBClusterSnapshot.new(
517
+ cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
518
+ snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
519
+ data: resp.data.db_cluster_snapshot,
520
+ client: @client
521
+ )
522
+ end
524
523
 
525
- # @example Request syntax with placeholder values
526
- #
527
- # dbcluster = db_cluster.delete({
528
- # skip_final_snapshot: false,
529
- # final_db_snapshot_identifier: "String",
530
- # })
531
- # @param [Hash] options ({})
532
- # @option options [Boolean] :skip_final_snapshot
533
- # Determines whether a final DB cluster snapshot is created before the
534
- # DB cluster is deleted. If `true` is specified, no DB cluster snapshot
535
- # is created. If `false` is specified, a DB cluster snapshot is created
536
- # before the DB cluster is deleted.
537
- #
538
- # <note markdown="1"> You must specify a `FinalDBSnapshotIdentifier` parameter if
539
- # `SkipFinalSnapshot` is `false`.
540
- #
541
- # </note>
542
- #
543
- # Default: `false`
544
- # @option options [String] :final_db_snapshot_identifier
545
- # The DB cluster snapshot identifier of the new DB cluster snapshot
546
- # created when `SkipFinalSnapshot` is set to `false`.
547
- #
548
- # <note markdown="1"> Specifying this parameter and also setting the `SkipFinalShapshot`
549
- # parameter to true results in an error.
550
- #
551
- # </note>
552
- #
553
- # Constraints:
554
- #
555
- # * Must be 1 to 255 alphanumeric characters
556
- #
557
- # * First character must be a letter
558
- #
559
- # * Cannot end with a hyphen or contain two consecutive hyphens
560
- # @return [DBCluster]
561
- def delete(options = {})
562
- options = options.merge(db_cluster_identifier: @id)
563
- resp = @client.delete_db_cluster(options)
564
- DBCluster.new(
565
- id: resp.data.db_cluster.db_cluster_identifier,
566
- data: resp.data.db_cluster,
567
- client: @client
524
+ # @example Request syntax with placeholder values
525
+ #
526
+ # dbcluster = db_cluster.delete({
527
+ # skip_final_snapshot: false,
528
+ # final_db_snapshot_identifier: "String",
529
+ # })
530
+ # @param [Hash] options ({})
531
+ # @option options [Boolean] :skip_final_snapshot
532
+ # Determines whether a final DB cluster snapshot is created before the
533
+ # DB cluster is deleted. If `true` is specified, no DB cluster snapshot
534
+ # is created. If `false` is specified, a DB cluster snapshot is created
535
+ # before the DB cluster is deleted.
536
+ #
537
+ # <note markdown="1"> You must specify a `FinalDBSnapshotIdentifier` parameter if
538
+ # `SkipFinalSnapshot` is `false`.
539
+ #
540
+ # </note>
541
+ #
542
+ # Default: `false`
543
+ # @option options [String] :final_db_snapshot_identifier
544
+ # The DB cluster snapshot identifier of the new DB cluster snapshot
545
+ # created when `SkipFinalSnapshot` is set to `false`.
546
+ #
547
+ # <note markdown="1"> Specifying this parameter and also setting the `SkipFinalShapshot`
548
+ # parameter to true results in an error.
549
+ #
550
+ # </note>
551
+ #
552
+ # Constraints:
553
+ #
554
+ # * Must be 1 to 255 alphanumeric characters
555
+ #
556
+ # * First character must be a letter
557
+ #
558
+ # * Cannot end with a hyphen or contain two consecutive hyphens
559
+ # @return [DBCluster]
560
+ def delete(options = {})
561
+ options = options.merge(db_cluster_identifier: @id)
562
+ resp = @client.delete_db_cluster(options)
563
+ DBCluster.new(
564
+ id: resp.data.db_cluster.db_cluster_identifier,
565
+ data: resp.data.db_cluster,
566
+ client: @client
567
+ )
568
+ end
569
+
570
+ # @example Request syntax with placeholder values
571
+ #
572
+ # dbcluster = db_cluster.failover({
573
+ # target_db_instance_identifier: "String",
574
+ # })
575
+ # @param [Hash] options ({})
576
+ # @option options [String] :target_db_instance_identifier
577
+ # The name of the instance to promote to the primary instance.
578
+ #
579
+ # You must specify the instance identifier for an Aurora Replica in the
580
+ # DB cluster. For example, `mydbcluster-replica1`.
581
+ # @return [DBCluster]
582
+ def failover(options = {})
583
+ options = options.merge(db_cluster_identifier: @id)
584
+ resp = @client.failover_db_cluster(options)
585
+ DBCluster.new(
586
+ id: resp.data.db_cluster.db_cluster_identifier,
587
+ data: resp.data.db_cluster,
588
+ client: @client
589
+ )
590
+ end
591
+
592
+ # @example Request syntax with placeholder values
593
+ #
594
+ # dbcluster = db_cluster.modify({
595
+ # new_db_cluster_identifier: "String",
596
+ # apply_immediately: false,
597
+ # backup_retention_period: 1,
598
+ # db_cluster_parameter_group_name: "String",
599
+ # vpc_security_group_ids: ["String"],
600
+ # port: 1,
601
+ # master_user_password: "String",
602
+ # option_group_name: "String",
603
+ # preferred_backup_window: "String",
604
+ # preferred_maintenance_window: "String",
605
+ # })
606
+ # @param [Hash] options ({})
607
+ # @option options [String] :new_db_cluster_identifier
608
+ # The new DB cluster identifier for the DB cluster when renaming a DB
609
+ # cluster. This value is stored as a lowercase string.
610
+ #
611
+ # Constraints:
612
+ #
613
+ # * Must contain from 1 to 63 alphanumeric characters or hyphens
614
+ #
615
+ # * First character must be a letter
616
+ #
617
+ # * Cannot end with a hyphen or contain two consecutive hyphens
618
+ #
619
+ # Example: `my-cluster2`
620
+ # @option options [Boolean] :apply_immediately
621
+ # A value that specifies whether the modifications in this request and
622
+ # any pending modifications are asynchronously applied as soon as
623
+ # possible, regardless of the `PreferredMaintenanceWindow` setting for
624
+ # the DB cluster. If this parameter is set to `false`, changes to the DB
625
+ # cluster are applied during the next maintenance window.
626
+ #
627
+ # The `ApplyImmediately` parameter only affects the
628
+ # `NewDBClusterIdentifier` and `MasterUserPassword` values. If you set
629
+ # the `ApplyImmediately` parameter value to false, then changes to the
630
+ # `NewDBClusterIdentifier` and `MasterUserPassword` values are applied
631
+ # during the next maintenance window. All other changes are applied
632
+ # immediately, regardless of the value of the `ApplyImmediately`
633
+ # parameter.
634
+ #
635
+ # Default: `false`
636
+ # @option options [Integer] :backup_retention_period
637
+ # The number of days for which automated backups are retained. You must
638
+ # specify a minimum value of 1.
639
+ #
640
+ # Default: 1
641
+ #
642
+ # Constraints:
643
+ #
644
+ # * Must be a value from 1 to 35
645
+ #
646
+ # ^
647
+ # @option options [String] :db_cluster_parameter_group_name
648
+ # The name of the DB cluster parameter group to use for the DB cluster.
649
+ # @option options [Array<String>] :vpc_security_group_ids
650
+ # A lst of VPC security groups that the DB cluster will belong to.
651
+ # @option options [Integer] :port
652
+ # The port number on which the DB cluster accepts connections.
653
+ #
654
+ # Constraints: Value must be `1150-65535`
655
+ #
656
+ # Default: The same port as the original DB cluster.
657
+ # @option options [String] :master_user_password
658
+ # The new password for the master database user. This password can
659
+ # contain any printable ASCII character except "/", """, or "@".
660
+ #
661
+ # Constraints: Must contain from 8 to 41 characters.
662
+ # @option options [String] :option_group_name
663
+ # A value that indicates that the DB cluster should be associated with
664
+ # the specified option group. Changing this parameter does not result in
665
+ # an outage except in the following case, and the change is applied
666
+ # during the next maintenance window unless the `ApplyImmediately`
667
+ # parameter is set to `true` for this request. If the parameter change
668
+ # results in an option group that enables OEM, this change can cause a
669
+ # brief (sub-second) period during which new connections are rejected
670
+ # but existing connections are not interrupted.
671
+ #
672
+ # Permanent options cannot be removed from an option group. The option
673
+ # group cannot be removed from a DB cluster once it is associated with a
674
+ # DB cluster.
675
+ # @option options [String] :preferred_backup_window
676
+ # The daily time range during which automated backups are created if
677
+ # automated backups are enabled, using the `BackupRetentionPeriod`
678
+ # parameter.
679
+ #
680
+ # Default: A 30-minute window selected at random from an 8-hour block of
681
+ # time per region. To see the time blocks available, see [ Adjusting the
682
+ # Preferred Maintenance Window][1] in the *Amazon RDS User Guide.*
683
+ #
684
+ # Constraints:
685
+ #
686
+ # * Must be in the format `hh24:mi-hh24:mi`.
687
+ #
688
+ # * Times should be in Universal Coordinated Time (UTC).
689
+ #
690
+ # * Must not conflict with the preferred maintenance window.
691
+ #
692
+ # * Must be at least 30 minutes.
693
+ #
694
+ #
695
+ #
696
+ # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
697
+ # @option options [String] :preferred_maintenance_window
698
+ # The weekly time range during which system maintenance can occur, in
699
+ # Universal Coordinated Time (UTC).
700
+ #
701
+ # Format: `ddd:hh24:mi-ddd:hh24:mi`
702
+ #
703
+ # Default: A 30-minute window selected at random from an 8-hour block of
704
+ # time per region, occurring on a random day of the week. To see the
705
+ # time blocks available, see [ Adjusting the Preferred Maintenance
706
+ # Window][1] in the *Amazon RDS User Guide.*
707
+ #
708
+ # Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
709
+ #
710
+ # Constraints: Minimum 30-minute window.
711
+ #
712
+ #
713
+ #
714
+ # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
715
+ # @return [DBCluster]
716
+ def modify(options = {})
717
+ options = options.merge(db_cluster_identifier: @id)
718
+ resp = @client.modify_db_cluster(options)
719
+ DBCluster.new(
720
+ id: resp.data.db_cluster.db_cluster_identifier,
721
+ data: resp.data.db_cluster,
722
+ client: @client
723
+ )
724
+ end
725
+
726
+ # @example Request syntax with placeholder values
727
+ #
728
+ # dbcluster = db_cluster.restore({
729
+ # db_cluster_identifier: "String", # required
730
+ # restore_to_time: Time.now,
731
+ # use_latest_restorable_time: false,
732
+ # port: 1,
733
+ # db_subnet_group_name: "String",
734
+ # option_group_name: "String",
735
+ # vpc_security_group_ids: ["String"],
736
+ # tags: [
737
+ # {
738
+ # key: "String",
739
+ # value: "String",
740
+ # },
741
+ # ],
742
+ # kms_key_id: "String",
743
+ # })
744
+ # @param [Hash] options ({})
745
+ # @option options [required, String] :db_cluster_identifier
746
+ # The name of the new DB cluster to be created.
747
+ #
748
+ # Constraints:
749
+ #
750
+ # * Must contain from 1 to 63 alphanumeric characters or hyphens
751
+ #
752
+ # * First character must be a letter
753
+ #
754
+ # * Cannot end with a hyphen or contain two consecutive hyphens
755
+ # @option options [Time,DateTime,Date,Integer,String] :restore_to_time
756
+ # The date and time to restore the DB cluster to.
757
+ #
758
+ # Valid Values: Value must be a time in Universal Coordinated Time (UTC)
759
+ # format
760
+ #
761
+ # Constraints:
762
+ #
763
+ # * Must be before the latest restorable time for the DB instance
764
+ #
765
+ # * Cannot be specified if `UseLatestRestorableTime` parameter is true
766
+ #
767
+ # Example: `2015-03-07T23:45:00Z`
768
+ # @option options [Boolean] :use_latest_restorable_time
769
+ # A value that is set to `true` to restore the DB cluster to the latest
770
+ # restorable backup time, and `false` otherwise.
771
+ #
772
+ # Default: `false`
773
+ #
774
+ # Constraints: Cannot be specified if `RestoreToTime` parameter is
775
+ # provided.
776
+ # @option options [Integer] :port
777
+ # The port number on which the new DB cluster accepts connections.
778
+ #
779
+ # Constraints: Value must be `1150-65535`
780
+ #
781
+ # Default: The same port as the original DB cluster.
782
+ # @option options [String] :db_subnet_group_name
783
+ # The DB subnet group name to use for the new DB cluster.
784
+ #
785
+ # Constraints: Must contain no more than 255 alphanumeric characters,
786
+ # periods, underscores, spaces, or hyphens. Must not be default.
787
+ #
788
+ # Example: `mySubnetgroup`
789
+ # @option options [String] :option_group_name
790
+ # The name of the option group for the new DB cluster.
791
+ # @option options [Array<String>] :vpc_security_group_ids
792
+ # A lst of VPC security groups that the new DB cluster belongs to.
793
+ # @option options [Array<Types::Tag>] :tags
794
+ # A list of tags.
795
+ # @option options [String] :kms_key_id
796
+ # The KMS key identifier to use when restoring an encrypted DB cluster
797
+ # from an encrypted DB cluster.
798
+ #
799
+ # The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
800
+ # encryption key. If you are restoring a DB cluster with the same AWS
801
+ # account that owns the KMS encryption key used to encrypt the new DB
802
+ # cluster, then you can use the KMS key alias instead of the ARN for the
803
+ # KMS encryption key.
804
+ #
805
+ # You can restore to a new DB cluster and encrypt the new DB cluster
806
+ # with a KMS key that is different than the KMS key used to encrypt the
807
+ # source DB cluster. The new DB cluster will be encrypted with the KMS
808
+ # key identified by the `KmsKeyId` parameter.
809
+ #
810
+ # If you do not specify a value for the `KmsKeyId` parameter, then the
811
+ # following will occur:
812
+ #
813
+ # * If the DB cluster is encrypted, then the restored DB cluster is
814
+ # encrypted using the KMS key that was used to encrypt the source DB
815
+ # cluster.
816
+ #
817
+ # * If the DB cluster is not encrypted, then the restored DB cluster is
818
+ # not encrypted.
819
+ #
820
+ # If `DBClusterIdentifier` refers to a DB cluster that is note
821
+ # encrypted, then the restore request is rejected.
822
+ # @return [DBCluster]
823
+ def restore(options = {})
824
+ options = options.merge(source_db_cluster_identifier: @id)
825
+ resp = @client.restore_db_cluster_to_point_in_time(options)
826
+ DBCluster.new(
827
+ id: resp.data.db_cluster.db_cluster_identifier,
828
+ data: resp.data.db_cluster,
829
+ client: @client
830
+ )
831
+ end
832
+
833
+ # @!group Associations
834
+
835
+ # @example Request syntax with placeholder values
836
+ #
837
+ # events = db_cluster.events({
838
+ # start_time: Time.now,
839
+ # end_time: Time.now,
840
+ # duration: 1,
841
+ # event_categories: ["String"],
842
+ # filters: [
843
+ # {
844
+ # name: "String", # required
845
+ # values: ["String"], # required
846
+ # },
847
+ # ],
848
+ # })
849
+ # @param [Hash] options ({})
850
+ # @option options [Time,DateTime,Date,Integer,String] :start_time
851
+ # The beginning of the time interval to retrieve events for, specified
852
+ # in ISO 8601 format. For more information about ISO 8601, go to the
853
+ # [ISO8601 Wikipedia page.][1]
854
+ #
855
+ # Example: 2009-07-08T18:00Z
856
+ #
857
+ #
858
+ #
859
+ # [1]: http://en.wikipedia.org/wiki/ISO_8601
860
+ # @option options [Time,DateTime,Date,Integer,String] :end_time
861
+ # The end of the time interval for which to retrieve events, specified
862
+ # in ISO 8601 format. For more information about ISO 8601, go to the
863
+ # [ISO8601 Wikipedia page.][1]
864
+ #
865
+ # Example: 2009-07-08T18:00Z
866
+ #
867
+ #
868
+ #
869
+ # [1]: http://en.wikipedia.org/wiki/ISO_8601
870
+ # @option options [Integer] :duration
871
+ # The number of minutes to retrieve events for.
872
+ #
873
+ # Default: 60
874
+ # @option options [Array<String>] :event_categories
875
+ # A list of event categories that trigger notifications for a event
876
+ # notification subscription.
877
+ # @option options [Array<Types::Filter>] :filters
878
+ # This parameter is not currently supported.
879
+ # @return [Event::Collection]
880
+ def events(options = {})
881
+ batches = Enumerator.new do |y|
882
+ options = options.merge(
883
+ source_type: "db-cluster",
884
+ source_identifier: @id
568
885
  )
886
+ resp = @client.describe_events(options)
887
+ resp.each_page do |page|
888
+ batch = []
889
+ page.data.events.each do |e|
890
+ batch << Event.new(
891
+ source_id: e.source_identifier,
892
+ date: e.date,
893
+ data: e,
894
+ client: @client
895
+ )
896
+ end
897
+ y.yield(batch)
898
+ end
569
899
  end
900
+ Event::Collection.new(batches)
901
+ end
570
902
 
571
- # @example Request syntax with placeholder values
572
- #
573
- # dbcluster = db_cluster.failover({
574
- # target_db_instance_identifier: "String",
575
- # })
576
- # @param [Hash] options ({})
577
- # @option options [String] :target_db_instance_identifier
578
- # The name of the instance to promote to the primary instance.
579
- #
580
- # You must specify the instance identifier for an Aurora Replica in the
581
- # DB cluster. For example, `mydbcluster-replica1`.
582
- # @return [DBCluster]
583
- def failover(options = {})
584
- options = options.merge(db_cluster_identifier: @id)
585
- resp = @client.failover_db_cluster(options)
586
- DBCluster.new(
587
- id: resp.data.db_cluster.db_cluster_identifier,
588
- data: resp.data.db_cluster,
903
+ # @return [DBInstance::Collection]
904
+ def members
905
+ batch = []
906
+ data.db_cluster_members.each do |d|
907
+ batch << DBInstance.new(
908
+ id: d.db_instance_identifier,
909
+ data: d,
589
910
  client: @client
590
911
  )
591
912
  end
913
+ DBInstance::Collection.new([batch], size: batch.size)
914
+ end
592
915
 
593
- # @example Request syntax with placeholder values
594
- #
595
- # dbcluster = db_cluster.modify({
596
- # new_db_cluster_identifier: "String",
597
- # apply_immediately: false,
598
- # backup_retention_period: 1,
599
- # db_cluster_parameter_group_name: "String",
600
- # vpc_security_group_ids: ["String"],
601
- # port: 1,
602
- # master_user_password: "String",
603
- # option_group_name: "String",
604
- # preferred_backup_window: "String",
605
- # preferred_maintenance_window: "String",
606
- # })
607
- # @param [Hash] options ({})
608
- # @option options [String] :new_db_cluster_identifier
609
- # The new DB cluster identifier for the DB cluster when renaming a DB
610
- # cluster. This value is stored as a lowercase string.
611
- #
612
- # Constraints:
613
- #
614
- # * Must contain from 1 to 63 alphanumeric characters or hyphens
615
- #
616
- # * First character must be a letter
617
- #
618
- # * Cannot end with a hyphen or contain two consecutive hyphens
619
- #
620
- # Example: `my-cluster2`
621
- # @option options [Boolean] :apply_immediately
622
- # A value that specifies whether the modifications in this request and
623
- # any pending modifications are asynchronously applied as soon as
624
- # possible, regardless of the `PreferredMaintenanceWindow` setting for
625
- # the DB cluster. If this parameter is set to `false`, changes to the DB
626
- # cluster are applied during the next maintenance window.
627
- #
628
- # The `ApplyImmediately` parameter only affects the
629
- # `NewDBClusterIdentifier` and `MasterUserPassword` values. If you set
630
- # the `ApplyImmediately` parameter value to false, then changes to the
631
- # `NewDBClusterIdentifier` and `MasterUserPassword` values are applied
632
- # during the next maintenance window. All other changes are applied
633
- # immediately, regardless of the value of the `ApplyImmediately`
634
- # parameter.
635
- #
636
- # Default: `false`
637
- # @option options [Integer] :backup_retention_period
638
- # The number of days for which automated backups are retained. You must
639
- # specify a minimum value of 1.
640
- #
641
- # Default: 1
642
- #
643
- # Constraints:
644
- #
645
- # * Must be a value from 1 to 35
646
- #
647
- # ^
648
- # @option options [String] :db_cluster_parameter_group_name
649
- # The name of the DB cluster parameter group to use for the DB cluster.
650
- # @option options [Array<String>] :vpc_security_group_ids
651
- # A lst of VPC security groups that the DB cluster will belong to.
652
- # @option options [Integer] :port
653
- # The port number on which the DB cluster accepts connections.
654
- #
655
- # Constraints: Value must be `1150-65535`
656
- #
657
- # Default: The same port as the original DB cluster.
658
- # @option options [String] :master_user_password
659
- # The new password for the master database user. This password can
660
- # contain any printable ASCII character except "/", """, or "@".
661
- #
662
- # Constraints: Must contain from 8 to 41 characters.
663
- # @option options [String] :option_group_name
664
- # A value that indicates that the DB cluster should be associated with
665
- # the specified option group. Changing this parameter does not result in
666
- # an outage except in the following case, and the change is applied
667
- # during the next maintenance window unless the `ApplyImmediately`
668
- # parameter is set to `true` for this request. If the parameter change
669
- # results in an option group that enables OEM, this change can cause a
670
- # brief (sub-second) period during which new connections are rejected
671
- # but existing connections are not interrupted.
672
- #
673
- # Permanent options cannot be removed from an option group. The option
674
- # group cannot be removed from a DB cluster once it is associated with a
675
- # DB cluster.
676
- # @option options [String] :preferred_backup_window
677
- # The daily time range during which automated backups are created if
678
- # automated backups are enabled, using the `BackupRetentionPeriod`
679
- # parameter.
680
- #
681
- # Default: A 30-minute window selected at random from an 8-hour block of
682
- # time per region. To see the time blocks available, see [ Adjusting the
683
- # Preferred Maintenance Window][1] in the *Amazon RDS User Guide.*
684
- #
685
- # Constraints:
686
- #
687
- # * Must be in the format `hh24:mi-hh24:mi`.
688
- #
689
- # * Times should be in Universal Coordinated Time (UTC).
690
- #
691
- # * Must not conflict with the preferred maintenance window.
692
- #
693
- # * Must be at least 30 minutes.
694
- #
695
- #
696
- #
697
- # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
698
- # @option options [String] :preferred_maintenance_window
699
- # The weekly time range during which system maintenance can occur, in
700
- # Universal Coordinated Time (UTC).
701
- #
702
- # Format: `ddd:hh24:mi-ddd:hh24:mi`
703
- #
704
- # Default: A 30-minute window selected at random from an 8-hour block of
705
- # time per region, occurring on a random day of the week. To see the
706
- # time blocks available, see [ Adjusting the Preferred Maintenance
707
- # Window][1] in the *Amazon RDS User Guide.*
708
- #
709
- # Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
710
- #
711
- # Constraints: Minimum 30-minute window.
712
- #
713
- #
714
- #
715
- # [1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html
716
- # @return [DBCluster]
717
- def modify(options = {})
718
- options = options.merge(db_cluster_identifier: @id)
719
- resp = @client.modify_db_cluster(options)
720
- DBCluster.new(
721
- id: resp.data.db_cluster.db_cluster_identifier,
722
- data: resp.data.db_cluster,
916
+ # @return [OptionGroup::Collection]
917
+ def option_groups
918
+ batch = []
919
+ data.db_cluster_option_group_memberships.each do |d|
920
+ batch << OptionGroup.new(
921
+ name: d.db_cluster_option_group_name,
922
+ data: d,
723
923
  client: @client
724
924
  )
725
925
  end
926
+ OptionGroup::Collection.new([batch], size: batch.size)
927
+ end
726
928
 
727
- # @example Request syntax with placeholder values
728
- #
729
- # dbcluster = db_cluster.restore({
730
- # db_cluster_identifier: "String", # required
731
- # restore_to_time: Time.now,
732
- # use_latest_restorable_time: false,
733
- # port: 1,
734
- # db_subnet_group_name: "String",
735
- # option_group_name: "String",
736
- # vpc_security_group_ids: ["String"],
737
- # tags: [
738
- # {
739
- # key: "String",
740
- # value: "String",
741
- # },
742
- # ],
743
- # kms_key_id: "String",
744
- # })
745
- # @param [Hash] options ({})
746
- # @option options [required, String] :db_cluster_identifier
747
- # The name of the new DB cluster to be created.
748
- #
749
- # Constraints:
750
- #
751
- # * Must contain from 1 to 63 alphanumeric characters or hyphens
752
- #
753
- # * First character must be a letter
754
- #
755
- # * Cannot end with a hyphen or contain two consecutive hyphens
756
- # @option options [Time,DateTime,Date,Integer,String] :restore_to_time
757
- # The date and time to restore the DB cluster to.
758
- #
759
- # Valid Values: Value must be a time in Universal Coordinated Time (UTC)
760
- # format
761
- #
762
- # Constraints:
763
- #
764
- # * Must be before the latest restorable time for the DB instance
765
- #
766
- # * Cannot be specified if `UseLatestRestorableTime` parameter is true
767
- #
768
- # Example: `2015-03-07T23:45:00Z`
769
- # @option options [Boolean] :use_latest_restorable_time
770
- # A value that is set to `true` to restore the DB cluster to the latest
771
- # restorable backup time, and `false` otherwise.
772
- #
773
- # Default: `false`
774
- #
775
- # Constraints: Cannot be specified if `RestoreToTime` parameter is
776
- # provided.
777
- # @option options [Integer] :port
778
- # The port number on which the new DB cluster accepts connections.
779
- #
780
- # Constraints: Value must be `1150-65535`
781
- #
782
- # Default: The same port as the original DB cluster.
783
- # @option options [String] :db_subnet_group_name
784
- # The DB subnet group name to use for the new DB cluster.
785
- #
786
- # Constraints: Must contain no more than 255 alphanumeric characters,
787
- # periods, underscores, spaces, or hyphens. Must not be default.
788
- #
789
- # Example: `mySubnetgroup`
790
- # @option options [String] :option_group_name
791
- # The name of the option group for the new DB cluster.
792
- # @option options [Array<String>] :vpc_security_group_ids
793
- # A lst of VPC security groups that the new DB cluster belongs to.
794
- # @option options [Array<Types::Tag>] :tags
795
- # A list of tags.
796
- # @option options [String] :kms_key_id
797
- # The KMS key identifier to use when restoring an encrypted DB cluster
798
- # from an encrypted DB cluster.
799
- #
800
- # The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
801
- # encryption key. If you are restoring a DB cluster with the same AWS
802
- # account that owns the KMS encryption key used to encrypt the new DB
803
- # cluster, then you can use the KMS key alias instead of the ARN for the
804
- # KMS encryption key.
805
- #
806
- # You can restore to a new DB cluster and encrypt the new DB cluster
807
- # with a KMS key that is different than the KMS key used to encrypt the
808
- # source DB cluster. The new DB cluster will be encrypted with the KMS
809
- # key identified by the `KmsKeyId` parameter.
810
- #
811
- # If you do not specify a value for the `KmsKeyId` parameter, then the
812
- # following will occur:
813
- #
814
- # * If the DB cluster is encrypted, then the restored DB cluster is
815
- # encrypted using the KMS key that was used to encrypt the source DB
816
- # cluster.
817
- #
818
- # * If the DB cluster is not encrypted, then the restored DB cluster is
819
- # not encrypted.
820
- #
821
- # If `DBClusterIdentifier` refers to a DB cluster that is note
822
- # encrypted, then the restore request is rejected.
823
- # @return [DBCluster]
824
- def restore(options = {})
825
- options = options.merge(source_db_cluster_identifier: @id)
826
- resp = @client.restore_db_cluster_to_point_in_time(options)
827
- DBCluster.new(
828
- id: resp.data.db_cluster.db_cluster_identifier,
829
- data: resp.data.db_cluster,
929
+ # @return [DBClusterParameterGroup, nil]
930
+ def parameter_group
931
+ if data.db_cluster_parameter_group
932
+ DBClusterParameterGroup.new(
933
+ name: data.db_cluster_parameter_group,
830
934
  client: @client
831
935
  )
936
+ else
937
+ nil
832
938
  end
939
+ end
833
940
 
834
- # @!group Associations
835
-
836
- # @example Request syntax with placeholder values
837
- #
838
- # events = db_cluster.events({
839
- # start_time: Time.now,
840
- # end_time: Time.now,
841
- # duration: 1,
842
- # event_categories: ["String"],
843
- # filters: [
844
- # {
845
- # name: "String", # required
846
- # values: ["String"], # required
847
- # },
848
- # ],
849
- # })
850
- # @param [Hash] options ({})
851
- # @option options [Time,DateTime,Date,Integer,String] :start_time
852
- # The beginning of the time interval to retrieve events for, specified
853
- # in ISO 8601 format. For more information about ISO 8601, go to the
854
- # [ISO8601 Wikipedia page.][1]
855
- #
856
- # Example: 2009-07-08T18:00Z
857
- #
858
- #
859
- #
860
- # [1]: http://en.wikipedia.org/wiki/ISO_8601
861
- # @option options [Time,DateTime,Date,Integer,String] :end_time
862
- # The end of the time interval for which to retrieve events, specified
863
- # in ISO 8601 format. For more information about ISO 8601, go to the
864
- # [ISO8601 Wikipedia page.][1]
865
- #
866
- # Example: 2009-07-08T18:00Z
867
- #
868
- #
869
- #
870
- # [1]: http://en.wikipedia.org/wiki/ISO_8601
871
- # @option options [Integer] :duration
872
- # The number of minutes to retrieve events for.
873
- #
874
- # Default: 60
875
- # @option options [Array<String>] :event_categories
876
- # A list of event categories that trigger notifications for a event
877
- # notification subscription.
878
- # @option options [Array<Types::Filter>] :filters
879
- # This parameter is not currently supported.
880
- # @return [Event::Collection]
881
- def events(options = {})
882
- batches = Enumerator.new do |y|
883
- options = options.merge(
884
- source_type: "db-cluster",
885
- source_identifier: @id
886
- )
887
- resp = @client.describe_events(options)
888
- resp.each_page do |page|
889
- batch = []
890
- page.data.events.each do |e|
891
- batch << Event.new(
892
- source_id: e.source_identifier,
893
- date: e.date,
894
- data: e,
895
- client: @client
896
- )
897
- end
898
- y.yield(batch)
899
- end
900
- end
901
- Event::Collection.new(batches)
902
- end
903
-
904
- # @return [DBInstance::Collection]
905
- def members
906
- batch = []
907
- data.db_cluster_members.each do |d|
908
- batch << DBInstance.new(
909
- id: d.db_instance_identifier,
910
- data: d,
911
- client: @client
912
- )
913
- end
914
- DBInstance::Collection.new([batch], size: batch.size)
915
- end
916
-
917
- # @return [OptionGroup::Collection]
918
- def option_groups
941
+ # @example Request syntax with placeholder values
942
+ #
943
+ # snapshots = db_cluster.snapshots({
944
+ # db_cluster_snapshot_identifier: "String",
945
+ # snapshot_type: "String",
946
+ # filters: [
947
+ # {
948
+ # name: "String", # required
949
+ # values: ["String"], # required
950
+ # },
951
+ # ],
952
+ # max_records: 1,
953
+ # marker: "String",
954
+ # include_shared: false,
955
+ # include_public: false,
956
+ # })
957
+ # @param [Hash] options ({})
958
+ # @option options [String] :db_cluster_snapshot_identifier
959
+ # A specific DB cluster snapshot identifier to describe. This parameter
960
+ # cannot be used in conjunction with the `DBClusterIdentifier`
961
+ # parameter. This value is stored as a lowercase string.
962
+ #
963
+ # Constraints:
964
+ #
965
+ # * Must be 1 to 255 alphanumeric characters
966
+ #
967
+ # * First character must be a letter
968
+ #
969
+ # * Cannot end with a hyphen or contain two consecutive hyphens
970
+ #
971
+ # * If this identifier is for an automated snapshot, the `SnapshotType`
972
+ # parameter must also be specified.
973
+ # @option options [String] :snapshot_type
974
+ # The type of DB cluster snapshots to be returned. You can specify one
975
+ # of the following values:
976
+ #
977
+ # * `automated` - Return all DB cluster snapshots that have been
978
+ # automatically taken by Amazon RDS for my AWS account.
979
+ #
980
+ # * `manual` - Return all DB cluster snapshots that have been taken by
981
+ # my AWS account.
982
+ #
983
+ # * `shared` - Return all manual DB cluster snapshots that have been
984
+ # shared to my AWS account.
985
+ #
986
+ # * `public` - Return all DB cluster snapshots that have been marked as
987
+ # public.
988
+ #
989
+ # If you don't specify a `SnapshotType` value, then both automated and
990
+ # manual DB cluster snapshots are returned. You can include shared DB
991
+ # cluster snapshots with these results by setting the `IncludeShared`
992
+ # parameter to `true`. You can include public DB cluster snapshots with
993
+ # these results by setting the `IncludePublic` parameter to `true`.
994
+ #
995
+ # The `IncludeShared` and `IncludePublic` parameters don't apply for
996
+ # `SnapshotType` values of `manual` or `automated`. The `IncludePublic`
997
+ # parameter doesn't apply when `SnapshotType` is set to `shared`. The
998
+ # `IncludeShared` parameter doesn't apply when `SnapshotType` is set to
999
+ # `public`.
1000
+ # @option options [Array<Types::Filter>] :filters
1001
+ # This parameter is not currently supported.
1002
+ # @option options [Integer] :max_records
1003
+ # The maximum number of records to include in the response. If more
1004
+ # records exist than the specified `MaxRecords` value, a pagination
1005
+ # token called a marker is included in the response so that the
1006
+ # remaining results can be retrieved.
1007
+ #
1008
+ # Default: 100
1009
+ #
1010
+ # Constraints: Minimum 20, maximum 100.
1011
+ # @option options [String] :marker
1012
+ # An optional pagination token provided by a previous
1013
+ # `DescribeDBClusterSnapshots` request. If this parameter is specified,
1014
+ # the response includes only records beyond the marker, up to the value
1015
+ # specified by `MaxRecords`.
1016
+ # @option options [Boolean] :include_shared
1017
+ # Set this value to `true` to include shared manual DB cluster snapshots
1018
+ # from other AWS accounts that this AWS account has been given
1019
+ # permission to copy or restore, otherwise set this value to `false`.
1020
+ # The default is `false`.
1021
+ #
1022
+ # You can give an AWS account permission to restore a manual DB cluster
1023
+ # snapshot from another AWS account by the
1024
+ # ModifyDBClusterSnapshotAttribute API action.
1025
+ # @option options [Boolean] :include_public
1026
+ # Set this value to `true` to include manual DB cluster snapshots that
1027
+ # are public and can be copied or restored by any AWS account, otherwise
1028
+ # set this value to `false`. The default is `false`. The default is
1029
+ # false.
1030
+ #
1031
+ # You can share a manual DB cluster snapshot as public by using the
1032
+ # ModifyDBClusterSnapshotAttribute API action.
1033
+ # @return [DBClusterSnapshot::Collection]
1034
+ def snapshots(options = {})
1035
+ batches = Enumerator.new do |y|
919
1036
  batch = []
920
- data.db_cluster_option_group_memberships.each do |d|
921
- batch << OptionGroup.new(
922
- name: d.db_cluster_option_group_name,
1037
+ options = options.merge(db_cluster_identifier: @id)
1038
+ resp = @client.describe_db_cluster_snapshots(options)
1039
+ resp.data.db_cluster_snapshots.each do |d|
1040
+ batch << DBClusterSnapshot.new(
1041
+ cluster_id: @id,
1042
+ snapshot_id: d.db_cluster_snapshot_identifier,
923
1043
  data: d,
924
1044
  client: @client
925
1045
  )
926
1046
  end
927
- OptionGroup::Collection.new([batch], size: batch.size)
928
- end
929
-
930
- # @return [DBClusterParameterGroup, nil]
931
- def parameter_group
932
- if data.db_cluster_parameter_group
933
- DBClusterParameterGroup.new(
934
- name: data.db_cluster_parameter_group,
935
- client: @client
936
- )
937
- else
938
- nil
939
- end
940
- end
941
-
942
- # @example Request syntax with placeholder values
943
- #
944
- # snapshots = db_cluster.snapshots({
945
- # db_cluster_snapshot_identifier: "String",
946
- # snapshot_type: "String",
947
- # filters: [
948
- # {
949
- # name: "String", # required
950
- # values: ["String"], # required
951
- # },
952
- # ],
953
- # max_records: 1,
954
- # marker: "String",
955
- # include_shared: false,
956
- # include_public: false,
957
- # })
958
- # @param [Hash] options ({})
959
- # @option options [String] :db_cluster_snapshot_identifier
960
- # A specific DB cluster snapshot identifier to describe. This parameter
961
- # cannot be used in conjunction with the `DBClusterIdentifier`
962
- # parameter. This value is stored as a lowercase string.
963
- #
964
- # Constraints:
965
- #
966
- # * Must be 1 to 255 alphanumeric characters
967
- #
968
- # * First character must be a letter
969
- #
970
- # * Cannot end with a hyphen or contain two consecutive hyphens
971
- #
972
- # * If this identifier is for an automated snapshot, the `SnapshotType`
973
- # parameter must also be specified.
974
- # @option options [String] :snapshot_type
975
- # The type of DB cluster snapshots to be returned. You can specify one
976
- # of the following values:
977
- #
978
- # * `automated` - Return all DB cluster snapshots that have been
979
- # automatically taken by Amazon RDS for my AWS account.
980
- #
981
- # * `manual` - Return all DB cluster snapshots that have been taken by
982
- # my AWS account.
983
- #
984
- # * `shared` - Return all manual DB cluster snapshots that have been
985
- # shared to my AWS account.
986
- #
987
- # * `public` - Return all DB cluster snapshots that have been marked as
988
- # public.
989
- #
990
- # If you don't specify a `SnapshotType` value, then both automated and
991
- # manual DB cluster snapshots are returned. You can include shared DB
992
- # cluster snapshots with these results by setting the `IncludeShared`
993
- # parameter to `true`. You can include public DB cluster snapshots with
994
- # these results by setting the `IncludePublic` parameter to `true`.
995
- #
996
- # The `IncludeShared` and `IncludePublic` parameters don't apply for
997
- # `SnapshotType` values of `manual` or `automated`. The `IncludePublic`
998
- # parameter doesn't apply when `SnapshotType` is set to `shared`. The
999
- # `IncludeShared` parameter doesn't apply when `SnapshotType` is set to
1000
- # `public`.
1001
- # @option options [Array<Types::Filter>] :filters
1002
- # This parameter is not currently supported.
1003
- # @option options [Integer] :max_records
1004
- # The maximum number of records to include in the response. If more
1005
- # records exist than the specified `MaxRecords` value, a pagination
1006
- # token called a marker is included in the response so that the
1007
- # remaining results can be retrieved.
1008
- #
1009
- # Default: 100
1010
- #
1011
- # Constraints: Minimum 20, maximum 100.
1012
- # @option options [String] :marker
1013
- # An optional pagination token provided by a previous
1014
- # `DescribeDBClusterSnapshots` request. If this parameter is specified,
1015
- # the response includes only records beyond the marker, up to the value
1016
- # specified by `MaxRecords`.
1017
- # @option options [Boolean] :include_shared
1018
- # Set this value to `true` to include shared manual DB cluster snapshots
1019
- # from other AWS accounts that this AWS account has been given
1020
- # permission to copy or restore, otherwise set this value to `false`.
1021
- # The default is `false`.
1022
- #
1023
- # You can give an AWS account permission to restore a manual DB cluster
1024
- # snapshot from another AWS account by the
1025
- # ModifyDBClusterSnapshotAttribute API action.
1026
- # @option options [Boolean] :include_public
1027
- # Set this value to `true` to include manual DB cluster snapshots that
1028
- # are public and can be copied or restored by any AWS account, otherwise
1029
- # set this value to `false`. The default is `false`. The default is
1030
- # false.
1031
- #
1032
- # You can share a manual DB cluster snapshot as public by using the
1033
- # ModifyDBClusterSnapshotAttribute API action.
1034
- # @return [DBClusterSnapshot::Collection]
1035
- def snapshots(options = {})
1036
- batches = Enumerator.new do |y|
1037
- batch = []
1038
- options = options.merge(db_cluster_identifier: @id)
1039
- resp = @client.describe_db_cluster_snapshots(options)
1040
- resp.data.db_cluster_snapshots.each do |d|
1041
- batch << DBClusterSnapshot.new(
1042
- cluster_id: @id,
1043
- snapshot_id: d.db_cluster_snapshot_identifier,
1044
- data: d,
1045
- client: @client
1046
- )
1047
- end
1048
- y.yield(batch)
1049
- end
1050
- DBClusterSnapshot::Collection.new(batches)
1047
+ y.yield(batch)
1051
1048
  end
1049
+ DBClusterSnapshot::Collection.new(batches)
1050
+ end
1052
1051
 
1053
- # @return [DBSubnetGroup, nil]
1054
- def subnet_group
1055
- if data.db_subnet_group
1056
- DBSubnetGroup.new(
1057
- name: data.db_subnet_group,
1058
- client: @client
1059
- )
1060
- else
1061
- nil
1062
- end
1052
+ # @return [DBSubnetGroup, nil]
1053
+ def subnet_group
1054
+ if data.db_subnet_group
1055
+ DBSubnetGroup.new(
1056
+ name: data.db_subnet_group,
1057
+ client: @client
1058
+ )
1059
+ else
1060
+ nil
1063
1061
  end
1062
+ end
1064
1063
 
1065
- # @deprecated
1066
- # @api private
1067
- def identifiers
1068
- { id: @id }
1069
- end
1070
- deprecated(:identifiers)
1064
+ # @deprecated
1065
+ # @api private
1066
+ def identifiers
1067
+ { id: @id }
1068
+ end
1069
+ deprecated(:identifiers)
1071
1070
 
1072
- private
1071
+ private
1073
1072
 
1074
- def extract_id(args, options)
1075
- value = args[0] || options.delete(:id)
1076
- case value
1077
- when String then value
1078
- when nil then raise ArgumentError, "missing required option :id"
1079
- else
1080
- msg = "expected :id to be a String, got #{value.class}"
1081
- raise ArgumentError, msg
1082
- end
1073
+ def extract_id(args, options)
1074
+ value = args[0] || options.delete(:id)
1075
+ case value
1076
+ when String then value
1077
+ when nil then raise ArgumentError, "missing required option :id"
1078
+ else
1079
+ msg = "expected :id to be a String, got #{value.class}"
1080
+ raise ArgumentError, msg
1083
1081
  end
1084
-
1085
- class Collection < Aws::Resources::Collection; end
1086
1082
  end
1083
+
1084
+ class Collection < Aws::Resources::Collection; end
1087
1085
  end
1088
1086
  end