# File lib/fog/serverlove/models/compute/server.rb, line 61 def self.defaults # TODO: Document default settings. # Note that VNC password standards are strict (need explaining) { 'nic:0:model' => 'e1000', 'nic:0:dhcp' => 'auto', 'smp' => 'auto', 'vnc' => 'auto', 'vnc:password' => Fog::Compute::Serverlove::PasswordGenerator.generate } end
# File lib/fog/serverlove/models/compute/server.rb, line 51 def allowed_attributes allowed = [ :name, :cpu, :smp, :mem, :persistent, :vnc_password, :vnc, :ide_0_0, :ide_0_1, :ide_1_0, :ide_1_1, :boot, :nic_0_model, :nic_0_dhcp ] attributes.select {|k,v| allowed.include? k} end
# File lib/fog/serverlove/models/compute/server.rb, line 45 def destroy requires :identity service.destroy_server(identity) self end
# File lib/fog/serverlove/models/compute/server.rb, line 30 def save attributes = {} if(identity) attributes = service.update_server(identity, allowed_attributes).body else requires :name requires :cpu attributes = service.create_server(self.defaults.merge(allowed_attributes)).body end merge_attributes(attributes) self end
Generated with the Darkfish Rdoc Generator 2.