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`.
# File lib/ovirtsdk4/types.rb, line 18722 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
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 18742 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 18308 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 18321 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 18333 def comment @comment end
Sets the value of the `comment` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 18342 def comment=(value) @comment = value end
Returns the value of the `description` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 18351 def description @description end
Sets the value of the `description` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 18360 def description=(value) @description = value end
Returns the value of the `disk` attribute.
@return [Disk]
# File lib/ovirtsdk4/types.rb, line 18369 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 18382 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 18394 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 18407 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.
# File lib/ovirtsdk4/types.rb, line 18762 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 18419 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 18432 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 18444 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 18457 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 18469 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 18482 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 18494 def id @id end
Sets the value of the `id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 18503 def id=(value) @id = value end
Returns the value of the `kind` attribute.
@return [StatisticKind]
# File lib/ovirtsdk4/types.rb, line 18512 def kind @kind end
Sets the value of the `kind` attribute.
@param value [StatisticKind]
# File lib/ovirtsdk4/types.rb, line 18521 def kind=(value) @kind = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 18530 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 18539 def name=(value) @name = value end
Returns the value of the `nic` attribute.
@return [Nic]
# File lib/ovirtsdk4/types.rb, line 18548 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 18561 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 18573 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 18586 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 18598 def type @type end
Sets the value of the `type` attribute.
@param value [ValueType]
# File lib/ovirtsdk4/types.rb, line 18607 def type=(value) @type = value end
Returns the value of the `unit` attribute.
@return [StatisticUnit]
# File lib/ovirtsdk4/types.rb, line 18616 def unit @unit end
Sets the value of the `unit` attribute.
@param value [StatisticUnit]
# File lib/ovirtsdk4/types.rb, line 18625 def unit=(value) @unit = value end
Returns the value of the `values` attribute.
@return [Array<Value>]
# File lib/ovirtsdk4/types.rb, line 18634 def values @values end
Sets the value of the `values` attribute.
@param list [Array<Value>]
# File lib/ovirtsdk4/types.rb, line 18643 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 18660 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 18673 def vm=(value) if value.is_a?(Hash) value = Vm.new(value) end @vm = value end