class AWS::RDS::DBSnapshot
@attr_reader [Integer] allocated_storage
@attr_reader [String] availability_zone_name
@attr_reader [String] db_instance_id
@attr_reader [String] engine
@attr_reader [String] engine_version
@attr_reader [String] license_model
@attr_reader [String] master_username
@attr_reader [String] port
@attr_reader [Integer] vpc_id
@attr_reader [String] snapshot_type
@attr_reader [String] status
@attr_reader [Time] created_at
@attr_reader [Time] instance_create_time
Attributes
@return [String]
@return [String]
@return [String]
Public Class Methods
@param [String] db_snapshot_id
@param [Hash] options
AWS::Core::Resource::new
# File lib/aws/rds/db_snapshot.rb, line 47 def initialize db_snapshot_id, options = {} @db_snapshot_identifier = db_snapshot_id super end
Public Instance Methods
Copies this database snapshot. @param [String] new_snapshot_id @return [DBSnapshot]
# File lib/aws/rds/db_snapshot.rb, line 108 def copy new_snapshot_id options = {} options[:source_db_snapshot_identifier] = id options[:target_db_snapshot_identifier] = new_snapshot_id resp = client.copy_db_snapshot(options) DBSnapshot.new_from(:copy_db_snapshot, resp, resp[:db_snapshot_identifier], :config => config) end
@return [DBInstance]
# File lib/aws/rds/db_snapshot.rb, line 101 def db_instance DBInstance.new(db_instance_id, :config => config) end
Deletes this database snapshot. @return [nil]
# File lib/aws/rds/db_snapshot.rb, line 122 def delete client.delete_db_snapshot(:db_snapshot_identifier => db_snapshot_identifier) nil end
@return [Boolean] Returns true
if the db snapshot exists.
# File lib/aws/rds/db_snapshot.rb, line 140 def exists? begin get_resource true rescue AWS::RDS::Errors::DBSnapshotNotFound false end end
Restores the database instance from this snapshot. You may optionally specify the db instance id if you wish to restore to a different db.
@param (see Client#restore_db_instance_from_db_snapshot) @option (see Client#restore_db_instance_from_db_snapshot)
# File lib/aws/rds/db_snapshot.rb, line 132 def restore_instance options = {} options[:db_snapshot_identifier] = db_snapshot_identifier options[:db_instance_identifier] ||= db_instance_id client.restore_db_instance_from_db_snapshot(options) nil end
Protected Instance Methods
# File lib/aws/rds/db_snapshot.rb, line 155 def get_resource attr = nil options = {} options[:db_snapshot_identifier] = db_snapshot_identifier client.describe_db_snapshots(options) end
# File lib/aws/rds/db_snapshot.rb, line 151 def resource_identifiers [[:db_snapshot_identifier, id]] end