Method: OpenNebula::Image.build_xml
- Defined in:
- lib/opennebula/image.rb
.build_xml(pe_id = nil) ⇒ Object
Creates an Image description with just its identifier this method should be used to create plain Image objects. id
the id of the image
Example:
image = Image.new(Image.build_xml(3),rpc_client)
83 84 85 86 87 88 89 90 91 |
# File 'lib/opennebula/image.rb', line 83 def Image.build_xml(pe_id=nil) if pe_id image_xml = "<IMAGE><ID>#{pe_id}</ID></IMAGE>" else image_xml = "<IMAGE></IMAGE>" end XMLElement.build_xml(image_xml,'IMAGE') end |