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/xenserver/requests/compute/get_hosts.rb
2012-04-02 13:25:03 +02:00

27 lines
599 B
Ruby

module Fog
module Compute
class XenServer
class Real
require 'fog/xenserver/parsers/get_hosts'
def get_hosts( options = {} )
options[:sort] ||= 'name_label'
result = @connection.request(:parser => Fog::Parsers::XenServer::GetHosts.new, :method => 'host.get_all_records')
result.sort! {|a,b| a[ options[:sort].to_sym ] <=> b[ options[:sort].to_sym ]}
end
end
class Mock
def get_hosts
Fog::Mock.not_implemented
end
end
end
end
end