2011-06-28 15:47:16 +02:00
|
|
|
require 'fog/core/collection'
|
2011-08-29 10:24:39 -05:00
|
|
|
require 'fog/libvirt/models/compute/server'
|
2011-06-28 15:47:16 +02:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Libvirt
|
|
|
|
|
|
|
|
class Servers < Fog::Collection
|
|
|
|
|
|
|
|
model Fog::Compute::Libvirt::Server
|
|
|
|
|
2012-04-04 15:03:17 +03:00
|
|
|
def all(filter={})
|
|
|
|
load(connection.list_domains(filter))
|
2011-06-28 15:47:16 +02:00
|
|
|
end
|
2011-08-08 15:18:03 -06:00
|
|
|
|
2011-08-03 14:28:40 +02:00
|
|
|
def get(uuid)
|
2012-04-04 15:03:17 +03:00
|
|
|
data = connection.list_domains(:uuid => uuid)
|
|
|
|
new data.first if data
|
2011-06-28 15:47:16 +02:00
|
|
|
end
|
|
|
|
|
2012-04-04 15:03:17 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|