Class: Fog::Compute::OpenNebula::Servers

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/opennebula/models/compute/servers.rb

Instance Method Summary collapse

Instance Method Details

#all(filter = {}) ⇒ Object



13
14
15
# File 'lib/fog/opennebula/models/compute/servers.rb', line 13

def all(filter={})
  load(service.list_vms(filter))
end

#get(id) ⇒ Object



17
18
19
20
# File 'lib/fog/opennebula/models/compute/servers.rb', line 17

def get(id)
  data = service.list_vms({:id => id})
  new data.first unless data.empty?
end

#shutdown(id) ⇒ Object



22
23
24
# File 'lib/fog/opennebula/models/compute/servers.rb', line 22

def shutdown(id)
  service.vm_shutdown(id)
end