2012-04-27 21:53:39 +01:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Serverlove
|
|
|
|
class Real
|
|
|
|
|
2012-04-29 17:36:16 +01:00
|
|
|
def create_image(options)
|
2012-04-27 21:53:39 +01:00
|
|
|
return nil if options.empty? || options.nil?
|
|
|
|
request(:method => "post", :path => "/drives/create", :expects => 200, :options => options)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2012-04-29 21:18:54 +01:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def create_image(options = {})
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
|
|
|
|
data = {
|
2012-07-15 12:23:49 +02:00
|
|
|
'drive' => Fog::Mock.random_numbers(1000000).to_s,
|
2012-04-29 21:18:54 +01:00
|
|
|
'name' => options['name'] || 'Test',
|
|
|
|
'size' => options['size'] || 12345
|
|
|
|
}
|
|
|
|
|
|
|
|
response.body = data
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2012-04-27 21:53:39 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|