class Fog::AWS::RDS::Server
Attributes
parameter_group_name[RW]
password[RW]
port[RW]
security_group_names[RW]
Public Instance Methods
attributes_to_params()
click to toggle source
Converts attributes to a parameter hash suitable for requests
# File lib/fog/aws/models/rds/server.rb, line 110 def attributes_to_params options = { 'AllocatedStorage' => allocated_storage, 'AutoMinorVersionUpgrade' => auto_minor_version_upgrade, 'BackupRetentionPeriod' => backup_retention_period, 'DBName' => db_name, 'DBParameterGroupName' => parameter_group_name || attributes['DBParameterGroupName'], 'DBSecurityGroups' => security_group_names, 'DBInstanceIdentifier' => id, 'AvailabilityZone' => availability_zone, 'DBInstanceClass' => flavor_id, 'Port' => port || attributes['Port'], 'Engine' => engine, 'EngineVersion' => engine_version, 'Iops' => iops, 'MasterUsername' => master_username, 'MasterUserPassword' => password || attributes['MasterUserPassword'], 'PreferredMaintenanceWindow' => preferred_maintenance_window, 'PreferredBackupWindow' => preferred_backup_window, 'MultiAZ' => multi_az, 'LicenseModel' => license_model, 'DBSubnetGroupName' => db_subnet_group_name, 'PubliclyAccessible' => publicly_accessible, 'VpcSecurityGroups' => vpc_security_groups, 'StorageType' => storage_type, } options.delete_if {|key, value| value.nil?} end
create_read_replica(replica_id, options={})
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 38 def create_read_replica(replica_id, options={}) options[:security_group_names] ||= options['DBSecurityGroups'] params = self.class.new(options).attributes_to_params service.create_db_instance_read_replica(replica_id, id, params) service.servers.get(replica_id) end
destroy(snapshot_identifier=nil)
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 49 def destroy(snapshot_identifier=nil) requires :id service.delete_db_instance(id, snapshot_identifier, snapshot_identifier.nil?) true end
modify(immediately, options)
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 88 def modify(immediately, options) options[:security_group_names] ||= options['DBSecurityGroups'] params = self.class.new(options).attributes_to_params data = service.modify_db_instance(id, immediately, params) merge_attributes(data.body['ModifyDBInstanceResult']['DBInstance']) true end
promote_read_replica()
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 83 def promote_read_replica requires :id service.promote_read_replica(id) end
ready?()
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 45 def ready? state == 'available' end
reboot()
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 55 def reboot service.reboot_db_instance(id) true end
save()
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 96 def save requires :engine requires :allocated_storage requires :master_username requires :password self.flavor_id ||= 'db.m1.small' data = service.create_db_instance(id, attributes_to_params) merge_attributes(data.body['CreateDBInstanceResult']['DBInstance']) true end
snapshots()
click to toggle source
# File lib/fog/aws/models/rds/server.rb, line 60 def snapshots requires :id service.snapshots(:server => self) end