lib/rds/right_rds_interface.rb
# Create a new RDS instance from a DBSnapshot. The source DBSnapshot must be
# in the "Available" state. The new RDS instance is created with the Default security group.
#
# Optional params: +:instance_class+, +:endpoint_port+, +:availability_zone+, +:multi_az+,
# +:auto_minor_version_upgrade+, +:license_model+, +:db_name+, +:engine+, +:db_subnet_group_name+,
# +:iops+, +:option_group_name+
#
#  rds.restore_db_instance_from_db_snapshot('ahahahaha-final-snapshot-20090828081159', 'q1') #=>
#    {:status=>"creating",
#     :pending_modified_values=>{},
#     :allocated_storage=>42,
#     :db_security_groups=>[],
#     :master_username=>"kd",
#     :availability_zone=>"us-east-1a",
#     :aws_id=>"q1",
#     :create_time=>"2009-08-29T18:07:01.510Z",
#     :instance_class=>"Medium",
#     :preferred_maintenance_window=>"Sun:05:00-Sun:09:00",
#     :engine=>"MySQL",
#     :engine_version=>"5.1.49"}
#
Create a new RDS instance from a DBSnapshot. The source DBSnapshot must be
in the "Available" state. The new RDS instance is created with the Default security group.




Create a new RDS instance from a DBSnapshot . The source DBSnapshot must be in the " Available " state . The new RDS instance is created with the Default security group .
def restore_db_instance_from_db_snapshot(snapshot_aws_id, instance_aws_id, params={})
      request_hash = { 'DBSnapshotIdentifier' => snapshot_aws_id,
                       'DBInstanceIdentifier' => instance_aws_id }
      request_hash['DBInstanceClass']         = params[:instance_class]             unless params[:instance_class].right_blank?
      request_hash['Port']                    = params[:endpoint_port]              unless params[:endpoint_port].right_blank?
      request_hash['AvailabilityZone']        = params[:availability_zone]          unless params[:availability_zone].right_blank?
      request_hash['MultiAZ']                 = params[:multi_az]                   unless params[:multi_az].nil?
      request_hash['AutoMinorVersionUpgrade'] = params[:auto_minor_version_upgrade] unless params[:auto_minor_version_upgrade].nil?
      request_hash['LicenseModel']            = params[:license_model]              unless params[:license_model].right_blank?
      request_hash['DBName']                  = params[:db_name]                    unless params[:db_name].right_blank?
      request_hash['Engine']                  = params[:engine]                     unless params[:enginel].right_blank?
      request_hash['DBSubnetGroupName']       = params[:db_subnet_group_name]       unless params[:db_subnet_group_name].right_blank?
      request_hash['Iops']                    = params[:iops]                       unless params[:iops].right_blank?
      request_hash['OptionGroupName']         = params[:option_group_name]          unless params[:option_group_name].right_blank?
      link = generate_request('RestoreDBInstanceFromDBSnapshot', request_hash)
      request_info(link, DescribeDbInstancesParser.new(:logger => @logger))[:db_instances].first
    end
def restore_db_instance_from_db_snapshot ( snapshot_aws_id , instance_aws_id , params = { } ) request_hash = { 'DBSnapshotIdentifier' => snapshot_aws_id , 'DBInstanceIdentifier' => instance_aws_id } request_hash [ 'DBInstanceClass' ] = params [ :instance_class ] unless params [ :instance_class ] . right_blank? request_hash [ 'Port' ] = params [ :endpoint_port ] unless params [ :endpoint_port ] . right_blank? request_hash [ 'AvailabilityZone' ] = params [ :availability_zone ] unless params [ :availability_zone ] . right_blank? request_hash [ 'MultiAZ' ] = params [ :multi_az ] unless params [ :multi_az ] . nil? request_hash [ 'AutoMinorVersionUpgrade' ] = params [ :auto_minor_version_upgrade ] unless params [ :auto_minor_version_upgrade ] . nil? request_hash [ 'LicenseModel' ] = params [ :license_model ] unless params [ :license_model ] . right_blank? request_hash [ 'DBName' ] = params [ :db_name ] unless params [ :db_name ] . right_blank? request_hash [ 'Engine' ] = params [ :engine ] unless params [ :enginel ] . right_blank? request_hash [ 'DBSubnetGroupName' ] = params [ :db_subnet_group_name ] unless params [ :db_subnet_group_name ] . right_blank? request_hash [ 'Iops' ] = params [ :iops ] unless params [ :iops ] . right_blank? request_hash [ 'OptionGroupName' ] = params [ :option_group_name ] unless params [ :option_group_name ] . right_blank? link = generate_request ( 'RestoreDBInstanceFromDBSnapshot' , request_hash ) request_info ( link , DescribeDbInstancesParser . new ( :logger => @logger ) ) [ :db_instances ] . first end
Create a new RDS instance from a DBSnapshot.
Create a new RDS instance from a DBSnapshot .
snapshot_aws_id
<not_specific>
instance_aws_id
<not_specific>
params
<not_specific>