Class: OpenNebula::PoolElement
- Inherits:
-
XMLElement
- Object
- XMLElement
- OpenNebula::PoolElement
- Defined in:
- lib/OpenNebula/Pool.rb
Overview
The PoolElement Class represents a generic element of a Pool in XML format
Direct Known Subclasses
Acl, Cluster, Datastore, Group, Host, Image, Template, User, VirtualMachine, VirtualNetwork
Class Method Summary collapse
-
.new_with_id(id, client = nil) ⇒ Object
- Creates new element specifying its id id
- identifyier of the element client
-
initialized OpenNebula::Client object.
Instance Method Summary collapse
-
#id ⇒ Object
Returns element identifier [return] Integer the PoolElement ID.
-
#name ⇒ Object
Gets element name [return] String the PoolElement name.
-
#to_str ⇒ Object
DO NOT USE - ONLY REXML BACKEND.
Methods inherited from XMLElement
#[], #add_element, #attr, build_xml, #delete_element, #each, #each_xpath, #has_elements?, #initialize_xml, #retrieve_elements, #template_like_str, #template_str, #template_xml, #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
263 264 265 |
# File 'lib/OpenNebula/Pool.rb', line 263 def self.new_with_id(id, client=nil) self.new(self.build_xml(id), client) end |
Instance Method Details
#id ⇒ Object
Returns element identifier
- return
-
Integer the PoolElement ID
269 270 271 |
# File 'lib/OpenNebula/Pool.rb', line 269 def id @pe_id end |
#name ⇒ Object
Gets element name
- return
-
String the PoolElement name
275 276 277 |
# File 'lib/OpenNebula/Pool.rb', line 275 def name @name end |
#to_str ⇒ Object
DO NOT USE - ONLY REXML BACKEND
280 281 282 283 284 285 |
# File 'lib/OpenNebula/Pool.rb', line 280 def to_str str = "" REXML::Formatters::Pretty.new(1).write(@xml,str) return str end |