1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/ibm/requests/compute/get_image_manifest.rb

40 lines
1.2 KiB
Ruby
Raw Normal View History

2012-01-10 17:20:56 -05:00
module Fog
module Compute
class IBM
class Real
2011-04-27 01:49:05 -04:00
# Returns manifest of image specified by id
#
# ==== Parameters
# 'image_id'<~String>: id of desired image
2012-01-10 17:20:56 -05:00
#
# ==== Returns
# * response<~Excon::Response>:
2011-04-27 01:49:05 -04:00
# * body<~Hash>:
# * 'manifest'<~String>: manifest of image in xml
2012-01-10 17:20:56 -05:00
def get_image_manifest(image_id)
request(
:method => 'GET',
:expects => 200,
:path => "/offerings/image/#{image_id}/manifest"
)
end
end
2011-12-02 13:27:44 -05:00
class Mock
# TODO: Create a data store for this.
def get_image_manifest(image_id)
response = Excon::Response.new
response.status = 200
response.body = {"manifest"=>
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><parameters xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"platform:/resource/com.ibm.ccl.devcloud.client/schema/parameters.xsd\">\n\t<firewall>\n\t\t<rule>\n\t\t\t<source>0.0.0.0/0</source>\n\t\t\t<minport>1</minport>\n\t\t\t<maxport>65535</maxport>\n\t\t</rule>\n\t</firewall>\n</parameters>"}
response
end
end
2012-01-10 17:20:56 -05:00
end
end
end