2013-01-29 21:25:06 +01:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class DigitalOcean
|
|
|
|
class Real
|
|
|
|
|
|
|
|
def list_images(options = {})
|
|
|
|
request(
|
|
|
|
:expects => [200],
|
|
|
|
:method => 'GET',
|
2013-03-03 00:55:04 +01:00
|
|
|
:path => 'images'
|
2013-01-29 21:25:06 +01:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def list_images
|
2013-03-18 11:24:46 +01:00
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
|
|
|
"status" => "OK",
|
|
|
|
"images" => [
|
|
|
|
# Sample image
|
|
|
|
{
|
|
|
|
"id" => 1601,
|
|
|
|
"name" => "CentOS 5.8 x64",
|
|
|
|
"distribution" => "CentOS"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id" => 1602,
|
|
|
|
"name" => "CentOS 5.8 x32",
|
|
|
|
"distribution" => "CentOS"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id" => 2676,
|
|
|
|
"name" => "Ubuntu 12.04 x64 Server",
|
|
|
|
"distribution" => "Ubuntu"
|
|
|
|
},
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
response
|
2013-01-29 21:25:06 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|