Class: OpenNebula::PoolElement

Inherits:
XMLElement show all
Defined in:
lib/OpenNebula/Pool.rb

Overview

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

Direct Known Subclasses

Acl, Group, Host, Image, Template, User, VirtualMachine, VirtualNetwork

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XMLElement

#[], #attr, build_xml, #each, #each_xpath, #has_elements?, #initialize_xml, #retrieve_elements, #template_like_str, #template_str, #text, #to_hash, #to_xml

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



221
222
223
# File 'lib/OpenNebula/Pool.rb', line 221

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



227
228
229
# File 'lib/OpenNebula/Pool.rb', line 227

def id
    @pe_id
end

#nameObject

Gets element name

return

String the PoolElement name



233
234
235
# File 'lib/OpenNebula/Pool.rb', line 233

def name
    @name
end

#to_strObject

DO NOT USE - ONLY REXML BACKEND



238
239
240
241
242
243
# File 'lib/OpenNebula/Pool.rb', line 238

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

    return str
end