1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/opennebula/models/compute/servers.rb
2015-04-10 13:47:23 +00:00

30 lines
522 B
Ruby

require 'fog/core/collection'
require 'fog/opennebula/models/compute/server'
module Fog
module Compute
class OpenNebula
class Servers < Fog::Collection
model Fog::Compute::OpenNebula::Server
def all(filter={})
load(service.list_vms(filter))
end
def get(id)
data = service.list_vms({:id => id})
new data.first unless data.empty?
end
def shutdown(id)
service.vm_shutdown(id)
end
end
end
end
end