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