2012-07-30 16:50:16 -04:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class RackspaceV2
|
|
|
|
class Real
|
2013-01-30 10:05:10 -05:00
|
|
|
|
|
|
|
# Retrieves image detail
|
|
|
|
# @param [String] image_id
|
|
|
|
# @return [Excon::Response] response:
|
|
|
|
# * body [Hash]:
|
|
|
|
# * image [Hash]:
|
|
|
|
# * OS-DCF:diskConfig [String] - The disk configuration value.
|
|
|
|
# * created [String] - created timestamp
|
|
|
|
# * id [String] - id of image
|
|
|
|
# * metadata [Hash] - image metadata
|
|
|
|
# * minDisk [Fixnum]
|
|
|
|
# * minRam [Fixnum]
|
|
|
|
# * name [String] - name of image
|
|
|
|
# * progress [Fixnum] - progress complete. Value is from 0 to 100.
|
|
|
|
# * status [String] - status of current image
|
|
|
|
# * updated [String] - updated timestamp
|
|
|
|
# * links [Array] - links to flavor
|
2013-04-15 14:12:14 -04:00
|
|
|
# @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404
|
|
|
|
# @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400
|
|
|
|
# @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500
|
|
|
|
# @raise [Fog::Compute::RackspaceV2::ServiceError]
|
2013-03-22 16:59:03 -04:00
|
|
|
# @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/Get_Image_Details-d1e4848.html
|
2012-07-30 16:50:16 -04:00
|
|
|
def get_image(image_id)
|
|
|
|
request(
|
|
|
|
:expects => [200, 203],
|
|
|
|
:method => 'GET',
|
|
|
|
:path => "images/#{image_id}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
2013-01-11 16:06:58 -05:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
def get_image(image_id)
|
|
|
|
image = self.data[:images][image_id]
|
|
|
|
if image.nil?
|
|
|
|
raise Fog::Compute::RackspaceV2::NotFound
|
|
|
|
else
|
|
|
|
response(:body => {"image" => image})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-07-30 16:50:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|