aws-sdk-rds 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/lib/aws-sdk-rds.rb +73 -0
  3. data/lib/aws-sdk-rds/account_quota.rb +100 -0
  4. data/lib/aws-sdk-rds/certificate.rb +123 -0
  5. data/lib/aws-sdk-rds/client.rb +9214 -0
  6. data/lib/aws-sdk-rds/client_api.rb +3027 -0
  7. data/lib/aws-sdk-rds/customizations.rb +7 -0
  8. data/lib/aws-sdk-rds/db_cluster.rb +1074 -0
  9. data/lib/aws-sdk-rds/db_cluster_parameter_group.rb +230 -0
  10. data/lib/aws-sdk-rds/db_cluster_snapshot.rb +478 -0
  11. data/lib/aws-sdk-rds/db_engine.rb +241 -0
  12. data/lib/aws-sdk-rds/db_engine_version.rb +263 -0
  13. data/lib/aws-sdk-rds/db_instance.rb +2680 -0
  14. data/lib/aws-sdk-rds/db_log_file.rb +170 -0
  15. data/lib/aws-sdk-rds/db_parameter_group.rb +455 -0
  16. data/lib/aws-sdk-rds/db_parameter_group_family.rb +167 -0
  17. data/lib/aws-sdk-rds/db_security_group.rb +358 -0
  18. data/lib/aws-sdk-rds/db_snapshot.rb +714 -0
  19. data/lib/aws-sdk-rds/db_snapshot_attribute.rb +160 -0
  20. data/lib/aws-sdk-rds/db_subnet_group.rb +188 -0
  21. data/lib/aws-sdk-rds/errors.rb +23 -0
  22. data/lib/aws-sdk-rds/event.rb +134 -0
  23. data/lib/aws-sdk-rds/event_category_map.rb +98 -0
  24. data/lib/aws-sdk-rds/event_subscription.rb +352 -0
  25. data/lib/aws-sdk-rds/option_group.rb +283 -0
  26. data/lib/aws-sdk-rds/option_group_option.rb +166 -0
  27. data/lib/aws-sdk-rds/parameter.rb +144 -0
  28. data/lib/aws-sdk-rds/pending_maintenance_action.rb +211 -0
  29. data/lib/aws-sdk-rds/reserved_db_instance.rb +191 -0
  30. data/lib/aws-sdk-rds/reserved_db_instances_offering.rb +183 -0
  31. data/lib/aws-sdk-rds/resource.rb +2384 -0
  32. data/lib/aws-sdk-rds/resource_pending_maintenance_action_list.rb +111 -0
  33. data/lib/aws-sdk-rds/types.rb +10965 -0
  34. data/lib/aws-sdk-rds/waiters.rb +149 -0
  35. metadata +106 -0
@@ -0,0 +1,167 @@
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 DBParameterGroupFamily
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 = Aws::EmptyStructure.new
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
+
34
+ # @!endgroup
35
+
36
+ # @return [Client]
37
+ def client
38
+ @client
39
+ end
40
+
41
+ # @raise [Errors::ResourceNotLoadable]
42
+ # @api private
43
+ def load
44
+ msg = "#load is not implemented, data only available via enumeration"
45
+ raise Errors::ResourceNotLoadable, msg
46
+ end
47
+ alias :reload :load
48
+
49
+ # @api private
50
+ # @return [EmptyStructure]
51
+ def data
52
+ @data
53
+ end
54
+
55
+ # @return [Boolean]
56
+ # Returns `true` if this resource is loaded. Accessing attributes or
57
+ # {#data} on an unloaded resource will trigger a call to {#load}.
58
+ def data_loaded?
59
+ !!@data
60
+ end
61
+
62
+ # @!group Associations
63
+
64
+ # @example Request syntax with placeholder values
65
+ #
66
+ # enginedefaultclusterparameters = db_parameter_group_family.engine_default_cluster_parameters({
67
+ # filters: [
68
+ # {
69
+ # name: "String", # required
70
+ # values: ["String"], # required
71
+ # },
72
+ # ],
73
+ # max_records: 1,
74
+ # marker: "String",
75
+ # })
76
+ # @param [Hash] options ({})
77
+ # @option options [Array<Types::Filter>] :filters
78
+ # This parameter is not currently supported.
79
+ # @option options [Integer] :max_records
80
+ # The maximum number of records to include in the response. If more
81
+ # records exist than the specified `MaxRecords` value, a pagination
82
+ # token called a marker is included in the response so that the
83
+ # remaining results can be retrieved.
84
+ #
85
+ # Default: 100
86
+ #
87
+ # Constraints: Minimum 20, maximum 100.
88
+ # @option options [String] :marker
89
+ # An optional pagination token provided by a previous
90
+ # `DescribeEngineDefaultClusterParameters` request. If this parameter is
91
+ # specified, the response includes only records beyond the marker, up to
92
+ # the value specified by `MaxRecords`.
93
+ # @return [Parameter::Collection]
94
+ def engine_default_cluster_parameters(options = {})
95
+ batches = Enumerator.new do |y|
96
+ batch = []
97
+ options = options.merge(db_parameter_group_family: @name)
98
+ resp = @client.describe_engine_default_cluster_parameters(options)
99
+ resp.data.engine_defaults.parameters.each do |p|
100
+ batch << Parameter.new(
101
+ name: p.parameter_name,
102
+ data: p,
103
+ client: @client
104
+ )
105
+ end
106
+ y.yield(batch)
107
+ end
108
+ Parameter::Collection.new(batches)
109
+ end
110
+
111
+ # @example Request syntax with placeholder values
112
+ #
113
+ # enginedefaultparameters = db_parameter_group_family.engine_default_parameters({
114
+ # filters: [
115
+ # {
116
+ # name: "String", # required
117
+ # values: ["String"], # required
118
+ # },
119
+ # ],
120
+ # })
121
+ # @param [Hash] options ({})
122
+ # @option options [Array<Types::Filter>] :filters
123
+ # Not currently supported.
124
+ # @return [Parameter::Collection]
125
+ def engine_default_parameters(options = {})
126
+ batches = Enumerator.new do |y|
127
+ options = options.merge(db_parameter_group_family: @name)
128
+ resp = @client.describe_engine_default_parameters(options)
129
+ resp.each_page do |page|
130
+ batch = []
131
+ page.data.engine_defaults.parameters.each do |p|
132
+ batch << Parameter.new(
133
+ name: p.parameter_name,
134
+ data: p,
135
+ client: @client
136
+ )
137
+ end
138
+ y.yield(batch)
139
+ end
140
+ end
141
+ Parameter::Collection.new(batches)
142
+ end
143
+
144
+ # @deprecated
145
+ # @api private
146
+ def identifiers
147
+ { name: @name }
148
+ end
149
+ deprecated(:identifiers)
150
+
151
+ private
152
+
153
+ def extract_name(args, options)
154
+ value = args[0] || options.delete(:name)
155
+ case value
156
+ when String then value
157
+ when nil then raise ArgumentError, "missing required option :name"
158
+ else
159
+ msg = "expected :name to be a String, got #{value.class}"
160
+ raise ArgumentError, msg
161
+ end
162
+ end
163
+
164
+ class Collection < Aws::Resources::Collection; end
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,358 @@
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 DBSecurityGroup
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_security_group_name :name
34
+
35
+ # Provides the AWS ID of the owner of a specific DB security group.
36
+ # @return [String]
37
+ def owner_id
38
+ data.owner_id
39
+ end
40
+
41
+ # Provides the description of the DB security group.
42
+ # @return [String]
43
+ def db_security_group_description
44
+ data.db_security_group_description
45
+ end
46
+
47
+ # Provides the VpcId of the DB security group.
48
+ # @return [String]
49
+ def vpc_id
50
+ data.vpc_id
51
+ end
52
+
53
+ # Contains a list of EC2SecurityGroup elements.
54
+ # @return [Array<Types::EC2SecurityGroup>]
55
+ def ec2_security_groups
56
+ data.ec2_security_groups
57
+ end
58
+
59
+ # Contains a list of IPRange elements.
60
+ # @return [Array<Types::IPRange>]
61
+ def ip_ranges
62
+ data.ip_ranges
63
+ end
64
+
65
+ # The Amazon Resource Name (ARN) for the DB security group.
66
+ # @return [String]
67
+ def db_security_group_arn
68
+ data.db_security_group_arn
69
+ end
70
+
71
+ # @!endgroup
72
+
73
+ # @return [Client]
74
+ def client
75
+ @client
76
+ end
77
+
78
+ # Loads, or reloads {#data} for the current {DBSecurityGroup}.
79
+ # Returns `self` making it possible to chain methods.
80
+ #
81
+ # db_security_group.reload.data
82
+ #
83
+ # @return [self]
84
+ def load
85
+ resp = @client.describe_db_security_groups(db_security_group_name: @name)
86
+ @data = resp.dbsecuritygroups[0]
87
+ self
88
+ end
89
+ alias :reload :load
90
+
91
+ # @return [Types::DBSecurityGroup]
92
+ # Returns the data for this {DBSecurityGroup}. Calls
93
+ # {Client#describe_db_security_groups} if {#data_loaded?} is `false`.
94
+ def data
95
+ load unless @data
96
+ @data
97
+ end
98
+
99
+ # @return [Boolean]
100
+ # Returns `true` if this resource is loaded. Accessing attributes or
101
+ # {#data} on an unloaded resource will trigger a call to {#load}.
102
+ def data_loaded?
103
+ !!@data
104
+ end
105
+
106
+ # @!group Actions
107
+
108
+ # @example Request syntax with placeholder values
109
+ #
110
+ # dbsecuritygroup = db_security_group.authorize_ingress({
111
+ # cidrip: "String",
112
+ # ec2_security_group_name: "String",
113
+ # ec2_security_group_id: "String",
114
+ # ec2_security_group_owner_id: "String",
115
+ # })
116
+ # @param [Hash] options ({})
117
+ # @option options [String] :cidrip
118
+ # The IP range to authorize.
119
+ # @option options [String] :ec2_security_group_name
120
+ # Name of the EC2 security group to authorize. For VPC DB security
121
+ # groups, `EC2SecurityGroupId` must be provided. Otherwise,
122
+ # `EC2SecurityGroupOwnerId` and either `EC2SecurityGroupName` or
123
+ # `EC2SecurityGroupId` must be provided.
124
+ # @option options [String] :ec2_security_group_id
125
+ # Id of the EC2 security group to authorize. For VPC DB security groups,
126
+ # `EC2SecurityGroupId` must be provided. Otherwise,
127
+ # `EC2SecurityGroupOwnerId` and either `EC2SecurityGroupName` or
128
+ # `EC2SecurityGroupId` must be provided.
129
+ # @option options [String] :ec2_security_group_owner_id
130
+ # AWS account number of the owner of the EC2 security group specified in
131
+ # the `EC2SecurityGroupName` parameter. The AWS Access Key ID is not an
132
+ # acceptable value. For VPC DB security groups, `EC2SecurityGroupId`
133
+ # must be provided. Otherwise, `EC2SecurityGroupOwnerId` and either
134
+ # `EC2SecurityGroupName` or `EC2SecurityGroupId` must be provided.
135
+ # @return [DBSecurityGroup]
136
+ def authorize_ingress(options = {})
137
+ options = options.merge(db_security_group_name: @name)
138
+ resp = @client.authorize_db_security_group_ingress(options)
139
+ DBSecurityGroup.new(
140
+ name: resp.data.db_security_group.db_security_group_name,
141
+ data: resp.data.db_security_group,
142
+ client: @client
143
+ )
144
+ end
145
+
146
+ # @example Request syntax with placeholder values
147
+ #
148
+ # dbsecuritygroup = db_security_group.create({
149
+ # db_security_group_description: "String", # required
150
+ # tags: [
151
+ # {
152
+ # key: "String",
153
+ # value: "String",
154
+ # },
155
+ # ],
156
+ # })
157
+ # @param [Hash] options ({})
158
+ # @option options [required, String] :db_security_group_description
159
+ # The description for the DB security group.
160
+ # @option options [Array<Types::Tag>] :tags
161
+ # A list of tags.
162
+ # @return [DBSecurityGroup]
163
+ def create(options = {})
164
+ options = options.merge(db_security_group_name: @name)
165
+ resp = @client.create_db_security_group(options)
166
+ DBSecurityGroup.new(
167
+ name: resp.data.db_security_group.db_security_group_name,
168
+ data: resp.data.db_security_group,
169
+ client: @client
170
+ )
171
+ end
172
+
173
+ # @example Request syntax with placeholder values
174
+ #
175
+ # db_security_group.delete()
176
+ # @param [Hash] options ({})
177
+ # @return [EmptyStructure]
178
+ def delete(options = {})
179
+ options = options.merge(db_security_group_name: @name)
180
+ resp = @client.delete_db_security_group(options)
181
+ resp.data
182
+ end
183
+
184
+ # @example Request syntax with placeholder values
185
+ #
186
+ # dbsecuritygroup = db_security_group.revoke_ingress({
187
+ # cidrip: "String",
188
+ # ec2_security_group_name: "String",
189
+ # ec2_security_group_id: "String",
190
+ # ec2_security_group_owner_id: "String",
191
+ # })
192
+ # @param [Hash] options ({})
193
+ # @option options [String] :cidrip
194
+ # The IP range to revoke access from. Must be a valid CIDR range. If
195
+ # `CIDRIP` is specified, `EC2SecurityGroupName`, `EC2SecurityGroupId`
196
+ # and `EC2SecurityGroupOwnerId` cannot be provided.
197
+ # @option options [String] :ec2_security_group_name
198
+ # The name of the EC2 security group to revoke access from. For VPC DB
199
+ # security groups, `EC2SecurityGroupId` must be provided. Otherwise,
200
+ # EC2SecurityGroupOwnerId and either `EC2SecurityGroupName` or
201
+ # `EC2SecurityGroupId` must be provided.
202
+ # @option options [String] :ec2_security_group_id
203
+ # The id of the EC2 security group to revoke access from. For VPC DB
204
+ # security groups, `EC2SecurityGroupId` must be provided. Otherwise,
205
+ # EC2SecurityGroupOwnerId and either `EC2SecurityGroupName` or
206
+ # `EC2SecurityGroupId` must be provided.
207
+ # @option options [String] :ec2_security_group_owner_id
208
+ # The AWS Account Number of the owner of the EC2 security group
209
+ # specified in the `EC2SecurityGroupName` parameter. The AWS Access Key
210
+ # ID is not an acceptable value. For VPC DB security groups,
211
+ # `EC2SecurityGroupId` must be provided. Otherwise,
212
+ # EC2SecurityGroupOwnerId and either `EC2SecurityGroupName` or
213
+ # `EC2SecurityGroupId` must be provided.
214
+ # @return [DBSecurityGroup]
215
+ def revoke_ingress(options = {})
216
+ options = options.merge(db_security_group_name: @name)
217
+ resp = @client.revoke_db_security_group_ingress(options)
218
+ DBSecurityGroup.new(
219
+ name: resp.data.db_security_group.db_security_group_name,
220
+ data: resp.data.db_security_group,
221
+ client: @client
222
+ )
223
+ end
224
+
225
+ # @example Request syntax with placeholder values
226
+ #
227
+ # eventsubscription = db_security_group.subscribe_to({
228
+ # subscription_name: "String", # required
229
+ # })
230
+ # @param [Hash] options ({})
231
+ # @option options [required, String] :subscription_name
232
+ # The name of the RDS event notification subscription you want to add a
233
+ # source identifier to.
234
+ # @return [EventSubscription]
235
+ def subscribe_to(options = {})
236
+ options = options.merge(source_identifier: @name)
237
+ resp = @client.add_source_identifier_to_subscription(options)
238
+ EventSubscription.new(
239
+ name: resp.data.event_subscription.cust_subscription_id,
240
+ data: resp.data.event_subscription,
241
+ client: @client
242
+ )
243
+ end
244
+
245
+ # @example Request syntax with placeholder values
246
+ #
247
+ # eventsubscription = db_security_group.unsubscribe_from({
248
+ # subscription_name: "String", # required
249
+ # })
250
+ # @param [Hash] options ({})
251
+ # @option options [required, String] :subscription_name
252
+ # The name of the RDS event notification subscription you want to remove
253
+ # a source identifier from.
254
+ # @return [EventSubscription]
255
+ def unsubscribe_from(options = {})
256
+ options = options.merge(source_identifier: @name)
257
+ resp = @client.remove_source_identifier_from_subscription(options)
258
+ EventSubscription.new(
259
+ name: resp.data.event_subscription.cust_subscription_id,
260
+ data: resp.data.event_subscription,
261
+ client: @client
262
+ )
263
+ end
264
+
265
+ # @!group Associations
266
+
267
+ # @example Request syntax with placeholder values
268
+ #
269
+ # events = db_security_group.events({
270
+ # start_time: Time.now,
271
+ # end_time: Time.now,
272
+ # duration: 1,
273
+ # event_categories: ["String"],
274
+ # filters: [
275
+ # {
276
+ # name: "String", # required
277
+ # values: ["String"], # required
278
+ # },
279
+ # ],
280
+ # })
281
+ # @param [Hash] options ({})
282
+ # @option options [Time,DateTime,Date,Integer,String] :start_time
283
+ # The beginning of the time interval to retrieve events for, specified
284
+ # in ISO 8601 format. For more information about ISO 8601, go to the
285
+ # [ISO8601 Wikipedia page.][1]
286
+ #
287
+ # Example: 2009-07-08T18:00Z
288
+ #
289
+ #
290
+ #
291
+ # [1]: http://en.wikipedia.org/wiki/ISO_8601
292
+ # @option options [Time,DateTime,Date,Integer,String] :end_time
293
+ # The end of the time interval for which to retrieve events, specified
294
+ # in ISO 8601 format. For more information about ISO 8601, go to the
295
+ # [ISO8601 Wikipedia page.][1]
296
+ #
297
+ # Example: 2009-07-08T18:00Z
298
+ #
299
+ #
300
+ #
301
+ # [1]: http://en.wikipedia.org/wiki/ISO_8601
302
+ # @option options [Integer] :duration
303
+ # The number of minutes to retrieve events for.
304
+ #
305
+ # Default: 60
306
+ # @option options [Array<String>] :event_categories
307
+ # A list of event categories that trigger notifications for a event
308
+ # notification subscription.
309
+ # @option options [Array<Types::Filter>] :filters
310
+ # This parameter is not currently supported.
311
+ # @return [Event::Collection]
312
+ def events(options = {})
313
+ batches = Enumerator.new do |y|
314
+ options = options.merge(
315
+ source_type: "db-security-group",
316
+ source_identifier: @name
317
+ )
318
+ resp = @client.describe_events(options)
319
+ resp.each_page do |page|
320
+ batch = []
321
+ page.data.events.each do |e|
322
+ batch << Event.new(
323
+ source_id: e.source_identifier,
324
+ date: e.date,
325
+ data: e,
326
+ client: @client
327
+ )
328
+ end
329
+ y.yield(batch)
330
+ end
331
+ end
332
+ Event::Collection.new(batches)
333
+ end
334
+
335
+ # @deprecated
336
+ # @api private
337
+ def identifiers
338
+ { name: @name }
339
+ end
340
+ deprecated(:identifiers)
341
+
342
+ private
343
+
344
+ def extract_name(args, options)
345
+ value = args[0] || options.delete(:name)
346
+ case value
347
+ when String then value
348
+ when nil then raise ArgumentError, "missing required option :name"
349
+ else
350
+ msg = "expected :name to be a String, got #{value.class}"
351
+ raise ArgumentError, msg
352
+ end
353
+ end
354
+
355
+ class Collection < Aws::Resources::Collection; end
356
+ end
357
+ end
358
+ end