Class/Module Index [+]

Quicksearch

Fog::Compute::Ovirt::Server

Public Instance Methods

add_interface(attrs) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 55
def add_interface attrs
  wait_for { stopped? } if attrs[:blocking]
  service.add_interface(id, attrs)
end
add_volume(attrs) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 77
def add_volume attrs
  wait_for { stopped? } if attrs[:blocking]
  service.add_volume(id, attrs)
end
destroy(options = {}) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 108
def destroy(options = {})
  (stop unless stopped?) rescue nil #ignore failure, destroy the machine anyway.
  wait_for { stopped? }
  service.destroy_vm(:id => id)
end
destroy_interface(attrs) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 65
def destroy_interface attrs
  wait_for { stopped? } if attrs[:blocking]
  service.destroy_interface(id, attrs)
end
destroy_volume(attrs) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 82
def destroy_volume attrs
  wait_for { stopped? } if attrs[:blocking]
  service.destroy_volume(id, attrs)
end
interfaces() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 48
def interfaces
  attributes[:interfaces] ||= id.nil? ? [] : Fog::Compute::Ovirt::Interfaces.new(
      :service => service,
      :vm => self
  )
end
locked?() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 36
def locked?
  !!(status =~ /locked/) || (attributes[:volumes]=nil) || volumes.any?{|v| !!(v.status =~ /locked/)}
end
mac() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 44
def mac
  interfaces.first.mac unless interfaces.empty?
end
ready?() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 32
def ready?
  !(status =~ /down/)
end
reboot(options = {}) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 98
def reboot(options = {})
  stop unless stopped?
  start options.merge(:blocking => true)
end
save() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 119
def save
  if persisted?
    service.update_vm(attributes)
  else
    self.id = service.create_vm(attributes).id
  end
  reload
end
start(options = {}) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 87
def start(options = {})
  wait_for { !locked? } if options[:blocking]
  service.vm_action(:id =>id, :action => :start)
  reload
end
stop(options = {}) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 93
def stop(options = {})
  service.vm_action(:id =>id, :action => :stop)
  reload
end
stopped?() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 40
def stopped?
  !!(status =~ /down/)
end
suspend(options = {}) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 103
def suspend(options = {})
  service.vm_action(:id =>id, :action => :suspend)
  reload
end
ticket(options = {}) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 114
def ticket(options = {})
  raise "Can not set console ticket, Server is not ready. Server status: #{status}" unless ready?
  service.vm_ticket(id, options)
end
to_s() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 128
def to_s
  name
end
update_interface(attrs) click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 60
def update_interface attrs
  wait_for { stopped? } if attrs[:blocking]
  service.update_interface(id, attrs)
end
volumes() click to toggle source
# File lib/fog/ovirt/models/compute/server.rb, line 70
def volumes
  attributes[:volumes] ||= id.nil? ? [] : Fog::Compute::Ovirt::Volumes.new(
      :service => service,
      :vm => self
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.