aws-sdk-rds 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/aws-sdk-rds.rb +73 -0
- data/lib/aws-sdk-rds/account_quota.rb +100 -0
- data/lib/aws-sdk-rds/certificate.rb +123 -0
- data/lib/aws-sdk-rds/client.rb +9214 -0
- data/lib/aws-sdk-rds/client_api.rb +3027 -0
- data/lib/aws-sdk-rds/customizations.rb +7 -0
- data/lib/aws-sdk-rds/db_cluster.rb +1074 -0
- data/lib/aws-sdk-rds/db_cluster_parameter_group.rb +230 -0
- data/lib/aws-sdk-rds/db_cluster_snapshot.rb +478 -0
- data/lib/aws-sdk-rds/db_engine.rb +241 -0
- data/lib/aws-sdk-rds/db_engine_version.rb +263 -0
- data/lib/aws-sdk-rds/db_instance.rb +2680 -0
- data/lib/aws-sdk-rds/db_log_file.rb +170 -0
- data/lib/aws-sdk-rds/db_parameter_group.rb +455 -0
- data/lib/aws-sdk-rds/db_parameter_group_family.rb +167 -0
- data/lib/aws-sdk-rds/db_security_group.rb +358 -0
- data/lib/aws-sdk-rds/db_snapshot.rb +714 -0
- data/lib/aws-sdk-rds/db_snapshot_attribute.rb +160 -0
- data/lib/aws-sdk-rds/db_subnet_group.rb +188 -0
- data/lib/aws-sdk-rds/errors.rb +23 -0
- data/lib/aws-sdk-rds/event.rb +134 -0
- data/lib/aws-sdk-rds/event_category_map.rb +98 -0
- data/lib/aws-sdk-rds/event_subscription.rb +352 -0
- data/lib/aws-sdk-rds/option_group.rb +283 -0
- data/lib/aws-sdk-rds/option_group_option.rb +166 -0
- data/lib/aws-sdk-rds/parameter.rb +144 -0
- data/lib/aws-sdk-rds/pending_maintenance_action.rb +211 -0
- data/lib/aws-sdk-rds/reserved_db_instance.rb +191 -0
- data/lib/aws-sdk-rds/reserved_db_instances_offering.rb +183 -0
- data/lib/aws-sdk-rds/resource.rb +2384 -0
- data/lib/aws-sdk-rds/resource_pending_maintenance_action_list.rb +111 -0
- data/lib/aws-sdk-rds/types.rb +10965 -0
- data/lib/aws-sdk-rds/waiters.rb +149 -0
- metadata +106 -0
@@ -0,0 +1,230 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module RDS
|
10
|
+
class DBClusterParameterGroup
|
11
|
+
|
12
|
+
extend Aws::Deprecations
|
13
|
+
|
14
|
+
# @overload def initialize(name, options = {})
|
15
|
+
# @param [String] name
|
16
|
+
# @option options [Client] :client
|
17
|
+
# @overload def initialize(options = {})
|
18
|
+
# @option options [required, String] :name
|
19
|
+
# @option options [Client] :client
|
20
|
+
def initialize(*args)
|
21
|
+
options = Hash === args.last ? args.pop.dup : {}
|
22
|
+
@name = extract_name(args, options)
|
23
|
+
@data = options.delete(:data)
|
24
|
+
@client = options.delete(:client) || Client.new(options)
|
25
|
+
end
|
26
|
+
|
27
|
+
# @!group Read-Only Attributes
|
28
|
+
|
29
|
+
# @return [String]
|
30
|
+
def name
|
31
|
+
@name
|
32
|
+
end
|
33
|
+
alias :db_cluster_parameter_group_name :name
|
34
|
+
|
35
|
+
# Provides the name of the DB parameter group family that this DB
|
36
|
+
# cluster parameter group is compatible with.
|
37
|
+
# @return [String]
|
38
|
+
def db_parameter_group_family
|
39
|
+
data.db_parameter_group_family
|
40
|
+
end
|
41
|
+
|
42
|
+
# Provides the customer-specified description for this DB cluster
|
43
|
+
# parameter group.
|
44
|
+
# @return [String]
|
45
|
+
def description
|
46
|
+
data.description
|
47
|
+
end
|
48
|
+
|
49
|
+
# The Amazon Resource Name (ARN) for the DB cluster parameter group.
|
50
|
+
# @return [String]
|
51
|
+
def db_cluster_parameter_group_arn
|
52
|
+
data.db_cluster_parameter_group_arn
|
53
|
+
end
|
54
|
+
|
55
|
+
# @!endgroup
|
56
|
+
|
57
|
+
# @return [Client]
|
58
|
+
def client
|
59
|
+
@client
|
60
|
+
end
|
61
|
+
|
62
|
+
# Loads, or reloads {#data} for the current {DBClusterParameterGroup}.
|
63
|
+
# Returns `self` making it possible to chain methods.
|
64
|
+
#
|
65
|
+
# db_cluster_parameter_group.reload.data
|
66
|
+
#
|
67
|
+
# @return [self]
|
68
|
+
def load
|
69
|
+
resp = @client.describe_db_cluster_parameter_groups(db_cluster_parameter_group_name: @name)
|
70
|
+
@data = resp.dbclusterparametergroups[0]
|
71
|
+
self
|
72
|
+
end
|
73
|
+
alias :reload :load
|
74
|
+
|
75
|
+
# @return [Types::DBClusterParameterGroup]
|
76
|
+
# Returns the data for this {DBClusterParameterGroup}. Calls
|
77
|
+
# {Client#describe_db_cluster_parameter_groups} if {#data_loaded?} is `false`.
|
78
|
+
def data
|
79
|
+
load unless @data
|
80
|
+
@data
|
81
|
+
end
|
82
|
+
|
83
|
+
# @return [Boolean]
|
84
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
85
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
86
|
+
def data_loaded?
|
87
|
+
!!@data
|
88
|
+
end
|
89
|
+
|
90
|
+
# @!group Actions
|
91
|
+
|
92
|
+
# @example Request syntax with placeholder values
|
93
|
+
#
|
94
|
+
# dbclusterparametergroup = db_cluster_parameter_group.create({
|
95
|
+
# db_parameter_group_family: "String", # required
|
96
|
+
# description: "String", # required
|
97
|
+
# tags: [
|
98
|
+
# {
|
99
|
+
# key: "String",
|
100
|
+
# value: "String",
|
101
|
+
# },
|
102
|
+
# ],
|
103
|
+
# })
|
104
|
+
# @param [Hash] options ({})
|
105
|
+
# @option options [required, String] :db_parameter_group_family
|
106
|
+
# The DB cluster parameter group family name. A DB cluster parameter
|
107
|
+
# group can be associated with one and only one DB cluster parameter
|
108
|
+
# group family, and can be applied only to a DB cluster running a
|
109
|
+
# database engine and engine version compatible with that DB cluster
|
110
|
+
# parameter group family.
|
111
|
+
# @option options [required, String] :description
|
112
|
+
# The description for the DB cluster parameter group.
|
113
|
+
# @option options [Array<Types::Tag>] :tags
|
114
|
+
# A list of tags.
|
115
|
+
# @return [DBClusterParameterGroup]
|
116
|
+
def create(options = {})
|
117
|
+
options = options.merge(db_cluster_parameter_group_name: @name)
|
118
|
+
resp = @client.create_db_cluster_parameter_group(options)
|
119
|
+
DBClusterParameterGroup.new(
|
120
|
+
name: resp.data.db_cluster_parameter_group.db_cluster_parameter_group_name,
|
121
|
+
data: resp.data.db_cluster_parameter_group,
|
122
|
+
client: @client
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
# @example Request syntax with placeholder values
|
127
|
+
#
|
128
|
+
# db_cluster_parameter_group.delete()
|
129
|
+
# @param [Hash] options ({})
|
130
|
+
# @return [EmptyStructure]
|
131
|
+
def delete(options = {})
|
132
|
+
options = options.merge(db_cluster_parameter_group_name: @name)
|
133
|
+
resp = @client.delete_db_cluster_parameter_group(options)
|
134
|
+
resp.data
|
135
|
+
end
|
136
|
+
|
137
|
+
# @example Request syntax with placeholder values
|
138
|
+
#
|
139
|
+
# dbclusterparametergroup = db_cluster_parameter_group.modify({
|
140
|
+
# parameters: [ # required
|
141
|
+
# {
|
142
|
+
# parameter_name: "String",
|
143
|
+
# parameter_value: "String",
|
144
|
+
# description: "String",
|
145
|
+
# source: "String",
|
146
|
+
# apply_type: "String",
|
147
|
+
# data_type: "String",
|
148
|
+
# allowed_values: "String",
|
149
|
+
# is_modifiable: false,
|
150
|
+
# minimum_engine_version: "String",
|
151
|
+
# apply_method: "immediate", # accepts immediate, pending-reboot
|
152
|
+
# },
|
153
|
+
# ],
|
154
|
+
# })
|
155
|
+
# @param [Hash] options ({})
|
156
|
+
# @option options [required, Array<Types::Parameter>] :parameters
|
157
|
+
# A list of parameters in the DB cluster parameter group to modify.
|
158
|
+
# @return [DBClusterParameterGroup]
|
159
|
+
def modify(options = {})
|
160
|
+
options = options.merge(db_cluster_parameter_group_name: @name)
|
161
|
+
resp = @client.modify_db_cluster_parameter_group(options)
|
162
|
+
DBClusterParameterGroup.new(
|
163
|
+
name: resp.data.db_cluster_parameter_group_name,
|
164
|
+
client: @client
|
165
|
+
)
|
166
|
+
end
|
167
|
+
|
168
|
+
# @example Request syntax with placeholder values
|
169
|
+
#
|
170
|
+
# dbclusterparametergroup = db_cluster_parameter_group.reset({
|
171
|
+
# reset_all_parameters: false,
|
172
|
+
# parameters: [
|
173
|
+
# {
|
174
|
+
# parameter_name: "String",
|
175
|
+
# parameter_value: "String",
|
176
|
+
# description: "String",
|
177
|
+
# source: "String",
|
178
|
+
# apply_type: "String",
|
179
|
+
# data_type: "String",
|
180
|
+
# allowed_values: "String",
|
181
|
+
# is_modifiable: false,
|
182
|
+
# minimum_engine_version: "String",
|
183
|
+
# apply_method: "immediate", # accepts immediate, pending-reboot
|
184
|
+
# },
|
185
|
+
# ],
|
186
|
+
# })
|
187
|
+
# @param [Hash] options ({})
|
188
|
+
# @option options [Boolean] :reset_all_parameters
|
189
|
+
# A value that is set to `true` to reset all parameters in the DB
|
190
|
+
# cluster parameter group to their default values, and `false`
|
191
|
+
# otherwise. You cannot use this parameter if there is a list of
|
192
|
+
# parameter names specified for the `Parameters` parameter.
|
193
|
+
# @option options [Array<Types::Parameter>] :parameters
|
194
|
+
# A list of parameter names in the DB cluster parameter group to reset
|
195
|
+
# to the default values. You cannot use this parameter if the
|
196
|
+
# `ResetAllParameters` parameter is set to `true`.
|
197
|
+
# @return [DBClusterParameterGroup]
|
198
|
+
def reset(options = {})
|
199
|
+
options = options.merge(db_cluster_parameter_group_name: @name)
|
200
|
+
resp = @client.reset_db_cluster_parameter_group(options)
|
201
|
+
DBClusterParameterGroup.new(
|
202
|
+
name: resp.data.db_cluster_parameter_group_name,
|
203
|
+
client: @client
|
204
|
+
)
|
205
|
+
end
|
206
|
+
|
207
|
+
# @deprecated
|
208
|
+
# @api private
|
209
|
+
def identifiers
|
210
|
+
{ name: @name }
|
211
|
+
end
|
212
|
+
deprecated(:identifiers)
|
213
|
+
|
214
|
+
private
|
215
|
+
|
216
|
+
def extract_name(args, options)
|
217
|
+
value = args[0] || options.delete(:name)
|
218
|
+
case value
|
219
|
+
when String then value
|
220
|
+
when nil then raise ArgumentError, "missing required option :name"
|
221
|
+
else
|
222
|
+
msg = "expected :name to be a String, got #{value.class}"
|
223
|
+
raise ArgumentError, msg
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
class Collection < Aws::Resources::Collection; end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
@@ -0,0 +1,478 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module RDS
|
10
|
+
class DBClusterSnapshot
|
11
|
+
|
12
|
+
extend Aws::Deprecations
|
13
|
+
|
14
|
+
# @overload def initialize(cluster_id, snapshot_id, options = {})
|
15
|
+
# @param [String] cluster_id
|
16
|
+
# @param [String] snapshot_id
|
17
|
+
# @option options [Client] :client
|
18
|
+
# @overload def initialize(options = {})
|
19
|
+
# @option options [required, String] :cluster_id
|
20
|
+
# @option options [required, String] :snapshot_id
|
21
|
+
# @option options [Client] :client
|
22
|
+
def initialize(*args)
|
23
|
+
options = Hash === args.last ? args.pop.dup : {}
|
24
|
+
@cluster_id = extract_cluster_id(args, options)
|
25
|
+
@snapshot_id = extract_snapshot_id(args, options)
|
26
|
+
@data = options.delete(:data)
|
27
|
+
@client = options.delete(:client) || Client.new(options)
|
28
|
+
end
|
29
|
+
|
30
|
+
# @!group Read-Only Attributes
|
31
|
+
|
32
|
+
# @return [String]
|
33
|
+
def cluster_id
|
34
|
+
@cluster_id
|
35
|
+
end
|
36
|
+
alias :db_cluster_identifier :cluster_id
|
37
|
+
|
38
|
+
# @return [String]
|
39
|
+
def snapshot_id
|
40
|
+
@snapshot_id
|
41
|
+
end
|
42
|
+
alias :db_cluster_snapshot_identifier :snapshot_id
|
43
|
+
|
44
|
+
# Provides the list of EC2 Availability Zones that instances in the DB
|
45
|
+
# cluster snapshot can be restored in.
|
46
|
+
# @return [Array<String>]
|
47
|
+
def availability_zones
|
48
|
+
data.availability_zones
|
49
|
+
end
|
50
|
+
|
51
|
+
# Provides the time when the snapshot was taken, in Universal
|
52
|
+
# Coordinated Time (UTC).
|
53
|
+
# @return [Time]
|
54
|
+
def snapshot_create_time
|
55
|
+
data.snapshot_create_time
|
56
|
+
end
|
57
|
+
|
58
|
+
# Specifies the name of the database engine.
|
59
|
+
# @return [String]
|
60
|
+
def engine
|
61
|
+
data.engine
|
62
|
+
end
|
63
|
+
|
64
|
+
# Specifies the allocated storage size in gigabytes (GB).
|
65
|
+
# @return [Integer]
|
66
|
+
def allocated_storage
|
67
|
+
data.allocated_storage
|
68
|
+
end
|
69
|
+
|
70
|
+
# Specifies the status of this DB cluster snapshot.
|
71
|
+
# @return [String]
|
72
|
+
def status
|
73
|
+
data.status
|
74
|
+
end
|
75
|
+
|
76
|
+
# Specifies the port that the DB cluster was listening on at the time of
|
77
|
+
# the snapshot.
|
78
|
+
# @return [Integer]
|
79
|
+
def port
|
80
|
+
data.port
|
81
|
+
end
|
82
|
+
|
83
|
+
# Provides the VPC ID associated with the DB cluster snapshot.
|
84
|
+
# @return [String]
|
85
|
+
def vpc_id
|
86
|
+
data.vpc_id
|
87
|
+
end
|
88
|
+
|
89
|
+
# Specifies the time when the DB cluster was created, in Universal
|
90
|
+
# Coordinated Time (UTC).
|
91
|
+
# @return [Time]
|
92
|
+
def cluster_create_time
|
93
|
+
data.cluster_create_time
|
94
|
+
end
|
95
|
+
|
96
|
+
# Provides the master username for the DB cluster snapshot.
|
97
|
+
# @return [String]
|
98
|
+
def master_username
|
99
|
+
data.master_username
|
100
|
+
end
|
101
|
+
|
102
|
+
# Provides the version of the database engine for this DB cluster
|
103
|
+
# snapshot.
|
104
|
+
# @return [String]
|
105
|
+
def engine_version
|
106
|
+
data.engine_version
|
107
|
+
end
|
108
|
+
|
109
|
+
# Provides the license model information for this DB cluster snapshot.
|
110
|
+
# @return [String]
|
111
|
+
def license_model
|
112
|
+
data.license_model
|
113
|
+
end
|
114
|
+
|
115
|
+
# Provides the type of the DB cluster snapshot.
|
116
|
+
# @return [String]
|
117
|
+
def snapshot_type
|
118
|
+
data.snapshot_type
|
119
|
+
end
|
120
|
+
|
121
|
+
# Specifies the percentage of the estimated data that has been
|
122
|
+
# transferred.
|
123
|
+
# @return [Integer]
|
124
|
+
def percent_progress
|
125
|
+
data.percent_progress
|
126
|
+
end
|
127
|
+
|
128
|
+
# Specifies whether the DB cluster snapshot is encrypted.
|
129
|
+
# @return [Boolean]
|
130
|
+
def storage_encrypted
|
131
|
+
data.storage_encrypted
|
132
|
+
end
|
133
|
+
|
134
|
+
# If `StorageEncrypted` is true, the KMS key identifier for the
|
135
|
+
# encrypted DB cluster snapshot.
|
136
|
+
# @return [String]
|
137
|
+
def kms_key_id
|
138
|
+
data.kms_key_id
|
139
|
+
end
|
140
|
+
|
141
|
+
# The Amazon Resource Name (ARN) for the DB cluster snapshot.
|
142
|
+
# @return [String]
|
143
|
+
def db_cluster_snapshot_arn
|
144
|
+
data.db_cluster_snapshot_arn
|
145
|
+
end
|
146
|
+
|
147
|
+
# @!endgroup
|
148
|
+
|
149
|
+
# @return [Client]
|
150
|
+
def client
|
151
|
+
@client
|
152
|
+
end
|
153
|
+
|
154
|
+
# Loads, or reloads {#data} for the current {DBClusterSnapshot}.
|
155
|
+
# Returns `self` making it possible to chain methods.
|
156
|
+
#
|
157
|
+
# db_cluster_snapshot.reload.data
|
158
|
+
#
|
159
|
+
# @return [self]
|
160
|
+
def load
|
161
|
+
resp = @client.describe_db_cluster_snapshots(db_cluster_snapshot_identifier: @snapshot_id)
|
162
|
+
@data = resp.dbclustersnapshots[0]
|
163
|
+
self
|
164
|
+
end
|
165
|
+
alias :reload :load
|
166
|
+
|
167
|
+
# @return [Types::DBClusterSnapshot]
|
168
|
+
# Returns the data for this {DBClusterSnapshot}. Calls
|
169
|
+
# {Client#describe_db_cluster_snapshots} if {#data_loaded?} is `false`.
|
170
|
+
def data
|
171
|
+
load unless @data
|
172
|
+
@data
|
173
|
+
end
|
174
|
+
|
175
|
+
# @return [Boolean]
|
176
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
177
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
178
|
+
def data_loaded?
|
179
|
+
!!@data
|
180
|
+
end
|
181
|
+
|
182
|
+
# @!group Actions
|
183
|
+
|
184
|
+
# @example Request syntax with placeholder values
|
185
|
+
#
|
186
|
+
# dbclustersnapshot = db_cluster_snapshot.create({
|
187
|
+
# tags: [
|
188
|
+
# {
|
189
|
+
# key: "String",
|
190
|
+
# value: "String",
|
191
|
+
# },
|
192
|
+
# ],
|
193
|
+
# })
|
194
|
+
# @param [Hash] options ({})
|
195
|
+
# @option options [Array<Types::Tag>] :tags
|
196
|
+
# The tags to be assigned to the DB cluster snapshot.
|
197
|
+
# @return [DBClusterSnapshot]
|
198
|
+
def create(options = {})
|
199
|
+
options = options.merge(
|
200
|
+
db_cluster_identifier: @cluster_id,
|
201
|
+
db_cluster_snapshot_identifier: @snapshot_id
|
202
|
+
)
|
203
|
+
resp = @client.create_db_cluster_snapshot(options)
|
204
|
+
DBClusterSnapshot.new(
|
205
|
+
cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
|
206
|
+
snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
|
207
|
+
data: resp.data.db_cluster_snapshot,
|
208
|
+
client: @client
|
209
|
+
)
|
210
|
+
end
|
211
|
+
|
212
|
+
# @example Request syntax with placeholder values
|
213
|
+
#
|
214
|
+
# dbclustersnapshot = db_cluster_snapshot.copy({
|
215
|
+
# target_db_cluster_snapshot_identifier: "String", # required
|
216
|
+
# tags: [
|
217
|
+
# {
|
218
|
+
# key: "String",
|
219
|
+
# value: "String",
|
220
|
+
# },
|
221
|
+
# ],
|
222
|
+
# })
|
223
|
+
# @param [Hash] options ({})
|
224
|
+
# @option options [required, String] :target_db_cluster_snapshot_identifier
|
225
|
+
# The identifier of the new DB cluster snapshot to create from the
|
226
|
+
# source DB cluster snapshot. This parameter is not case-sensitive.
|
227
|
+
#
|
228
|
+
# Constraints:
|
229
|
+
#
|
230
|
+
# * Must contain from 1 to 63 alphanumeric characters or hyphens.
|
231
|
+
#
|
232
|
+
# * First character must be a letter.
|
233
|
+
#
|
234
|
+
# * Cannot end with a hyphen or contain two consecutive hyphens.
|
235
|
+
#
|
236
|
+
# Example: `my-cluster-snapshot2`
|
237
|
+
# @option options [Array<Types::Tag>] :tags
|
238
|
+
# A list of tags.
|
239
|
+
# @return [DBClusterSnapshot]
|
240
|
+
def copy(options = {})
|
241
|
+
options = options.merge(source_db_cluster_snapshot_identifier: @snapshot_id)
|
242
|
+
resp = @client.copy_db_cluster_snapshot(options)
|
243
|
+
DBClusterSnapshot.new(
|
244
|
+
cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
|
245
|
+
snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
|
246
|
+
data: resp.data.db_cluster_snapshot,
|
247
|
+
client: @client
|
248
|
+
)
|
249
|
+
end
|
250
|
+
|
251
|
+
# @example Request syntax with placeholder values
|
252
|
+
#
|
253
|
+
# dbclustersnapshot = db_cluster_snapshot.delete()
|
254
|
+
# @param [Hash] options ({})
|
255
|
+
# @return [DBClusterSnapshot]
|
256
|
+
def delete(options = {})
|
257
|
+
options = options.merge(db_cluster_snapshot_identifier: @snapshot_id)
|
258
|
+
resp = @client.delete_db_cluster_snapshot(options)
|
259
|
+
DBClusterSnapshot.new(
|
260
|
+
cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
|
261
|
+
snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
|
262
|
+
data: resp.data.db_cluster_snapshot,
|
263
|
+
client: @client
|
264
|
+
)
|
265
|
+
end
|
266
|
+
|
267
|
+
# @example Request syntax with placeholder values
|
268
|
+
#
|
269
|
+
# dbcluster = db_cluster_snapshot.restore({
|
270
|
+
# availability_zones: ["String"],
|
271
|
+
# db_cluster_identifier: "String", # required
|
272
|
+
# engine: "String", # required
|
273
|
+
# engine_version: "String",
|
274
|
+
# port: 1,
|
275
|
+
# db_subnet_group_name: "String",
|
276
|
+
# database_name: "String",
|
277
|
+
# option_group_name: "String",
|
278
|
+
# vpc_security_group_ids: ["String"],
|
279
|
+
# tags: [
|
280
|
+
# {
|
281
|
+
# key: "String",
|
282
|
+
# value: "String",
|
283
|
+
# },
|
284
|
+
# ],
|
285
|
+
# kms_key_id: "String",
|
286
|
+
# })
|
287
|
+
# @param [Hash] options ({})
|
288
|
+
# @option options [Array<String>] :availability_zones
|
289
|
+
# Provides the list of EC2 Availability Zones that instances in the
|
290
|
+
# restored DB cluster can be created in.
|
291
|
+
# @option options [required, String] :db_cluster_identifier
|
292
|
+
# The name of the DB cluster to create from the DB cluster snapshot.
|
293
|
+
# This parameter isn't case-sensitive.
|
294
|
+
#
|
295
|
+
# Constraints:
|
296
|
+
#
|
297
|
+
# * Must contain from 1 to 255 alphanumeric characters or hyphens
|
298
|
+
#
|
299
|
+
# * First character must be a letter
|
300
|
+
#
|
301
|
+
# * Cannot end with a hyphen or contain two consecutive hyphens
|
302
|
+
#
|
303
|
+
# Example: `my-snapshot-id`
|
304
|
+
# @option options [required, String] :engine
|
305
|
+
# The database engine to use for the new DB cluster.
|
306
|
+
#
|
307
|
+
# Default: The same as source
|
308
|
+
#
|
309
|
+
# Constraint: Must be compatible with the engine of the source
|
310
|
+
# @option options [String] :engine_version
|
311
|
+
# The version of the database engine to use for the new DB cluster.
|
312
|
+
# @option options [Integer] :port
|
313
|
+
# The port number on which the new DB cluster accepts connections.
|
314
|
+
#
|
315
|
+
# Constraints: Value must be `1150-65535`
|
316
|
+
#
|
317
|
+
# Default: The same port as the original DB cluster.
|
318
|
+
# @option options [String] :db_subnet_group_name
|
319
|
+
# The name of the DB subnet group to use for the new DB cluster.
|
320
|
+
#
|
321
|
+
# Constraints: Must contain no more than 255 alphanumeric characters,
|
322
|
+
# periods, underscores, spaces, or hyphens. Must not be default.
|
323
|
+
#
|
324
|
+
# Example: `mySubnetgroup`
|
325
|
+
# @option options [String] :database_name
|
326
|
+
# The database name for the restored DB cluster.
|
327
|
+
# @option options [String] :option_group_name
|
328
|
+
# The name of the option group to use for the restored DB cluster.
|
329
|
+
# @option options [Array<String>] :vpc_security_group_ids
|
330
|
+
# A list of VPC security groups that the new DB cluster will belong to.
|
331
|
+
# @option options [Array<Types::Tag>] :tags
|
332
|
+
# The tags to be assigned to the restored DB cluster.
|
333
|
+
# @option options [String] :kms_key_id
|
334
|
+
# The KMS key identifier to use when restoring an encrypted DB cluster
|
335
|
+
# from a DB cluster snapshot.
|
336
|
+
#
|
337
|
+
# The KMS key identifier is the Amazon Resource Name (ARN) for the KMS
|
338
|
+
# encryption key. If you are restoring a DB cluster with the same AWS
|
339
|
+
# account that owns the KMS encryption key used to encrypt the new DB
|
340
|
+
# cluster, then you can use the KMS key alias instead of the ARN for the
|
341
|
+
# KMS encryption key.
|
342
|
+
#
|
343
|
+
# If you do not specify a value for the `KmsKeyId` parameter, then the
|
344
|
+
# following will occur:
|
345
|
+
#
|
346
|
+
# * If the DB cluster snapshot is encrypted, then the restored DB
|
347
|
+
# cluster is encrypted using the KMS key that was used to encrypt the
|
348
|
+
# DB cluster snapshot.
|
349
|
+
#
|
350
|
+
# * If the DB cluster snapshot is not encrypted, then the restored DB
|
351
|
+
# cluster is encrypted using the specified encryption key.
|
352
|
+
# @return [DBCluster]
|
353
|
+
def restore(options = {})
|
354
|
+
options = options.merge(snapshot_identifier: @snapshot_id)
|
355
|
+
resp = @client.restore_db_cluster_from_snapshot(options)
|
356
|
+
DBCluster.new(
|
357
|
+
id: resp.data.db_cluster.db_cluster_identifier,
|
358
|
+
data: resp.data.db_cluster,
|
359
|
+
client: @client
|
360
|
+
)
|
361
|
+
end
|
362
|
+
|
363
|
+
# @!group Associations
|
364
|
+
|
365
|
+
# @return [DBCluster]
|
366
|
+
def cluster
|
367
|
+
DBCluster.new(
|
368
|
+
id: @cluster_id,
|
369
|
+
client: @client
|
370
|
+
)
|
371
|
+
end
|
372
|
+
|
373
|
+
# @example Request syntax with placeholder values
|
374
|
+
#
|
375
|
+
# events = db_cluster_snapshot.events({
|
376
|
+
# start_time: Time.now,
|
377
|
+
# end_time: Time.now,
|
378
|
+
# duration: 1,
|
379
|
+
# event_categories: ["String"],
|
380
|
+
# filters: [
|
381
|
+
# {
|
382
|
+
# name: "String", # required
|
383
|
+
# values: ["String"], # required
|
384
|
+
# },
|
385
|
+
# ],
|
386
|
+
# })
|
387
|
+
# @param [Hash] options ({})
|
388
|
+
# @option options [Time,DateTime,Date,Integer,String] :start_time
|
389
|
+
# The beginning of the time interval to retrieve events for, specified
|
390
|
+
# in ISO 8601 format. For more information about ISO 8601, go to the
|
391
|
+
# [ISO8601 Wikipedia page.][1]
|
392
|
+
#
|
393
|
+
# Example: 2009-07-08T18:00Z
|
394
|
+
#
|
395
|
+
#
|
396
|
+
#
|
397
|
+
# [1]: http://en.wikipedia.org/wiki/ISO_8601
|
398
|
+
# @option options [Time,DateTime,Date,Integer,String] :end_time
|
399
|
+
# The end of the time interval for which to retrieve events, specified
|
400
|
+
# in ISO 8601 format. For more information about ISO 8601, go to the
|
401
|
+
# [ISO8601 Wikipedia page.][1]
|
402
|
+
#
|
403
|
+
# Example: 2009-07-08T18:00Z
|
404
|
+
#
|
405
|
+
#
|
406
|
+
#
|
407
|
+
# [1]: http://en.wikipedia.org/wiki/ISO_8601
|
408
|
+
# @option options [Integer] :duration
|
409
|
+
# The number of minutes to retrieve events for.
|
410
|
+
#
|
411
|
+
# Default: 60
|
412
|
+
# @option options [Array<String>] :event_categories
|
413
|
+
# A list of event categories that trigger notifications for a event
|
414
|
+
# notification subscription.
|
415
|
+
# @option options [Array<Types::Filter>] :filters
|
416
|
+
# This parameter is not currently supported.
|
417
|
+
# @return [Event::Collection]
|
418
|
+
def events(options = {})
|
419
|
+
batches = Enumerator.new do |y|
|
420
|
+
options = options.merge(
|
421
|
+
source_type: "db-cluster-snapshot",
|
422
|
+
source_identifier: @snapshot_id
|
423
|
+
)
|
424
|
+
resp = @client.describe_events(options)
|
425
|
+
resp.each_page do |page|
|
426
|
+
batch = []
|
427
|
+
page.data.events.each do |e|
|
428
|
+
batch << Event.new(
|
429
|
+
source_id: e.source_identifier,
|
430
|
+
date: e.date,
|
431
|
+
data: e,
|
432
|
+
client: @client
|
433
|
+
)
|
434
|
+
end
|
435
|
+
y.yield(batch)
|
436
|
+
end
|
437
|
+
end
|
438
|
+
Event::Collection.new(batches)
|
439
|
+
end
|
440
|
+
|
441
|
+
# @deprecated
|
442
|
+
# @api private
|
443
|
+
def identifiers
|
444
|
+
{
|
445
|
+
cluster_id: @cluster_id,
|
446
|
+
snapshot_id: @snapshot_id
|
447
|
+
}
|
448
|
+
end
|
449
|
+
deprecated(:identifiers)
|
450
|
+
|
451
|
+
private
|
452
|
+
|
453
|
+
def extract_cluster_id(args, options)
|
454
|
+
value = args[0] || options.delete(:cluster_id)
|
455
|
+
case value
|
456
|
+
when String then value
|
457
|
+
when nil then raise ArgumentError, "missing required option :cluster_id"
|
458
|
+
else
|
459
|
+
msg = "expected :cluster_id to be a String, got #{value.class}"
|
460
|
+
raise ArgumentError, msg
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
def extract_snapshot_id(args, options)
|
465
|
+
value = args[1] || options.delete(:snapshot_id)
|
466
|
+
case value
|
467
|
+
when String then value
|
468
|
+
when nil then raise ArgumentError, "missing required option :snapshot_id"
|
469
|
+
else
|
470
|
+
msg = "expected :snapshot_id to be a String, got #{value.class}"
|
471
|
+
raise ArgumentError, msg
|
472
|
+
end
|
473
|
+
end
|
474
|
+
|
475
|
+
class Collection < Aws::Resources::Collection; end
|
476
|
+
end
|
477
|
+
end
|
478
|
+
end
|