1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

implement get_image api call

This commit is contained in:
Kevin Olbrich 2013-12-16 19:11:48 +00:00
parent 21ba080d8e
commit 5348eb6dc4

View file

@ -0,0 +1,29 @@
module Fog
module Compute
class Joyent
class Mock
def get_image(id)
if ds = self.data[:datasets][id]
res = Excon::Response.new
res.status = 200
res.body = ds
else
raise Excon::Errors::NotFound
end
end
end
class Real
def get_image(id)
request(
:method => "GET",
:path => "/#{@joyent_username}/images/#{id}",
:expects => 200
)
end
end
end
end
end