aws-sdk-rds 1.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +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,170 @@
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 DBLogFile
11
+
12
+ extend Aws::Deprecations
13
+
14
+ # @overload def initialize(instance_id, name, options = {})
15
+ # @param [String] instance_id
16
+ # @param [String] name
17
+ # @option options [Client] :client
18
+ # @overload def initialize(options = {})
19
+ # @option options [required, String] :instance_id
20
+ # @option options [required, String] :name
21
+ # @option options [Client] :client
22
+ def initialize(*args)
23
+ options = Hash === args.last ? args.pop.dup : {}
24
+ @instance_id = extract_instance_id(args, options)
25
+ @name = extract_name(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 instance_id
34
+ @instance_id
35
+ end
36
+
37
+ # @return [String]
38
+ def name
39
+ @name
40
+ end
41
+ alias :log_file_name :name
42
+
43
+ # A POSIX timestamp when the last log entry was written.
44
+ # @return [Integer]
45
+ def last_written
46
+ data.last_written
47
+ end
48
+
49
+ # The size, in bytes, of the log file for the specified DB instance.
50
+ # @return [Integer]
51
+ def size
52
+ data.size
53
+ end
54
+
55
+ # @!endgroup
56
+
57
+ # @return [Client]
58
+ def client
59
+ @client
60
+ end
61
+
62
+ # @raise [Errors::ResourceNotLoadable]
63
+ # @api private
64
+ def load
65
+ msg = "#load is not implemented, data only available via enumeration"
66
+ raise Errors::ResourceNotLoadable, msg
67
+ end
68
+ alias :reload :load
69
+
70
+ # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
71
+ # @return [Types::DescribeDBLogFilesDetails]
72
+ # Returns the data for this {DBLogFile}.
73
+ def data
74
+ load unless @data
75
+ @data
76
+ end
77
+
78
+ # @return [Boolean]
79
+ # Returns `true` if this resource is loaded. Accessing attributes or
80
+ # {#data} on an unloaded resource will trigger a call to {#load}.
81
+ def data_loaded?
82
+ !!@data
83
+ end
84
+
85
+ # @!group Actions
86
+
87
+ # @example Request syntax with placeholder values
88
+ #
89
+ # db_log_file.download({
90
+ # marker: "String",
91
+ # number_of_lines: 1,
92
+ # })
93
+ # @param [Hash] options ({})
94
+ # @option options [String] :marker
95
+ # The pagination token provided in the previous request or "0". If the
96
+ # Marker parameter is specified the response includes only records
97
+ # beyond the marker until the end of the file or up to NumberOfLines.
98
+ # @option options [Integer] :number_of_lines
99
+ # The number of lines to download. If the number of lines specified
100
+ # results in a file over 1 MB in size, the file will be truncated at 1
101
+ # MB in size.
102
+ #
103
+ # If the NumberOfLines parameter is specified, then the block of lines
104
+ # returned can be from the beginning or the end of the log file,
105
+ # depending on the value of the Marker parameter.
106
+ #
107
+ # * If neither Marker or NumberOfLines are specified, the entire log
108
+ # file is returned up to a maximum of 10000 lines, starting with the
109
+ # most recent log entries first.
110
+ #
111
+ # * If NumberOfLines is specified and Marker is not specified, then the
112
+ # most recent lines from the end of the log file are returned.
113
+ #
114
+ # * If Marker is specified as "0", then the specified number of lines
115
+ # from the beginning of the log file are returned.
116
+ #
117
+ # * You can download the log file in blocks of lines by specifying the
118
+ # size of the block using the NumberOfLines parameter, and by
119
+ # specifying a value of "0" for the Marker parameter in your first
120
+ # request. Include the Marker value returned in the response as the
121
+ # Marker value for the next request, continuing until the
122
+ # AdditionalDataPending response element returns false.
123
+ # @return [Types::DownloadDBLogFilePortionDetails]
124
+ def download(options = {})
125
+ options = options.merge(
126
+ db_instance_identifier: @instance_id,
127
+ log_file_name: @name
128
+ )
129
+ resp = @client.download_db_log_file_portion(options)
130
+ resp.data
131
+ end
132
+
133
+ # @deprecated
134
+ # @api private
135
+ def identifiers
136
+ {
137
+ instance_id: @instance_id,
138
+ name: @name
139
+ }
140
+ end
141
+ deprecated(:identifiers)
142
+
143
+ private
144
+
145
+ def extract_instance_id(args, options)
146
+ value = args[0] || options.delete(:instance_id)
147
+ case value
148
+ when String then value
149
+ when nil then raise ArgumentError, "missing required option :instance_id"
150
+ else
151
+ msg = "expected :instance_id to be a String, got #{value.class}"
152
+ raise ArgumentError, msg
153
+ end
154
+ end
155
+
156
+ def extract_name(args, options)
157
+ value = args[1] || options.delete(:name)
158
+ case value
159
+ when String then value
160
+ when nil then raise ArgumentError, "missing required option :name"
161
+ else
162
+ msg = "expected :name to be a String, got #{value.class}"
163
+ raise ArgumentError, msg
164
+ end
165
+ end
166
+
167
+ class Collection < Aws::Resources::Collection; end
168
+ end
169
+ end
170
+ end
@@ -0,0 +1,455 @@
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 DBParameterGroup
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_parameter_group_name :name
34
+
35
+ # Provides the name of the DB parameter group family that this DB
36
+ # 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 parameter
43
+ # group.
44
+ # @return [String]
45
+ def description
46
+ data.description
47
+ end
48
+
49
+ # The Amazon Resource Name (ARN) for the DB parameter group.
50
+ # @return [String]
51
+ def db_parameter_group_arn
52
+ data.db_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 {DBParameterGroup}.
63
+ # Returns `self` making it possible to chain methods.
64
+ #
65
+ # db_parameter_group.reload.data
66
+ #
67
+ # @return [self]
68
+ def load
69
+ resp = @client.describe_db_parameter_groups(db_parameter_group_name: @name)
70
+ @data = resp.dbparametergroups[0]
71
+ self
72
+ end
73
+ alias :reload :load
74
+
75
+ # @return [Types::DBParameterGroup]
76
+ # Returns the data for this {DBParameterGroup}. Calls
77
+ # {Client#describe_db_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
+ # dbparametergroup = db_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 parameter group family name. A DB parameter group can be
107
+ # associated with one and only one DB parameter group family, and can be
108
+ # applied only to a DB instance running a database engine and engine
109
+ # version compatible with that DB parameter group family.
110
+ # @option options [required, String] :description
111
+ # The description for the DB parameter group.
112
+ # @option options [Array<Types::Tag>] :tags
113
+ # A list of tags.
114
+ # @return [DBParameterGroup]
115
+ def create(options = {})
116
+ options = options.merge(db_parameter_group_name: @name)
117
+ resp = @client.create_db_parameter_group(options)
118
+ DBParameterGroup.new(
119
+ name: resp.data.db_parameter_group.db_parameter_group_name,
120
+ data: resp.data.db_parameter_group,
121
+ client: @client
122
+ )
123
+ end
124
+
125
+ # @example Request syntax with placeholder values
126
+ #
127
+ # dbparametergroup = db_parameter_group.copy({
128
+ # target_db_parameter_group_identifier: "String", # required
129
+ # target_db_parameter_group_description: "String", # required
130
+ # tags: [
131
+ # {
132
+ # key: "String",
133
+ # value: "String",
134
+ # },
135
+ # ],
136
+ # })
137
+ # @param [Hash] options ({})
138
+ # @option options [required, String] :target_db_parameter_group_identifier
139
+ # The identifier for the copied DB parameter group.
140
+ #
141
+ # Constraints:
142
+ #
143
+ # * Cannot be null, empty, or blank
144
+ #
145
+ # * Must contain from 1 to 255 alphanumeric characters or hyphens
146
+ #
147
+ # * First character must be a letter
148
+ #
149
+ # * Cannot end with a hyphen or contain two consecutive hyphens
150
+ #
151
+ # Example: `my-db-parameter-group`
152
+ # @option options [required, String] :target_db_parameter_group_description
153
+ # A description for the copied DB parameter group.
154
+ # @option options [Array<Types::Tag>] :tags
155
+ # A list of tags.
156
+ # @return [DBParameterGroup]
157
+ def copy(options = {})
158
+ options = options.merge(source_db_parameter_group_identifier: @name)
159
+ resp = @client.copy_db_parameter_group(options)
160
+ DBParameterGroup.new(
161
+ name: resp.data.db_parameter_group.db_parameter_group_name,
162
+ data: resp.data.db_parameter_group,
163
+ client: @client
164
+ )
165
+ end
166
+
167
+ # @example Request syntax with placeholder values
168
+ #
169
+ # db_parameter_group.delete()
170
+ # @param [Hash] options ({})
171
+ # @return [EmptyStructure]
172
+ def delete(options = {})
173
+ options = options.merge(db_parameter_group_name: @name)
174
+ resp = @client.delete_db_parameter_group(options)
175
+ resp.data
176
+ end
177
+
178
+ # @example Request syntax with placeholder values
179
+ #
180
+ # dbparametergroup = db_parameter_group.modify({
181
+ # parameters: [ # required
182
+ # {
183
+ # parameter_name: "String",
184
+ # parameter_value: "String",
185
+ # description: "String",
186
+ # source: "String",
187
+ # apply_type: "String",
188
+ # data_type: "String",
189
+ # allowed_values: "String",
190
+ # is_modifiable: false,
191
+ # minimum_engine_version: "String",
192
+ # apply_method: "immediate", # accepts immediate, pending-reboot
193
+ # },
194
+ # ],
195
+ # })
196
+ # @param [Hash] options ({})
197
+ # @option options [required, Array<Types::Parameter>] :parameters
198
+ # An array of parameter names, values, and the apply method for the
199
+ # parameter update. At least one parameter name, value, and apply method
200
+ # must be supplied; subsequent arguments are optional. A maximum of 20
201
+ # parameters can be modified in a single request.
202
+ #
203
+ # Valid Values (for the application method): `immediate |
204
+ # pending-reboot`
205
+ #
206
+ # <note markdown="1"> You can use the immediate value with dynamic parameters only. You can
207
+ # use the pending-reboot value for both dynamic and static parameters,
208
+ # and changes are applied when you reboot the DB instance without
209
+ # failover.
210
+ #
211
+ # </note>
212
+ # @return [DBParameterGroup]
213
+ def modify(options = {})
214
+ options = options.merge(db_parameter_group_name: @name)
215
+ resp = @client.modify_db_parameter_group(options)
216
+ DBParameterGroup.new(
217
+ name: resp.data.db_parameter_group_name,
218
+ client: @client
219
+ )
220
+ end
221
+
222
+ # @example Request syntax with placeholder values
223
+ #
224
+ # dbparametergroup = db_parameter_group.reset({
225
+ # reset_all_parameters: false,
226
+ # parameters: [
227
+ # {
228
+ # parameter_name: "String",
229
+ # parameter_value: "String",
230
+ # description: "String",
231
+ # source: "String",
232
+ # apply_type: "String",
233
+ # data_type: "String",
234
+ # allowed_values: "String",
235
+ # is_modifiable: false,
236
+ # minimum_engine_version: "String",
237
+ # apply_method: "immediate", # accepts immediate, pending-reboot
238
+ # },
239
+ # ],
240
+ # })
241
+ # @param [Hash] options ({})
242
+ # @option options [Boolean] :reset_all_parameters
243
+ # Specifies whether (`true`) or not (`false`) to reset all parameters in
244
+ # the DB parameter group to default values.
245
+ #
246
+ # Default: `true`
247
+ # @option options [Array<Types::Parameter>] :parameters
248
+ # An array of parameter names, values, and the apply method for the
249
+ # parameter update. At least one parameter name, value, and apply method
250
+ # must be supplied; subsequent arguments are optional. A maximum of 20
251
+ # parameters can be modified in a single request.
252
+ #
253
+ # **MySQL**
254
+ #
255
+ # Valid Values (for Apply method): `immediate` \| `pending-reboot`
256
+ #
257
+ # You can use the immediate value with dynamic parameters only. You can
258
+ # use the `pending-reboot` value for both dynamic and static parameters,
259
+ # and changes are applied when DB instance reboots.
260
+ #
261
+ # **MariaDB**
262
+ #
263
+ # Valid Values (for Apply method): `immediate` \| `pending-reboot`
264
+ #
265
+ # You can use the immediate value with dynamic parameters only. You can
266
+ # use the `pending-reboot` value for both dynamic and static parameters,
267
+ # and changes are applied when DB instance reboots.
268
+ #
269
+ # **Oracle**
270
+ #
271
+ # Valid Values (for Apply method): `pending-reboot`
272
+ # @return [DBParameterGroup]
273
+ def reset(options = {})
274
+ options = options.merge(db_parameter_group_name: @name)
275
+ resp = @client.reset_db_parameter_group(options)
276
+ DBParameterGroup.new(
277
+ name: resp.data.db_parameter_group_name,
278
+ client: @client
279
+ )
280
+ end
281
+
282
+ # @example Request syntax with placeholder values
283
+ #
284
+ # eventsubscription = db_parameter_group.subscribe_to({
285
+ # subscription_name: "String", # required
286
+ # })
287
+ # @param [Hash] options ({})
288
+ # @option options [required, String] :subscription_name
289
+ # The name of the RDS event notification subscription you want to add a
290
+ # source identifier to.
291
+ # @return [EventSubscription]
292
+ def subscribe_to(options = {})
293
+ options = options.merge(source_identifier: @name)
294
+ resp = @client.add_source_identifier_to_subscription(options)
295
+ EventSubscription.new(
296
+ name: resp.data.event_subscription.cust_subscription_id,
297
+ data: resp.data.event_subscription,
298
+ client: @client
299
+ )
300
+ end
301
+
302
+ # @example Request syntax with placeholder values
303
+ #
304
+ # eventsubscription = db_parameter_group.unsubscribe_from({
305
+ # subscription_name: "String", # required
306
+ # })
307
+ # @param [Hash] options ({})
308
+ # @option options [required, String] :subscription_name
309
+ # The name of the RDS event notification subscription you want to remove
310
+ # a source identifier from.
311
+ # @return [EventSubscription]
312
+ def unsubscribe_from(options = {})
313
+ options = options.merge(source_identifier: @name)
314
+ resp = @client.remove_source_identifier_from_subscription(options)
315
+ EventSubscription.new(
316
+ name: resp.data.event_subscription.cust_subscription_id,
317
+ data: resp.data.event_subscription,
318
+ client: @client
319
+ )
320
+ end
321
+
322
+ # @!group Associations
323
+
324
+ # @example Request syntax with placeholder values
325
+ #
326
+ # events = db_parameter_group.events({
327
+ # start_time: Time.now,
328
+ # end_time: Time.now,
329
+ # duration: 1,
330
+ # event_categories: ["String"],
331
+ # filters: [
332
+ # {
333
+ # name: "String", # required
334
+ # values: ["String"], # required
335
+ # },
336
+ # ],
337
+ # })
338
+ # @param [Hash] options ({})
339
+ # @option options [Time,DateTime,Date,Integer,String] :start_time
340
+ # The beginning of the time interval to retrieve events for, specified
341
+ # in ISO 8601 format. For more information about ISO 8601, go to the
342
+ # [ISO8601 Wikipedia page.][1]
343
+ #
344
+ # Example: 2009-07-08T18:00Z
345
+ #
346
+ #
347
+ #
348
+ # [1]: http://en.wikipedia.org/wiki/ISO_8601
349
+ # @option options [Time,DateTime,Date,Integer,String] :end_time
350
+ # The end of the time interval for which to retrieve events, specified
351
+ # in ISO 8601 format. For more information about ISO 8601, go to the
352
+ # [ISO8601 Wikipedia page.][1]
353
+ #
354
+ # Example: 2009-07-08T18:00Z
355
+ #
356
+ #
357
+ #
358
+ # [1]: http://en.wikipedia.org/wiki/ISO_8601
359
+ # @option options [Integer] :duration
360
+ # The number of minutes to retrieve events for.
361
+ #
362
+ # Default: 60
363
+ # @option options [Array<String>] :event_categories
364
+ # A list of event categories that trigger notifications for a event
365
+ # notification subscription.
366
+ # @option options [Array<Types::Filter>] :filters
367
+ # This parameter is not currently supported.
368
+ # @return [Event::Collection]
369
+ def events(options = {})
370
+ batches = Enumerator.new do |y|
371
+ options = options.merge(
372
+ source_type: "db-parameter-group",
373
+ source_identifier: @name
374
+ )
375
+ resp = @client.describe_events(options)
376
+ resp.each_page do |page|
377
+ batch = []
378
+ page.data.events.each do |e|
379
+ batch << Event.new(
380
+ source_id: e.source_identifier,
381
+ date: e.date,
382
+ data: e,
383
+ client: @client
384
+ )
385
+ end
386
+ y.yield(batch)
387
+ end
388
+ end
389
+ Event::Collection.new(batches)
390
+ end
391
+
392
+ # @example Request syntax with placeholder values
393
+ #
394
+ # parameters = db_parameter_group.parameters({
395
+ # source: "String",
396
+ # filters: [
397
+ # {
398
+ # name: "String", # required
399
+ # values: ["String"], # required
400
+ # },
401
+ # ],
402
+ # })
403
+ # @param [Hash] options ({})
404
+ # @option options [String] :source
405
+ # The parameter types to return.
406
+ #
407
+ # Default: All parameter types returned
408
+ #
409
+ # Valid Values: `user | system | engine-default`
410
+ # @option options [Array<Types::Filter>] :filters
411
+ # This parameter is not currently supported.
412
+ # @return [Parameter::Collection]
413
+ def parameters(options = {})
414
+ batches = Enumerator.new do |y|
415
+ options = options.merge(db_parameter_group_name: @name)
416
+ resp = @client.describe_db_parameters(options)
417
+ resp.each_page do |page|
418
+ batch = []
419
+ page.data.parameters.each do |p|
420
+ batch << Parameter.new(
421
+ name: p.parameter_name,
422
+ data: p,
423
+ client: @client
424
+ )
425
+ end
426
+ y.yield(batch)
427
+ end
428
+ end
429
+ Parameter::Collection.new(batches)
430
+ end
431
+
432
+ # @deprecated
433
+ # @api private
434
+ def identifiers
435
+ { name: @name }
436
+ end
437
+ deprecated(:identifiers)
438
+
439
+ private
440
+
441
+ def extract_name(args, options)
442
+ value = args[0] || options.delete(:name)
443
+ case value
444
+ when String then value
445
+ when nil then raise ArgumentError, "missing required option :name"
446
+ else
447
+ msg = "expected :name to be a String, got #{value.class}"
448
+ raise ArgumentError, msg
449
+ end
450
+ end
451
+
452
+ class Collection < Aws::Resources::Collection; end
453
+ end
454
+ end
455
+ end