Class: Ovirt::Host

Inherits:
Base
  • Object
show all
Defined in:
lib/ovirt/host.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #operations, #relationships, #service

Class Method Summary collapse

Methods inherited from Base

#[], all, all_xml_objects, #api_endpoint, api_endpoint, #class_suffix, create_from_xml, #destroy, element_name, element_names, find_by_href, find_by_id, find_by_name, has_first_node?, hash_from_id_and_href, href_from_creation_status_link, #initialize, #keys, #method_missing, object_to_id, #operation, parse_attribute, parse_boolean, parse_first_node, parse_first_node_with_hash, parse_first_text, parse_xml, #relationship, #reload, #replace, set_value, #update, #update!, xml_to_actions, xml_to_hash, xml_to_nokogiri, xml_to_relationships

Methods included from Logging

#logger

Constructor Details

This class inherits a constructor from Ovirt::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ovirt::Base

Class Method Details

.parse_node_extended(node, hash) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ovirt/host.rb', line 8

def self.parse_node_extended(node, hash)
  hash[:relationships][:host_nics] = hash[:relationships].delete(:nics)

  parse_first_node(node, :certificate, hash,
                   :node => [:organization, :subject])

  parse_first_node(node, :status, hash,
                   :node => [:state])

  parse_first_node(node, :version, hash,
                   :attribute => [:major, :minor, :build, :revision, :full_version])

  parse_first_node(node, :hardware_information, hash,
                   :node => [:manufacturer, :version, :serial_number, :product_name, :uuid, :family])

  parse_first_node(node, :power_management, hash,
                   :attribute    => [:type],
                   :node         => [:address, :username, :options],
                   :node_to_bool => [:enabled])

  parse_first_node(node, :ksm, hash,
                   :node_to_bool => [:enabled])

  parse_first_node(node, :transparent_hugepages, hash,
                   :node_to_bool => [:enabled])

  parse_first_node(node, :iscsi, hash,
                   :node => [:initiator])

  parse_first_node(node, :ssh, hash,
                   :node => [:port, :fingerprint])

  parse_first_node(node, :cpu, hash,
                   :node      => [:name],
                   :node_to_i => [:speed])

  if has_first_node?(node, 'cpu/topology')
    parse_first_node_with_hash(node, 'cpu/topology', hash.store_path(:cpu, :topology, {}),
                               :attribute_to_i => [:sockets, :cores])
  end

  parse_first_node(node, :summary, hash,
                   :node_to_i => [:active, :migrating, :total])

  parse_first_node(node, :os, hash,
                   :attribute => [:type])

  if has_first_node?(node, 'os/version')
    parse_first_node_with_hash(node, 'os/version', hash.store_path(:os, :version, {}),
                               :attribute => [:full_version, :major, :minor, :build])
  end

  parse_first_node(node, :libvirt_version, hash,
                   :attribute => [:major, :minor, :build, :revision, :full_version])
end