Constants and Class Methods
Creates a Zone description with just its identifier this method should be used to create plain Zone objects. @param id [Integer] the id of the Zone
Example:
zone = Zone.new(Zone.build_xml(3),rpc_client)
# File lib/opennebula/zone.rb, line 41 def Zone.build_xml(pe_id=nil) if pe_id zone_xml = "<ZONE><ID>#{pe_id}</ID></ZONE>" else zone_xml = "<ZONE></ZONE>" end XMLElement.build_xml(zone_xml,'ZONE') end
Class constructor
# File lib/opennebula/zone.rb, line 52 def initialize(xml, client) super(xml,client) end
Allocates a new Zone in OpenNebula
@param description [String] The template of the Zone. @return [nil, OpenNebula::Error] nil in case of success, Error
otherwise
# File lib/opennebula/zone.rb, line 74 def allocate(description) super(ZONE_METHODS[:allocate], description) end
Deletes the Zone @return [nil, OpenNebula::Error] nil in case of success, Error
otherwise
# File lib/opennebula/zone.rb, line 93 def delete() super(ZONE_METHODS[:delete]) end
Retrieves the information of the given Zone. @return [nil, OpenNebula::Error] nil in case of success, Error
otherwise
# File lib/opennebula/zone.rb, line 63 def info() super(ZONE_METHODS[:info], 'ZONE') end
Replaces the template contents
@param new_template [String] New template contents @param append [true, false] True to append new attributes instead of
replace the whole template
@return [nil, OpenNebula::Error] nil in case of success, Error
otherwise
# File lib/opennebula/zone.rb, line 86 def update(new_template=nil, append=false) super(ZONE_METHODS[:update], new_template, append ? 1 : 0) end