class OvirtSDK4::Statistic
Public Class Methods
Creates a new instance of the {Statistic} class.
@param opts [Hash] A hash containing the attributes of the object. The keys of the hash
should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.
@option opts [GlusterBrick, Hash] :brick The value of attribute `brick`.
@option opts [String] :comment The value of attribute `comment`.
@option opts [String] :description The value of attribute `description`.
@option opts [Disk, Hash] :disk The value of attribute `disk`.
@option opts [GlusterVolume, Hash] :gluster_volume The value of attribute `gluster_volume`.
@option opts [Host, Hash] :host The value of attribute `host`.
@option opts [HostNic, Hash] :host_nic The value of attribute `host_nic`.
@option opts [NumaNode, Hash] :host_numa_node The value of attribute `host_numa_node`.
@option opts [String] :id The value of attribute `id`.
@option opts [StatisticKind] :kind The value of attribute `kind`.
@option opts [String] :name The value of attribute `name`.
@option opts [Nic, Hash] :nic The value of attribute `nic`.
@option opts [Step, Hash] :step The value of attribute `step`.
@option opts [ValueType] :type The value of attribute `type`.
@option opts [StatisticUnit] :unit The value of attribute `unit`.
@option opts [Array<Value>, Array<Hash>] :values The values of attribute `values`.
@option opts [Vm, Hash] :vm The value of attribute `vm`.
OvirtSDK4::Identified::new
# File lib/ovirtsdk4/types.rb, line 20986 def initialize(opts = {}) super(opts) self.brick = opts[:brick] self.disk = opts[:disk] self.gluster_volume = opts[:gluster_volume] self.host = opts[:host] self.host_nic = opts[:host_nic] self.host_numa_node = opts[:host_numa_node] self.kind = opts[:kind] self.nic = opts[:nic] self.step = opts[:step] self.type = opts[:type] self.unit = opts[:unit] self.values = opts[:values] self.vm = opts[:vm] end
Public Instance Methods
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 21006 def ==(other) super && @brick == other.brick && @disk == other.disk && @gluster_volume == other.gluster_volume && @host == other.host && @host_nic == other.host_nic && @host_numa_node == other.host_numa_node && @kind == other.kind && @nic == other.nic && @step == other.step && @type == other.type && @unit == other.unit && @values == other.values && @vm == other.vm end
Returns the value of the `brick` attribute.
@return [GlusterBrick]
# File lib/ovirtsdk4/types.rb, line 20572 def brick @brick end
Sets the value of the `brick` attribute.
@param value [GlusterBrick, Hash]
The `value` parameter can be an instance of {OvirtSDK4::GlusterBrick} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20585 def brick=(value) if value.is_a?(Hash) value = GlusterBrick.new(value) end @brick = value end
Returns the value of the `comment` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 20597 def comment @comment end
Sets the value of the `comment` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 20606 def comment=(value) @comment = value end
Returns the value of the `description` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 20615 def description @description end
Sets the value of the `description` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 20624 def description=(value) @description = value end
Returns the value of the `disk` attribute.
@return [Disk]
# File lib/ovirtsdk4/types.rb, line 20633 def disk @disk end
Sets the value of the `disk` attribute.
@param value [Disk, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Disk} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20646 def disk=(value) if value.is_a?(Hash) value = Disk.new(value) end @disk = value end
Returns the value of the `gluster_volume` attribute.
@return [GlusterVolume]
# File lib/ovirtsdk4/types.rb, line 20658 def gluster_volume @gluster_volume end
Sets the value of the `gluster_volume` attribute.
@param value [GlusterVolume, Hash]
The `value` parameter can be an instance of {OvirtSDK4::GlusterVolume} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20671 def gluster_volume=(value) if value.is_a?(Hash) value = GlusterVolume.new(value) end @gluster_volume = value end
Generates a hash value for this object.
OvirtSDK4::Identified#hash
# File lib/ovirtsdk4/types.rb, line 21026 def hash super + @brick.hash + @disk.hash + @gluster_volume.hash + @host.hash + @host_nic.hash + @host_numa_node.hash + @kind.hash + @nic.hash + @step.hash + @type.hash + @unit.hash + @values.hash + @vm.hash end
Returns the value of the `host` attribute.
@return [Host]
# File lib/ovirtsdk4/types.rb, line 20683 def host @host end
Sets the value of the `host` attribute.
@param value [Host, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Host} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20696 def host=(value) if value.is_a?(Hash) value = Host.new(value) end @host = value end
Returns the value of the `host_nic` attribute.
@return [HostNic]
# File lib/ovirtsdk4/types.rb, line 20708 def host_nic @host_nic end
Sets the value of the `host_nic` attribute.
@param value [HostNic, Hash]
The `value` parameter can be an instance of {OvirtSDK4::HostNic} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20721 def host_nic=(value) if value.is_a?(Hash) value = HostNic.new(value) end @host_nic = value end
Returns the value of the `host_numa_node` attribute.
@return [NumaNode]
# File lib/ovirtsdk4/types.rb, line 20733 def host_numa_node @host_numa_node end
Sets the value of the `host_numa_node` attribute.
@param value [NumaNode, Hash]
The `value` parameter can be an instance of {OvirtSDK4::NumaNode} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20746 def host_numa_node=(value) if value.is_a?(Hash) value = NumaNode.new(value) end @host_numa_node = value end
Returns the value of the `id` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 20758 def id @id end
Sets the value of the `id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 20767 def id=(value) @id = value end
Returns the value of the `kind` attribute.
@return [StatisticKind]
# File lib/ovirtsdk4/types.rb, line 20776 def kind @kind end
Sets the value of the `kind` attribute.
@param value [StatisticKind]
# File lib/ovirtsdk4/types.rb, line 20785 def kind=(value) @kind = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 20794 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 20803 def name=(value) @name = value end
Returns the value of the `nic` attribute.
@return [Nic]
# File lib/ovirtsdk4/types.rb, line 20812 def nic @nic end
Sets the value of the `nic` attribute.
@param value [Nic, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Nic} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20825 def nic=(value) if value.is_a?(Hash) value = Nic.new(value) end @nic = value end
Returns the value of the `step` attribute.
@return [Step]
# File lib/ovirtsdk4/types.rb, line 20837 def step @step end
Sets the value of the `step` attribute.
@param value [Step, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Step} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20850 def step=(value) if value.is_a?(Hash) value = Step.new(value) end @step = value end
Returns the value of the `type` attribute.
@return [ValueType]
# File lib/ovirtsdk4/types.rb, line 20862 def type @type end
Sets the value of the `type` attribute.
@param value [ValueType]
# File lib/ovirtsdk4/types.rb, line 20871 def type=(value) @type = value end
Returns the value of the `unit` attribute.
@return [StatisticUnit]
# File lib/ovirtsdk4/types.rb, line 20880 def unit @unit end
Sets the value of the `unit` attribute.
@param value [StatisticUnit]
# File lib/ovirtsdk4/types.rb, line 20889 def unit=(value) @unit = value end
Returns the value of the `values` attribute.
@return [Array<Value>]
# File lib/ovirtsdk4/types.rb, line 20898 def values @values end
Sets the value of the `values` attribute.
@param list [Array<Value>]
# File lib/ovirtsdk4/types.rb, line 20907 def values=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = Value.new(value) end end end @values = list end
Returns the value of the `vm` attribute.
@return [Vm]
# File lib/ovirtsdk4/types.rb, line 20924 def vm @vm end
Sets the value of the `vm` attribute.
@param value [Vm, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Vm} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 20937 def vm=(value) if value.is_a?(Hash) value = Vm.new(value) end @vm = value end