# File lib/fog/ovirt/models/compute/server.rb, line 54 def add_interface attrs wait_for { stopped? } if attrs[:blocking] service.add_interface(id, attrs) end
# File lib/fog/ovirt/models/compute/server.rb, line 76 def add_volume attrs wait_for { stopped? } if attrs[:blocking] service.add_volume(id, attrs) end
# File lib/fog/ovirt/models/compute/server.rb, line 107 def destroy(options = {}) (stop unless stopped?) rescue nil #ignore failure, destroy the machine anyway. wait_for { stopped? } service.destroy_vm(:id => id) end
# File lib/fog/ovirt/models/compute/server.rb, line 64 def destroy_interface attrs wait_for { stopped? } if attrs[:blocking] service.destroy_interface(id, attrs) end
# File lib/fog/ovirt/models/compute/server.rb, line 81 def destroy_volume attrs wait_for { stopped? } if attrs[:blocking] service.destroy_volume(id, attrs) end
# File lib/fog/ovirt/models/compute/server.rb, line 47 def interfaces attributes[:interfaces] ||= id.nil? ? [] : Fog::Compute::Ovirt::Interfaces.new( :service => service, :vm => self ) end
# File lib/fog/ovirt/models/compute/server.rb, line 35 def locked? !!(status =~ /locked/) end
# File lib/fog/ovirt/models/compute/server.rb, line 43 def mac interfaces.first.mac unless interfaces.empty? end
# File lib/fog/ovirt/models/compute/server.rb, line 31 def ready? !(status =~ /down/) end
# File lib/fog/ovirt/models/compute/server.rb, line 97 def reboot(options = {}) stop unless stopped? start options.merge(:blocking => true) end
# File lib/fog/ovirt/models/compute/server.rb, line 118 def save if persisted? service.update_vm(attributes) else self.id = service.create_vm(attributes).id end reload end
# File lib/fog/ovirt/models/compute/server.rb, line 86 def start(options = {}) wait_for { stopped? } if options[:blocking] service.vm_action(:id =>id, :action => :start) reload end
# File lib/fog/ovirt/models/compute/server.rb, line 92 def stop(options = {}) service.vm_action(:id =>id, :action => :stop) reload end
# File lib/fog/ovirt/models/compute/server.rb, line 39 def stopped? !!(status =~ /down/) end
# File lib/fog/ovirt/models/compute/server.rb, line 102 def suspend(options = {}) service.vm_action(:id =>id, :action => :suspend) reload end
# File lib/fog/ovirt/models/compute/server.rb, line 113 def ticket(options = {}) raise "Can not set console ticket, Server is not ready. Server status: #{status}" unless ready? service.vm_ticket(id, options) end
# File lib/fog/ovirt/models/compute/server.rb, line 127 def to_s name end
Generated with the Darkfish Rdoc Generator 2.