Method: OpenNebula::Hook.build_xml

Defined in:
lib/opennebula/hook.rb

.build_xml(pe_id = nil) ⇒ Object

Creates a Hook description with just its identifier this method should be used to create plain Hook objects. id the id of the user

Example:

hook = Hook.new(Hook.build_xml(3),rpc_client)


46
47
48
49
50
51
52
53
54
# File 'lib/opennebula/hook.rb', line 46

def self.build_xml(pe_id = nil)
    if pe_id
        obj_xml = "<HOOK><ID>#{pe_id}</ID></HOOK>"
    else
        obj_xml = '<HOOK></HOOK>'
    end

    XMLElement.build_xml(obj_xml, 'HOOK')
end