Class: OvirtSDK4::Statistic

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ Statistic

Creates a new instance of the OvirtSDK4::Statistic class.

Parameters:

  • opts (Hash) (defaults to: {})

    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.

Options Hash (opts):

  • :brick (GlusterBrick, Hash)

    The value of attribute brick.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :disk (Disk, Hash)

    The value of attribute disk.

  • :gluster_volume (GlusterVolume, Hash)

    The value of attribute gluster_volume.

  • :host (Host, Hash)

    The value of attribute host.

  • :host_nic (HostNic, Hash)

    The value of attribute host_nic.

  • :host_numa_node (NumaNode, Hash)

    The value of attribute host_numa_node.

  • :id (String)

    The value of attribute id.

  • :kind (StatisticKind)

    The value of attribute kind.

  • :name (String)

    The value of attribute name.

  • :nic (Nic, Hash)

    The value of attribute nic.

  • :step (Step, Hash)

    The value of attribute step.

  • :type (ValueType)

    The value of attribute type.

  • :unit (StatisticUnit)

    The value of attribute unit.

  • :values (Array<Value>, Array<Hash>)

    The values of attribute values.

  • :vm (Vm, Hash)

    The value of attribute vm.



19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
# File 'lib/ovirtsdk4/types.rb', line 19963

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

Instance Method Details

#==(other) ⇒ Object

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



19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
# File 'lib/ovirtsdk4/types.rb', line 19983

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

#brickGlusterBrick

Returns the value of the brick attribute.

Returns:



19549
19550
19551
# File 'lib/ovirtsdk4/types.rb', line 19549

def brick
  @brick
end

#brick=(value) ⇒ Object

Sets the value of the brick attribute.

The value parameter can be an instance of 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.

Parameters:



19562
19563
19564
19565
19566
19567
# File 'lib/ovirtsdk4/types.rb', line 19562

def brick=(value)
  if value.is_a?(Hash)
    value = GlusterBrick.new(value)
  end
  @brick = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


19574
19575
19576
# File 'lib/ovirtsdk4/types.rb', line 19574

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


19583
19584
19585
# File 'lib/ovirtsdk4/types.rb', line 19583

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


19592
19593
19594
# File 'lib/ovirtsdk4/types.rb', line 19592

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


19601
19602
19603
# File 'lib/ovirtsdk4/types.rb', line 19601

def description=(value)
  @description = value
end

#diskDisk

Returns the value of the disk attribute.

Returns:



19610
19611
19612
# File 'lib/ovirtsdk4/types.rb', line 19610

def disk
  @disk
end

#disk=(value) ⇒ Object

Sets the value of the disk attribute.

The value parameter can be an instance of 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.

Parameters:

  • value (Disk, Hash)


19623
19624
19625
19626
19627
19628
# File 'lib/ovirtsdk4/types.rb', line 19623

def disk=(value)
  if value.is_a?(Hash)
    value = Disk.new(value)
  end
  @disk = value
end

#gluster_volumeGlusterVolume

Returns the value of the gluster_volume attribute.

Returns:



19635
19636
19637
# File 'lib/ovirtsdk4/types.rb', line 19635

def gluster_volume
  @gluster_volume
end

#gluster_volume=(value) ⇒ Object

Sets the value of the gluster_volume attribute.

The value parameter can be an instance of 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.

Parameters:



19648
19649
19650
19651
19652
19653
# File 'lib/ovirtsdk4/types.rb', line 19648

def gluster_volume=(value)
  if value.is_a?(Hash)
    value = GlusterVolume.new(value)
  end
  @gluster_volume = value
end

#hashObject

Generates a hash value for this object.



20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
# File 'lib/ovirtsdk4/types.rb', line 20003

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

#hostHost

Returns the value of the host attribute.

Returns:



19660
19661
19662
# File 'lib/ovirtsdk4/types.rb', line 19660

def host
  @host
end

#host=(value) ⇒ Object

Sets the value of the host attribute.

The value parameter can be an instance of 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.

Parameters:

  • value (Host, Hash)


19673
19674
19675
19676
19677
19678
# File 'lib/ovirtsdk4/types.rb', line 19673

def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end

#host_nicHostNic

Returns the value of the host_nic attribute.

Returns:



19685
19686
19687
# File 'lib/ovirtsdk4/types.rb', line 19685

def host_nic
  @host_nic
end

#host_nic=(value) ⇒ Object

Sets the value of the host_nic attribute.

The value parameter can be an instance of 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.

Parameters:



19698
19699
19700
19701
19702
19703
# File 'lib/ovirtsdk4/types.rb', line 19698

def host_nic=(value)
  if value.is_a?(Hash)
    value = HostNic.new(value)
  end
  @host_nic = value
end

#host_numa_nodeNumaNode

Returns the value of the host_numa_node attribute.

Returns:



19710
19711
19712
# File 'lib/ovirtsdk4/types.rb', line 19710

def host_numa_node
  @host_numa_node
end

#host_numa_node=(value) ⇒ Object

Sets the value of the host_numa_node attribute.

The value parameter can be an instance of 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.

Parameters:



19723
19724
19725
19726
19727
19728
# File 'lib/ovirtsdk4/types.rb', line 19723

def host_numa_node=(value)
  if value.is_a?(Hash)
    value = NumaNode.new(value)
  end
  @host_numa_node = value
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


19735
19736
19737
# File 'lib/ovirtsdk4/types.rb', line 19735

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


19744
19745
19746
# File 'lib/ovirtsdk4/types.rb', line 19744

def id=(value)
  @id = value
end

#kindStatisticKind

Returns the value of the kind attribute.

Returns:



19753
19754
19755
# File 'lib/ovirtsdk4/types.rb', line 19753

def kind
  @kind
end

#kind=(value) ⇒ Object

Sets the value of the kind attribute.

Parameters:



19762
19763
19764
# File 'lib/ovirtsdk4/types.rb', line 19762

def kind=(value)
  @kind = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


19771
19772
19773
# File 'lib/ovirtsdk4/types.rb', line 19771

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


19780
19781
19782
# File 'lib/ovirtsdk4/types.rb', line 19780

def name=(value)
  @name = value
end

#nicNic

Returns the value of the nic attribute.

Returns:



19789
19790
19791
# File 'lib/ovirtsdk4/types.rb', line 19789

def nic
  @nic
end

#nic=(value) ⇒ Object

Sets the value of the nic attribute.

The value parameter can be an instance of 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.

Parameters:

  • value (Nic, Hash)


19802
19803
19804
19805
19806
19807
# File 'lib/ovirtsdk4/types.rb', line 19802

def nic=(value)
  if value.is_a?(Hash)
    value = Nic.new(value)
  end
  @nic = value
end

#stepStep

Returns the value of the step attribute.

Returns:



19814
19815
19816
# File 'lib/ovirtsdk4/types.rb', line 19814

def step
  @step
end

#step=(value) ⇒ Object

Sets the value of the step attribute.

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.

Parameters:

  • value (Step, Hash)


19827
19828
19829
19830
19831
19832
# File 'lib/ovirtsdk4/types.rb', line 19827

def step=(value)
  if value.is_a?(Hash)
    value = Step.new(value)
  end
  @step = value
end

#typeValueType

Returns the value of the type attribute.

Returns:



19839
19840
19841
# File 'lib/ovirtsdk4/types.rb', line 19839

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:



19848
19849
19850
# File 'lib/ovirtsdk4/types.rb', line 19848

def type=(value)
  @type = value
end

#unitStatisticUnit

Returns the value of the unit attribute.

Returns:



19857
19858
19859
# File 'lib/ovirtsdk4/types.rb', line 19857

def unit
  @unit
end

#unit=(value) ⇒ Object

Sets the value of the unit attribute.

Parameters:



19866
19867
19868
# File 'lib/ovirtsdk4/types.rb', line 19866

def unit=(value)
  @unit = value
end

#valuesArray<Value>

Returns the value of the values attribute.

Returns:



19875
19876
19877
# File 'lib/ovirtsdk4/types.rb', line 19875

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.

Parameters:



19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
# File 'lib/ovirtsdk4/types.rb', line 19884

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

#vmVm

Returns the value of the vm attribute.

Returns:



19901
19902
19903
# File 'lib/ovirtsdk4/types.rb', line 19901

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

The value parameter can be an instance of 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.

Parameters:

  • value (Vm, Hash)


19914
19915
19916
19917
19918
19919
# File 'lib/ovirtsdk4/types.rb', line 19914

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end