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 19815 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 19835 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 19401 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 19414 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 19426 def comment @comment end
Sets the value of the `comment` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 19435 def comment=(value) @comment = value end
Returns the value of the `description` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 19444 def description @description end
Sets the value of the `description` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 19453 def description=(value) @description = value end
Returns the value of the `disk` attribute.
@return [Disk]
# File lib/ovirtsdk4/types.rb, line 19462 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 19475 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 19487 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 19500 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 19855 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 19512 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 19525 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 19537 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 19550 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 19562 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 19575 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 19587 def id @id end
Sets the value of the `id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 19596 def id=(value) @id = value end
Returns the value of the `kind` attribute.
@return [StatisticKind]
# File lib/ovirtsdk4/types.rb, line 19605 def kind @kind end
Sets the value of the `kind` attribute.
@param value [StatisticKind]
# File lib/ovirtsdk4/types.rb, line 19614 def kind=(value) @kind = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 19623 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 19632 def name=(value) @name = value end
Returns the value of the `nic` attribute.
@return [Nic]
# File lib/ovirtsdk4/types.rb, line 19641 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 19654 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 19666 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 19679 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 19691 def type @type end
Sets the value of the `type` attribute.
@param value [ValueType]
# File lib/ovirtsdk4/types.rb, line 19700 def type=(value) @type = value end
Returns the value of the `unit` attribute.
@return [StatisticUnit]
# File lib/ovirtsdk4/types.rb, line 19709 def unit @unit end
Sets the value of the `unit` attribute.
@param value [StatisticUnit]
# File lib/ovirtsdk4/types.rb, line 19718 def unit=(value) @unit = value end
Returns the value of the `values` attribute.
@return [Array<Value>]
# File lib/ovirtsdk4/types.rb, line 19727 def values @values end
Sets the value of the `values` attribute.
@param list [Array<Value>]
# File lib/ovirtsdk4/types.rb, line 19736 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 19753 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 19766 def vm=(value) if value.is_a?(Hash) value = Vm.new(value) end @vm = value end