mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
26 lines
450 B
Ruby
26 lines
450 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
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|