aws-sdk-rds 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-rds.rb +2 -2
- data/lib/aws-sdk-rds/account_quota.rb +79 -81
- data/lib/aws-sdk-rds/certificate.rb +99 -101
- data/lib/aws-sdk-rds/client.rb +10575 -9119
- data/lib/aws-sdk-rds/client_api.rb +3049 -3023
- data/lib/aws-sdk-rds/db_cluster.rb +1005 -1007
- data/lib/aws-sdk-rds/db_cluster_parameter_group.rb +204 -206
- data/lib/aws-sdk-rds/db_cluster_snapshot.rb +430 -432
- data/lib/aws-sdk-rds/db_engine.rb +208 -210
- data/lib/aws-sdk-rds/db_engine_version.rb +218 -219
- data/lib/aws-sdk-rds/db_instance.rb +2747 -2567
- data/lib/aws-sdk-rds/db_log_file.rb +145 -147
- data/lib/aws-sdk-rds/db_parameter_group.rb +411 -413
- data/lib/aws-sdk-rds/db_parameter_group_family.rb +135 -137
- data/lib/aws-sdk-rds/db_security_group.rb +316 -318
- data/lib/aws-sdk-rds/db_snapshot.rb +705 -650
- data/lib/aws-sdk-rds/db_snapshot_attribute.rb +137 -139
- data/lib/aws-sdk-rds/db_subnet_group.rb +161 -163
- data/lib/aws-sdk-rds/errors.rb +4 -13
- data/lib/aws-sdk-rds/event.rb +108 -110
- data/lib/aws-sdk-rds/event_category_map.rb +73 -75
- data/lib/aws-sdk-rds/event_subscription.rb +313 -315
- data/lib/aws-sdk-rds/option_group.rb +247 -249
- data/lib/aws-sdk-rds/option_group_option.rb +135 -137
- data/lib/aws-sdk-rds/parameter.rb +116 -118
- data/lib/aws-sdk-rds/pending_maintenance_action.rb +182 -184
- data/lib/aws-sdk-rds/plugins/cross_region_copying.rb +64 -0
- data/lib/aws-sdk-rds/reserved_db_instance.rb +156 -158
- data/lib/aws-sdk-rds/reserved_db_instances_offering.rb +154 -156
- data/lib/aws-sdk-rds/resource.rb +2395 -2288
- data/lib/aws-sdk-rds/resource_pending_maintenance_action_list.rb +89 -91
- data/lib/aws-sdk-rds/types.rb +12091 -10977
- data/lib/aws-sdk-rds/waiters.rb +127 -128
- metadata +3 -2
@@ -1,1088 +1,1086 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class DBCluster
|
8
|
+
module Aws::RDS
|
9
|
+
class DBCluster
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
# @overload def initialize(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
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :db_cluster_identifier :id
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
84
|
+
# Specifies the current state of this DB cluster.
|
85
|
+
# @return [String]
|
86
|
+
def status
|
87
|
+
data.status
|
88
|
+
end
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
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
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
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
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
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
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
141
|
+
# Indicates the database engine version.
|
142
|
+
# @return [String]
|
143
|
+
def engine_version
|
144
|
+
data.engine_version
|
145
|
+
end
|
147
146
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
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
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
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
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
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
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
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
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
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
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
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
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
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
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
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
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
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
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
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
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
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
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
220
|
+
# Specifies whether the DB cluster is encrypted.
|
221
|
+
# @return [Boolean]
|
222
|
+
def storage_encrypted
|
223
|
+
data.storage_encrypted
|
224
|
+
end
|
226
225
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
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
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
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
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
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
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
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
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
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
|
-
|
263
|
+
# @!endgroup
|
265
264
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
265
|
+
# @return [Client]
|
266
|
+
def client
|
267
|
+
@client
|
268
|
+
end
|
270
269
|
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
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
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
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
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
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
|
-
|
298
|
+
# @!group Actions
|
300
299
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
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
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
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
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
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
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
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
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
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
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
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
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
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
|
-
|
921
|
-
|
922
|
-
|
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
|
-
|
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
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
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
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1064
|
+
# @deprecated
|
1065
|
+
# @api private
|
1066
|
+
def identifiers
|
1067
|
+
{ id: @id }
|
1068
|
+
end
|
1069
|
+
deprecated(:identifiers)
|
1071
1070
|
|
1072
|
-
|
1071
|
+
private
|
1073
1072
|
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
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
|