mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
29 lines
592 B
Ruby
29 lines
592 B
Ruby
module Fog
|
|
module Compute
|
|
class Joyent
|
|
|
|
class Mock
|
|
def get_machine(uuid)
|
|
if machine = self.data[:machines][uuid]
|
|
res = Excon::Response.new
|
|
res.status = 200
|
|
res.body = machine
|
|
res
|
|
else
|
|
raise Excon::Errors::NotFound, "Not Found"
|
|
end
|
|
end
|
|
end
|
|
|
|
class Real
|
|
def get_machine(uuid)
|
|
request(
|
|
:method => "GET",
|
|
:path => "/my/machines/#{uuid}",
|
|
:expects => [200, 410]
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|