Class: OpenNebula::PoolElement

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

Overview

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

Direct Known Subclasses

Acl, Cluster, Datastore, Document, Group, Host, Image, Template, User, VirtualMachine, VirtualNetwork

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, #template_like_str, #template_str, #template_xml, #text, #to_hash, #to_xml

Class Method Details

+ (Object) new_with_id(id, client = nil)

Creates new element specifying its id

id

identifyier of the element

client

initialized OpenNebula::Client object



352
353
354
# File 'OpenNebula/Pool.rb', line 352

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

Instance Method Details

- (Object) id

Returns element identifier

return

Integer the PoolElement ID



358
359
360
# File 'OpenNebula/Pool.rb', line 358

def id
    @pe_id
end

- (Object) name

Gets element name

return

String the PoolElement name



364
365
366
# File 'OpenNebula/Pool.rb', line 364

def name
    @name
end

- (Object) to_str

DO NOT USE - ONLY REXML BACKEND



369
370
371
372
373
374
# File 'OpenNebula/Pool.rb', line 369

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

    return str
end