2012-12-11 09:35:06 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class RackspaceV2
|
|
|
|
class Real
|
|
|
|
|
|
|
|
# Delete an image
|
2013-01-30 10:05:10 -05:00
|
|
|
# @param [String] image_id Id of image to delete
|
2013-03-27 10:50:30 -04:00
|
|
|
# @return [Excon::Response] response
|
|
|
|
# @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404
|
|
|
|
# @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400
|
|
|
|
# @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500
|
|
|
|
# @raise [Fog::Rackspace::Errors::ServiceError]
|
2013-01-30 10:05:10 -05:00
|
|
|
# @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/Delete_Image-d1e4957.html
|
2012-12-11 09:35:06 -05:00
|
|
|
def delete_image(image_id)
|
|
|
|
request(
|
|
|
|
:expects => 204,
|
|
|
|
:method => 'DELETE',
|
|
|
|
:path => "images/#{image_id}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2012-12-12 09:56:16 -05:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
def delete_image(image_id)
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 202
|
|
|
|
response.body = ""
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2012-12-11 09:35:06 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|