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:
parent
21ba080d8e
commit
5348eb6dc4
1 changed files with 29 additions and 0 deletions
29
lib/fog/joyent/requests/compute/get_image.rb
Normal file
29
lib/fog/joyent/requests/compute/get_image.rb
Normal 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
|
Loading…
Add table
Reference in a new issue