Class: OpenNebula::PoolElement

Inherits:
XMLElement show all
Defined in:
lib/opennebula/pool_element.rb

Overview

The PoolElement Class represents a generic element of a Pool in XML format

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XMLElement

#[], #add_element, #attr, build_xml, #delete_element, #each, #each_xpath, #element_xml, #has_elements?, #initialize_xml, #retrieve_elements, #retrieve_xmlelements, #template_like_str, #template_str, #template_xml, #text, #to_hash, #to_xml, #xml_nil?

Class Method Details

.new_with_id(id, client = nil) ⇒ Object

Creates new element specifying its id

id

identifyier of the element

client

initialized OpenNebula::Client object



214
215
216
# File 'lib/opennebula/pool_element.rb', line 214

def self.new_with_id(id, client=nil)
    self.new(self.build_xml(id), client)
end

Instance Method Details

#idObject

Returns element identifier

return

Integer the PoolElement ID



220
221
222
# File 'lib/opennebula/pool_element.rb', line 220

def id
    @pe_id
end

#nameObject

Gets element name

return

String the PoolElement name



226
227
228
# File 'lib/opennebula/pool_element.rb', line 226

def name
    @name
end

#to_strObject

DO NOT USE - ONLY REXML BACKEND



231
232
233
234
235
236
# File 'lib/opennebula/pool_element.rb', line 231

def to_str
    str = ""
    REXML::Formatters::Pretty.new(1).write(@xml,str)

    return str
end