Class: AWS::RDS::Base
Instance Attribute Summary
Attributes inherited from Base
#port, #proxy_server, #server, #use_ssl
Instance Method Summary collapse
- #api_version ⇒ Object
-
#authorize_db_security_group(options = {}) ⇒ Object
This API method authorizes network ingress for an amazon ec2 group.
-
#aws_error?(response) ⇒ Boolean
Raises the appropriate error if the specified Net::HTTPResponse object contains an Amazon EC2 error; returns
false
otherwise. -
#create_db_instance(options = {}) ⇒ Object
This API creates a new DB instance.
-
#create_db_parameter_group(options = {}) ⇒ Object
This API method creates a db parameter group.
-
#create_db_security_group(options = {}) ⇒ Object
This API method creates a db security group.
-
#create_db_snapshot(options = {}) ⇒ Object
This API method creates a restoreable db snapshot.
- #default_host ⇒ Object
-
#delete_db_instance(options = {}) ⇒ Object
This API method deletes a db instance identifier.
-
#delete_db_parameter_group(options = {}) ⇒ Object
This API method deletes a db paramter group.
-
#delete_db_security_group(options = {}) ⇒ Object
This API method deletes a db security group.
-
#delete_db_snapshot(options = {}) ⇒ Object
This API method deletes a db snapshot.
-
#describe_db_instances(options = {}) ⇒ Object
This API method describes the db instances.
-
#describe_db_parameter_groups(options = {}) ⇒ Object
This API method returns information about all DB Parameter Groups for an account if no DB Parameter Group name is supplied, or displays information about a specific named DB Parameter Group.
-
#describe_db_parameters(options = {}) ⇒ Object
This API method returns information about parameters that are part of a parameter group.
-
#describe_db_security_groups(options = {}) ⇒ Object
This API method returns all the DB Security Group details for a particular AWS account, or for a particular DB Security Group if a name is specified.
-
#describe_db_snapshots(options = {}) ⇒ Object
This API method returns information about the DB Snapshots for this account.
-
#describe_engine_default_parameters(options = {}) ⇒ Object
This API method describes the default engine parameters.
-
#describe_events(options = {}) ⇒ Object
This API method Returns information about events related to your DB Instances, DB Security Groups, and DB Parameter Groups for up to the past 14 days.
-
#modify_db_instance(options = {}) ⇒ Object
This API changes the settings of an existing DB Instance.
-
#modify_db_parameter_group(options = {}) ⇒ Object
This API method modifies the parameters of a DB Parameter Group.
-
#reboot_db_instance(options = {}) ⇒ Object
This API method reboots a DB Instance.
-
#reset_db_parameter_group(options = {}) ⇒ Object
This API method modifies the parameters of a DB Parameter Group.
-
#restore_db_instance_from_snapshot(options = {}) ⇒ Object
This API method restores a db instance to a snapshot of the instance.
-
#restore_db_instance_to_point_in_time(options = {}) ⇒ Object
This API method restores a DB Instance to a specified time, creating a new DB Instance.
-
#revoke_db_security_group(options = {}) ⇒ Object
This API method authorizes network ingress for an amazon ec2 group.
Methods inherited from Base
#extract_user_data, #initialize
Constructor Details
This class inherits a constructor from AWS::Base
Instance Method Details
#api_version ⇒ Object
20 21 22 |
# File 'lib/AWS/RDS.rb', line 20 def api_version API_VERSION end |
#authorize_db_security_group(options = {}) ⇒ Object
This API method authorizes network ingress for an amazon ec2 group
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/AWS/RDS/rds.rb', line 131 def ( = {} ) raise ArgumentError, "No :db_security_group_name provided" if .does_not_have?(:db_security_group_name) params = {} params['DBSecurityGroupName'] = [:db_security_group_name] if .has?(:cidrip) params['CIDRIP'] = [:cidrip] elsif .has?(:ec2_security_group_name) && .has?(:ec2_security_group_owner_id) params['EC2SecurityGroupName'] = [:ec2_security_group_name] params['EC2SecurityGroupOwnerId'] = [:ec2_security_group_owner_id] else raise ArgumentError, "No :cidrip or :ec2_security_group_name and :ec2_security_group_owner_id provided" end return response_generator(:action => "AuthorizeDBSecurityGroupIngress", :params => params) end |
#aws_error?(response) ⇒ Boolean
Raises the appropriate error if the specified Net::HTTPResponse object contains an Amazon EC2 error; returns false
otherwise.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/AWS/RDS.rb', line 30 def aws_error?(response) # return false if we got a HTTP 200 code, # otherwise there is some type of error (40x,50x) and # we should try to raise an appropriate exception # from one of our exception classes defined in # exceptions.rb return false if response.is_a?(Net::HTTPSuccess) # parse the XML document so we can walk through it doc = REXML::Document.new(response.body) # Check that the Error element is in the place we would expect. # and if not raise a generic error exception unless doc.root.elements[1].name == "Error" raise Error, "Unexpected error format. response.body is: #{response.body}" end # An valid error response looks like this: # <?xml version="1.0"?><Response><Errors><Error><Code>InvalidParameterCombination</Code><Message>Unknown parameter: foo</Message></Error></Errors><RequestID>291cef62-3e86-414b-900e-17246eccfae8</RequestID></Response> # AWS EC2 throws some exception codes that look like Error.SubError. Since we can't name classes this way # we need to strip out the '.' in the error 'Code' and we name the error exceptions with this # non '.' name as well. error_code = doc.root.elements['//ErrorResponse/Error/Code'].text.gsub('.', '') = doc.root.elements['//ErrorResponse/Error/Message'].text # Raise one of our specific error classes if it exists. # otherwise, throw a generic EC2 Error with a few details. if AWS.const_defined?(error_code) raise AWS.const_get(error_code), else raise AWS::Error, end end |
#create_db_instance(options = {}) ⇒ Object
This API creates a new DB instance. Once the call has completed successfully, a new DB instance will be created, but it will not be
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/AWS/RDS/rds.rb', line 23 def create_db_instance( = {}) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier) raise ArgumentError, "No :allocated_storage provided" if .does_not_have?(:allocated_storage) raise ArgumentError, "No :db_instance_class provided" if .does_not_have?(:db_instance_class) raise ArgumentError, "No :engine provided" if .does_not_have?(:engine) raise ArgumentError, "No :master_username provided" if .does_not_have?(:master_username) raise ArgumentError, "No :master_user_password provided" if .does_not_have?(:master_user_password) raise ArgumentError, "No :db_instance_class provided" if .does_not_have?(:db_instance_class) # handle a former argument that was misspelled raise ArgumentError, "Perhaps you meant :backup_retention_period" if .has?(:backend_retention_period) params = {} params['DBInstanceIdentifier'] = [:db_instance_identifier] params["AllocatedStorage"] = [:allocated_storage].to_s params["DBInstanceClass"] = [:db_instance_class] params["Engine"] = [:engine] params["MasterUsername"] = [:master_username] params["MasterUserPassword"] = [:master_user_password] params["Port"] = [:port].to_s if .has?(:port) params["DBName"] = [:db_name] if .has?(:db_name) params["DBParameterGroup"] = [:db_parameter_group] if .has?(:db_parameter_group) params.merge!(pathlist("DBSecurityGroups.member", [[:db_security_groups]].flatten)) if .has_key?(:db_security_groups) params["AvailabilityZone"] = [:availability_zone] if .has?(:availability_zone) params["PreferredMaintenanceWindow"] = [:preferred_maintenance_window] if .has?(:preferred_maintenance_window) params["BackupRetentionPeriod"] = [:backup_retention_period].to_s if .has?(:backup_retention_period) params["PreferredBackupWindow"] = [:preferred_backup_window] if .has?(:preferred_backup_window) return response_generator(:action => "CreateDBInstance", :params => params) end |
#create_db_parameter_group(options = {}) ⇒ Object
This API method creates a db parameter group
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/AWS/RDS/rds.rb', line 79 def create_db_parameter_group( = {} ) raise ArgumentError, "No :db_parameter_group_name provided" if .does_not_have?(:db_parameter_group_name) raise ArgumentError, "No :engine provided" if .does_not_have?(:engine) raise ArgumentError, "No :description provided" if .does_not_have?(:description) params = {} params['DBParameterGroupName'] = [:db_parameter_group_name] params['Engine'] = [:engine] params['Description'] = [:description] return response_generator(:action => "CreateDBParameterGroup", :params => params) end |
#create_db_security_group(options = {}) ⇒ Object
This API method creates a db security group
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/AWS/RDS/rds.rb', line 97 def create_db_security_group( = {} ) raise ArgumentError, "No :db_security_group_name provided" if .does_not_have?(:db_security_group_name) raise ArgumentError, "No :db_security_group_description provided" if .does_not_have?(:db_security_group_description) params = {} params['DBSecurityGroupName'] = [:db_security_group_name] params['DBSecurityGroupDescription'] = [:db_security_group_description] return response_generator(:action => "CreateDBSecurityGroup", :params => params) end |
#create_db_snapshot(options = {}) ⇒ Object
This API method creates a restoreable db snapshot
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/AWS/RDS/rds.rb', line 113 def create_db_snapshot( = {} ) raise ArgumentError, "No :db_snapshot_identifier provided" if .does_not_have?(:db_snapshot_identifier) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier) params = {} params['DBSnapshotIdentifier'] = [:db_snapshot_identifier] params['DBInstanceIdentifier'] = [:db_instance_identifier] return response_generator(:action => "CreateDBSnapshot", :params => params) end |
#default_host ⇒ Object
24 25 26 |
# File 'lib/AWS/RDS.rb', line 24 def default_host DEFAULT_HOST end |
#delete_db_instance(options = {}) ⇒ Object
This API method deletes a db instance identifier
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/AWS/RDS/rds.rb', line 61 def delete_db_instance( = {} ) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier) params = {} params['DBInstanceIdentifier'] = [:db_instance_identifier] params["SkipFinalSnapshot"] = [:skip_final_snapshot].to_s if .has?(:skip_final_snapshot) params["FinalDBSnapshotIdentifier"] = [:final_db_snapshot_identifier].to_s if .has?(:final_db_snapshot_identifier) return response_generator(:action => "DeleteDBInstance", :params => params) end |
#delete_db_parameter_group(options = {}) ⇒ Object
This API method deletes a db paramter group
153 154 155 156 157 158 159 160 |
# File 'lib/AWS/RDS/rds.rb', line 153 def delete_db_parameter_group( = {} ) raise ArgumentError, "No :db_parameter_group_name provided" if .does_not_have?(:db_parameter_group_name) params = {} params['DBParameterGroupName'] = [:db_parameter_group_name] return response_generator(:action => "DeleteDBParameterGroup", :params => params) end |
#delete_db_security_group(options = {}) ⇒ Object
This API method deletes a db security group
166 167 168 169 170 171 172 173 |
# File 'lib/AWS/RDS/rds.rb', line 166 def delete_db_security_group( = {} ) raise ArgumentError, "No :db_security_group_name provided" if .does_not_have?(:db_security_group_name) params = {} params['DBSecurityGroupName'] = [:db_security_group_name] return response_generator(:action => "DeleteDBSecurityGroup", :params => params) end |
#delete_db_snapshot(options = {}) ⇒ Object
This API method deletes a db snapshot
179 180 181 182 183 184 185 186 |
# File 'lib/AWS/RDS/rds.rb', line 179 def delete_db_snapshot( = {} ) raise ArgumentError, "No :db_snapshot_identifier provided" if .does_not_have?(:db_snapshot_identifier) params = {} params['DBSnapshotIdentifier'] = [:db_snapshot_identifier] return response_generator(:action => "DeleteDBSnapshot", :params => params) end |
#describe_db_instances(options = {}) ⇒ Object
This API method describes the db instances
194 195 196 197 198 199 200 201 |
# File 'lib/AWS/RDS/rds.rb', line 194 def describe_db_instances( = {} ) params = {} params['DBInstanceIdentifier'] = [:db_instance_identifier] if .has?(:db_instance_identifier) params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeDBInstances", :params => params) end |
#describe_db_parameter_groups(options = {}) ⇒ Object
This API method returns information about all DB Parameter Groups for an account if no DB Parameter Group name is supplied, or displays information about a specific named DB Parameter Group. You can call this operation recursively using the Marker parameter.
228 229 230 231 232 233 234 235 |
# File 'lib/AWS/RDS/rds.rb', line 228 def describe_db_parameter_groups( = {} ) params = {} params['DBParameterGroupName'] = [:db_parameter_group_name] if .has?(:db_parameter_group_name) params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeDBParameterGroups", :params => params) end |
#describe_db_parameters(options = {}) ⇒ Object
This API method returns information about parameters that are part of a parameter group. You can optionally request only parameters from a specific source. You can call this operation recursively using the Marker parameter.
246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/AWS/RDS/rds.rb', line 246 def describe_db_parameters( = {} ) raise ArgumentError, "No :db_parameter_group_name provided" if .does_not_have?(:db_parameter_group_name) params = {} params['DBParameterGroupName'] = [:db_parameter_group_name] params['Source'] = [:source] if .has?(:source) params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeDBParameters", :params => params) end |
#describe_db_security_groups(options = {}) ⇒ Object
This API method returns all the DB Security Group details for a particular AWS account, or for a particular DB Security Group if a name is specified. You can call this operation recursively using the Marker parameter.
266 267 268 269 270 271 272 273 |
# File 'lib/AWS/RDS/rds.rb', line 266 def describe_db_security_groups( = {} ) params = {} params['DBSecurityGroupName'] = [:db_security_group_name] if .has?(:db_security_group_name) params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeDBSecurityGroups", :params => params) end |
#describe_db_snapshots(options = {}) ⇒ Object
This API method returns information about the DB Snapshots for this account. If you pass in a DBInstanceIdentifier, it returns information only about DB Snapshots taken for that DB Instance. If you pass in a DBSnapshotIdentifier,it will return information only about the specified snapshot. If you omit both DBInstanceIdentifier and DBSnapshotIdentifier, it returns all snapshot information for all database instances, up to the maximum number of records specified. Passing both DBInstanceIdentifier and DBSnapshotIdentifier results in an error.
287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/AWS/RDS/rds.rb', line 287 def describe_db_snapshots( = {} ) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier) params = {} params['DBInstanceIdentifier'] = [:db_instance_identifier] params['DBSnapshotIdentifier'] = [:db_snapshot_identifier] if .has?(:db_snapshot_identifier) params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeDBSnapshots", :params => params) end |
#describe_engine_default_parameters(options = {}) ⇒ Object
This API method describes the default engine parameters
209 210 211 212 213 214 215 216 217 218 |
# File 'lib/AWS/RDS/rds.rb', line 209 def describe_engine_default_parameters( = {} ) raise ArgumentError, "No :engine provided" if .does_not_have?(:engine) params = {} params['Engine'] = [:engine] params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeEngineDefaultParameters", :params => params) end |
#describe_events(options = {}) ⇒ Object
This API method Returns information about events related to your DB Instances, DB Security Groups, and DB Parameter Groups for up to the past 14 days. You can get events specific to a particular DB Instance or DB Security Group by providing the name as a parameter. By default, the past hour of events are returned.
If neither DBInstanceIdentifier or DBSecurityGroupName are provided, all events are be retrieved for DB Instances and DB Security Groups.
316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/AWS/RDS/rds.rb', line 316 def describe_events( = {} ) params = {} params['SourceIdentifier'] = [:source_identifier] if .has?(:source_identifier) params['SourceType'] = [:source_type] if .has?(:source_type) params['StartTime'] = [:start_time] if .has?(:start_time) params['EndTime'] = [:end_time] if .has?(:end_time) params['Duration'] = [:duration] if .has?(:duration) params['MaxRecords'] = [:max_records].to_s if .has?(:max_records) params['Marker'] = [:marker] if .has?(:marker) return response_generator(:action => "DescribeEvents", :params => params) end |
#modify_db_instance(options = {}) ⇒ Object
This API changes the settings of an existing DB Instance.
Changes are applied in the following manner: A ModifyDBInstance API call to modify security groups or to change the maintenance windows results in immediate action. Modification of the DB Parameter Group applies immediate parameters as soon as possible and pending-reboot parameters only when the RDS instance is rebooted. A request to scale the DB Instance class results puts the database instance into the modifying state.
The DB Instance must be in available or modifying state for this API to accept changes.
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 |
# File 'lib/AWS/RDS/rds.rb', line 353 def modify_db_instance( = {}) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier) # handle a former argument that was misspelled raise ArgumentError, "Perhaps you meant :backup_retention_period" if .has?(:backend_retention_period) params = {} params['DBInstanceIdentifier'] = [:db_instance_identifier] params["AllocatedStorage"] = [:allocated_storage].to_s if .has?(:allocated_storage) params["DBInstanceClass"] = [:db_instance_class] if .has?(:db_instance_class) params["Engine"] = [:engine] if .has?(:engine) params["MasterUsername"] = [:master_username] if .has?(:master_username) params["MasterUserPassword"] = [:master_user_password] if .has?(:master_user_password) params["Port"] = [:port].to_s if .has?(:port) params["DBName"] = [:db_name] if .has?(:db_name) params["DBParameterGroupName"] = [:db_parameter_group_name] if .has?(:db_parameter_group_name) params.merge!(pathlist("DBSecurityGroups.member", [[:db_security_groups]].flatten)) if .has_key?(:db_security_groups) params["AvailabilityZone"] = [:availability_zone] if .has?(:availability_zone) params["PreferredMaintenanceWindow"] = [:preferred_maintenance_window] if .has?(:preferred_maintenance_window) params["BackupRetentionPeriod"] = [:backup_retention_period].to_s if .has?(:backup_retention_period) params["PreferredBackupWindow"] = [:preferred_backup_window] if .has?(:preferred_backup_window) return response_generator(:action => "ModifyDBInstance", :params => params) end |
#modify_db_parameter_group(options = {}) ⇒ Object
This API method modifies the parameters of a DB Parameter Group. To modify more than one parameter, submit a list of the following: ParameterName, ParameterValue, and ApplyMethod. You can modify a maximum of 20 parameters in a single request.
387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/AWS/RDS/rds.rb', line 387 def modify_db_parameter_group( = {} ) raise ArgumentError, "No :db_parameter_group_name provided" if .does_not_have?(:db_parameter_group_name) raise ArgumentError, "No :parameters provided" if .does_not_have?(:parameters) params = {} params['DBParameterGroupName'] = [:db_parameter_group_name] params.merge!(pathhashlist('Parameters.member', [[:parameters]].flatten, { :name => 'ParameterName', :value => 'ParameterValue', :apply_method => "ApplyMethod" })) return response_generator(:action => "ModifyDBParameterGroup", :params => params) end |
#reboot_db_instance(options = {}) ⇒ Object
This API method reboots a DB Instance. Once started, the process cannot be stopped, and the database instance will be unavailable until the reboot completes.
407 408 409 410 411 412 413 414 |
# File 'lib/AWS/RDS/rds.rb', line 407 def reboot_db_instance( = {} ) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier ) params = {} params['DBInstanceIdentifier'] = [:db_instance_identifier] if .has?(:db_instance_identifier) return response_generator(:action => "RebootDBInstance", :params => params) end |
#reset_db_parameter_group(options = {}) ⇒ Object
This API method modifies the parameters of a DB Parameter Group. To modify more than one parameter, submit a list of the following: ParameterName, ParameterValue, and ApplyMethod. You can modify a maximum of 20 parameters in a single request.
425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/AWS/RDS/rds.rb', line 425 def reset_db_parameter_group( = {} ) raise ArgumentError, "No :db_parameter_group_name provided" if .does_not_have?(:db_parameter_group_name) raise ArgumentError, "No :parameters provided" if .does_not_have?(:parameters) params = {} params['DBParameterGroupName'] = [:db_parameter_group_name] params.merge!(pathhashlist('Parameters.member', [[:parameters]].flatten, { :name => 'ParameterName', :apply_method => "ApplyMethod" })) params['ResetAllParameters'] = [:reset_all_parameters] if .has?(:reset_all_parameters) return response_generator(:action => "ResetDBParameterGroup", :params => params) end |
#restore_db_instance_from_snapshot(options = {}) ⇒ Object
This API method restores a db instance to a snapshot of the instance
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/AWS/RDS/rds.rb', line 448 def restore_db_instance_from_snapshot( = {} ) raise ArgumentError, "No :db_snapshot_identifier provided" if .does_not_have?(:db_snapshot_identifier) raise ArgumentError, "No :db_instance_identifier provided" if .does_not_have?(:db_instance_identifier) raise ArgumentError, "No :db_instance_class provided" if .does_not_have?(:db_instance_class) params = {} params['DBSnapshotIdentifier'] = [:db_snapshot_identifier] params['DBInstanceIdentifier'] = [:db_instance_identifier] params['DBInstanceClass'] = [:db_instance_class] params['Port'] = [:port].to_s if .has?(:port) params['AvailabilityZone'] = [:availability_zone] if .has?(:availability_zone) return response_generator(:action => "RestoreDBInstanceFromDBSnapshot", :params => params) end |
#restore_db_instance_to_point_in_time(options = {}) ⇒ Object
This API method restores a DB Instance to a specified time, creating a new DB Instance.
Some characteristics of the new DB Instance can be modified using optional parameters. If these options are omitted, the new DB Instance defaults to the characteristics of the DB Instance from which the DB Snapshot was created.
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/AWS/RDS/rds.rb', line 478 def restore_db_instance_to_point_in_time( = {} ) raise ArgumentError, "No :source_db_instance_identifier provided" if .does_not_have?(:source_db_instance_identifier) raise ArgumentError, "No :target_db_instance_identifier provided" if .does_not_have?(:target_db_instance_identifier) params = {} params['SourceDBInstanceIdentifier'] = [:source_db_instance_identifier] params['TargetDBInstanceIdentifier'] = [:target_db_instance_identifier] if .has?(:use_latest_restorable_time) && .has?(:restore_time) raise ArgumentError, "You cannot provide both :use_latest_restorable_time and :restore_time" elsif .has?(:use_latest_restorable_time) params['UseLatestRestorableTime'] = case [:use_latest_restorable_time] when 'true', 'false' [:use_latest_restorable_time] when true 'true' when false 'false' else raise ArgumentError, "Invalid value provided for :use_latest_restorable_time. Expected boolean." end elsif .has?(:restore_time) params['RestoreTime'] = [:restore_time] end params['DBInstanceClass'] = [:db_instance_class] if .has?(:db_instance_class) params['Port'] = [:port].to_s if .has?(:port) params['AvailabilityZone'] = [:availability_zone] if .has?(:availability_zone) return response_generator(:action => "RestoreDBInstanceToPointInTime", :params => params) end |
#revoke_db_security_group(options = {}) ⇒ Object
This API method authorizes network ingress for an amazon ec2 group
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 |
# File 'lib/AWS/RDS/rds.rb', line 517 def revoke_db_security_group( = {} ) raise ArgumentError, "No :db_security_group_name provided" if .does_not_have?(:db_security_group_name) params = {} params['DBSecurityGroupName'] = [:db_security_group_name] if .has?(:cidrip) params['CIDRIP'] = [:cidrip] elsif .has?(:ec2_security_group_name) && .has?(:ec2_security_group_owner_id) params['EC2SecurityGroupName'] = [:ec2_security_group_name] params['EC2SecurityGroupOwnerId'] = [:ec2_security_group_owner_id] else raise ArgumentError, "No :cidrip or :ec2_security_group_name and :ec2_security_group_owner_id provided" end return response_generator(:action => "RevokeDBSecurityGroupIngress", :params => params) end |