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/ecloud/requests/compute/get_compute_pool.rb

37 lines
1.1 KiB
Ruby
Raw Normal View History

2012-04-11 19:50:01 -04:00
module Fog
module Compute
class Ecloud
class Real
basic_request :get_compute_pool
end
class Mock
#
#Based off of:
#http://support.theenterprisecloud.com/kb/default.asp?id=567&Lang=1&SID=
#
def get_compute_pool(compute_pool_uri)
compute_pool_uri = ensure_unparsed(compute_pool_uri)
if compute_pool = mock_data.compute_pool_from_href(compute_pool_uri)
xml = Builder::XmlMarkup.new
mock_it 200,
xml.ComputePool(:xmlns => "urn:tmrk:eCloudExtensions-2.8", :"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance") {
2012-04-11 19:50:01 -04:00
xml.Id compute_pool.object_id
xml.Href compute_pool.href
xml.Name compute_pool.name
xml.State compute_pool.state
xml.IsDefault compute_pool.is_default
}, { 'Content-Type' => 'application/vnd.tmrk.ecloud.computePoolsList+xml' }
else
mock_error 200, "401 Unauthorized"
end
end
end
end
end
end