class OvirtSDK4::Statistic

Public Class Methods

new(opts = {}) click to toggle source

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`.

Calls superclass method OvirtSDK4::Identified::new
# File lib/ovirtsdk4/types.rb, line 20114
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

==(other) click to toggle source

Returns `true` if `self` and `other` have the same attributes and values.

Calls superclass method OvirtSDK4::Identified#==
# File lib/ovirtsdk4/types.rb, line 20134
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
brick() click to toggle source

Returns the value of the `brick` attribute.

@return [GlusterBrick]

# File lib/ovirtsdk4/types.rb, line 19700
def brick
  @brick
end
brick=(value) click to toggle source

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 19713
def brick=(value)
  if value.is_a?(Hash)
    value = GlusterBrick.new(value)
  end
  @brick = value
end
comment() click to toggle source

Returns the value of the `comment` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 19725
def comment
  @comment
end
comment=(value) click to toggle source

Sets the value of the `comment` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 19734
def comment=(value)
  @comment = value
end
description() click to toggle source

Returns the value of the `description` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 19743
def description
  @description
end
description=(value) click to toggle source

Sets the value of the `description` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 19752
def description=(value)
  @description = value
end
disk() click to toggle source

Returns the value of the `disk` attribute.

@return [Disk]

# File lib/ovirtsdk4/types.rb, line 19761
def disk
  @disk
end
disk=(value) click to toggle source

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 19774
def disk=(value)
  if value.is_a?(Hash)
    value = Disk.new(value)
  end
  @disk = value
end
gluster_volume() click to toggle source

Returns the value of the `gluster_volume` attribute.

@return [GlusterVolume]

# File lib/ovirtsdk4/types.rb, line 19786
def gluster_volume
  @gluster_volume
end
gluster_volume=(value) click to toggle source

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 19799
def gluster_volume=(value)
  if value.is_a?(Hash)
    value = GlusterVolume.new(value)
  end
  @gluster_volume = value
end
hash() click to toggle source

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Identified#hash
# File lib/ovirtsdk4/types.rb, line 20154
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
host() click to toggle source

Returns the value of the `host` attribute.

@return [Host]

# File lib/ovirtsdk4/types.rb, line 19811
def host
  @host
end
host=(value) click to toggle source

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 19824
def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end
host_nic() click to toggle source

Returns the value of the `host_nic` attribute.

@return [HostNic]

# File lib/ovirtsdk4/types.rb, line 19836
def host_nic
  @host_nic
end
host_nic=(value) click to toggle source

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 19849
def host_nic=(value)
  if value.is_a?(Hash)
    value = HostNic.new(value)
  end
  @host_nic = value
end
host_numa_node() click to toggle source

Returns the value of the `host_numa_node` attribute.

@return [NumaNode]

# File lib/ovirtsdk4/types.rb, line 19861
def host_numa_node
  @host_numa_node
end
host_numa_node=(value) click to toggle source

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 19874
def host_numa_node=(value)
  if value.is_a?(Hash)
    value = NumaNode.new(value)
  end
  @host_numa_node = value
end
id() click to toggle source

Returns the value of the `id` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 19886
def id
  @id
end
id=(value) click to toggle source

Sets the value of the `id` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 19895
def id=(value)
  @id = value
end
kind() click to toggle source

Returns the value of the `kind` attribute.

@return [StatisticKind]

# File lib/ovirtsdk4/types.rb, line 19904
def kind
  @kind
end
kind=(value) click to toggle source

Sets the value of the `kind` attribute.

@param value [StatisticKind]

# File lib/ovirtsdk4/types.rb, line 19913
def kind=(value)
  @kind = value
end
name() click to toggle source

Returns the value of the `name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 19922
def name
  @name
end
name=(value) click to toggle source

Sets the value of the `name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 19931
def name=(value)
  @name = value
end
nic() click to toggle source

Returns the value of the `nic` attribute.

@return [Nic]

# File lib/ovirtsdk4/types.rb, line 19940
def nic
  @nic
end
nic=(value) click to toggle source

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 19953
def nic=(value)
  if value.is_a?(Hash)
    value = Nic.new(value)
  end
  @nic = value
end
step() click to toggle source

Returns the value of the `step` attribute.

@return [Step]

# File lib/ovirtsdk4/types.rb, line 19965
def step
  @step
end
step=(value) click to toggle source

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 19978
def step=(value)
  if value.is_a?(Hash)
    value = Step.new(value)
  end
  @step = value
end
type() click to toggle source

Returns the value of the `type` attribute.

@return [ValueType]

# File lib/ovirtsdk4/types.rb, line 19990
def type
  @type
end
type=(value) click to toggle source

Sets the value of the `type` attribute.

@param value [ValueType]

# File lib/ovirtsdk4/types.rb, line 19999
def type=(value)
  @type = value
end
unit() click to toggle source

Returns the value of the `unit` attribute.

@return [StatisticUnit]

# File lib/ovirtsdk4/types.rb, line 20008
def unit
  @unit
end
unit=(value) click to toggle source

Sets the value of the `unit` attribute.

@param value [StatisticUnit]

# File lib/ovirtsdk4/types.rb, line 20017
def unit=(value)
  @unit = value
end
values() click to toggle source

Returns the value of the `values` attribute.

@return [Array<Value>]

# File lib/ovirtsdk4/types.rb, line 20026
def values
  @values
end
values=(list) click to toggle source

Sets the value of the `values` attribute.

@param list [Array<Value>]

# File lib/ovirtsdk4/types.rb, line 20035
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
vm() click to toggle source

Returns the value of the `vm` attribute.

@return [Vm]

# File lib/ovirtsdk4/types.rb, line 20052
def vm
  @vm
end
vm=(value) click to toggle source

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 20065
def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end