Retrieves content of background image
# File lib/studio_api/gallery.rb, line 69 def background request_str = "/gallery/appliances/#{id.to_i}/background" response = GenericRequest.new(self.class.studio_connection).get request_str end
Retrieves all comments to appliance @return [Array] list of comments
# File lib/studio_api/gallery.rb, line 85 def comments request_str = "/gallery/appliances/#{id.to_i}/comments" response = GenericRequest.new(self.class.studio_connection).get request_str tree = XmlSimple.xml_in response, "ForceArray" => ["comment"] tree["appliance"]["comments"]["comment"].collect do |c| Comment.parse(self,c) end end
Retrieves content of logo image
# File lib/studio_api/gallery.rb, line 63 def logo request_str = "/gallery/appliances/#{id.to_i}/logo" response = GenericRequest.new(self.class.studio_connection).get request_str end
Adds new comment to appliance
# File lib/studio_api/gallery.rb, line 95 def post_comment text, options={} request_str = "/gallery/appliances/#{id.to_i}/comments" request_str = Util.add_options request_str, options response = GenericRequest.new(self.class.studio_connection).post request_str, :__raw => text tree = XmlSimple.xml_in response, "ForceArray" => ["comment"] tree["appliance"]["comments"]["comment"].collect do |c| Comment.parse(self,c) end end
Posts own rating of appliance @param value in range 0..5 @return TODO
# File lib/studio_api/gallery.rb, line 27 def rate value request_str = "/gallery/appliances/#{id.to_i}/rating?rating=#{value.to_i}" response = GenericRequest.new(self.class.studio_connection).post request_str XmlSimple.xml_in(response, "ForceArray" => false)["appliance"] end
Gets rating details as hash return[Hash] TODO
# File lib/studio_api/gallery.rb, line 18 def rating request_str = "/gallery/appliances/#{id.to_i}/rating" response = GenericRequest.new(self.class.studio_connection).get request_str XmlSimple.xml_in(response, "ForceArray" => false)["appliance"] end
Modifies appliance release notes @param text of release notes
# File lib/studio_api/gallery.rb, line 35 def release_notes= (text) request_str = "/gallery/appliances/#{id.to_i}/version/#{CGI.escape version.to_s}" response = GenericRequest.new(studio_connection).put request_str, :__raw => release_notes end
Retrieves information about software used to create appliance
# File lib/studio_api/gallery.rb, line 55 def software options = {} request_str = "/gallery/appliances/#{id.to_i}/software" request_str = Util.add_options request_str, options response = GenericRequest.new(self.class.studio_connection).get request_str #TODO parse response to something usefull end
Starts testdrive and gets information how to use it
# File lib/studio_api/gallery.rb, line 75 def testdrive options = {} request_str = "/gallery/appliances/#{id.to_i}/testdrive" request_str = Util.add_options request_str, options response = GenericRequest.new(self.class.studio_connection).post request_str tree = XmlSimple.xml_in response, "ForceArray" => false tree["testdrive"] end
Removes appliance from gallery
# File lib/studio_api/gallery.rb, line 41 def unpublish request_str = "/gallery/appliances/#{id.to_i}/version/#{CGI.escape version.to_s}" response = GenericRequest.new(studio_connection).delete request_str end
Gets all available versions of appliance in gallery
# File lib/studio_api/gallery.rb, line 47 def versions request_str = "/gallery/appliances/#{id.to_i}/versions" response = GenericRequest.new(self.class.studio_connection).get request_str tree = XmlSimple.xml_in response, "ForceArray" => ["version"] return tree["appliance"]["versions"]["version"] end