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.

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.



20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
# 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

Instance Method Details

#==(other) ⇒ Object

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



21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
# 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

#brickGlusterBrick

Returns the value of the brick attribute.



20572
20573
20574
# File 'lib/ovirtsdk4/types.rb', line 20572

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.



20585
20586
20587
20588
20589
20590
# File 'lib/ovirtsdk4/types.rb', line 20585

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

#commentString

Returns the value of the comment attribute.



20597
20598
20599
# File 'lib/ovirtsdk4/types.rb', line 20597

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



20606
20607
20608
# File 'lib/ovirtsdk4/types.rb', line 20606

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



20615
20616
20617
# File 'lib/ovirtsdk4/types.rb', line 20615

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



20624
20625
20626
# File 'lib/ovirtsdk4/types.rb', line 20624

def description=(value)
  @description = value
end

#diskDisk

Returns the value of the disk attribute.



20633
20634
20635
# File 'lib/ovirtsdk4/types.rb', line 20633

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.



20646
20647
20648
20649
20650
20651
# File 'lib/ovirtsdk4/types.rb', line 20646

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.



20658
20659
20660
# File 'lib/ovirtsdk4/types.rb', line 20658

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.



20671
20672
20673
20674
20675
20676
# 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

#hashObject

Generates a hash value for this object.



21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
# 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

#hostHost

Returns the value of the host attribute.



20683
20684
20685
# File 'lib/ovirtsdk4/types.rb', line 20683

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.



20696
20697
20698
20699
20700
20701
# File 'lib/ovirtsdk4/types.rb', line 20696

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.



20708
20709
20710
# File 'lib/ovirtsdk4/types.rb', line 20708

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.



20721
20722
20723
20724
20725
20726
# 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

#host_numa_nodeNumaNode

Returns the value of the host_numa_node attribute.



20733
20734
20735
# File 'lib/ovirtsdk4/types.rb', line 20733

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.



20746
20747
20748
20749
20750
20751
# 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

#idString

Returns the value of the id attribute.



20758
20759
20760
# File 'lib/ovirtsdk4/types.rb', line 20758

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



20767
20768
20769
# File 'lib/ovirtsdk4/types.rb', line 20767

def id=(value)
  @id = value
end

#kindStatisticKind

Returns the value of the kind attribute.



20776
20777
20778
# File 'lib/ovirtsdk4/types.rb', line 20776

def kind
  @kind
end

#kind=(value) ⇒ Object

Sets the value of the kind attribute.



20785
20786
20787
# File 'lib/ovirtsdk4/types.rb', line 20785

def kind=(value)
  @kind = value
end

#nameString

Returns the value of the name attribute.



20794
20795
20796
# File 'lib/ovirtsdk4/types.rb', line 20794

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



20803
20804
20805
# File 'lib/ovirtsdk4/types.rb', line 20803

def name=(value)
  @name = value
end

#nicNic

Returns the value of the nic attribute.



20812
20813
20814
# File 'lib/ovirtsdk4/types.rb', line 20812

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.



20825
20826
20827
20828
20829
20830
# File 'lib/ovirtsdk4/types.rb', line 20825

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

#stepStep

Returns the value of the step attribute.



20837
20838
20839
# File 'lib/ovirtsdk4/types.rb', line 20837

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.



20850
20851
20852
20853
20854
20855
# File 'lib/ovirtsdk4/types.rb', line 20850

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

#typeValueType

Returns the value of the type attribute.



20862
20863
20864
# File 'lib/ovirtsdk4/types.rb', line 20862

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.



20871
20872
20873
# File 'lib/ovirtsdk4/types.rb', line 20871

def type=(value)
  @type = value
end

#unitStatisticUnit

Returns the value of the unit attribute.



20880
20881
20882
# File 'lib/ovirtsdk4/types.rb', line 20880

def unit
  @unit
end

#unit=(value) ⇒ Object

Sets the value of the unit attribute.



20889
20890
20891
# File 'lib/ovirtsdk4/types.rb', line 20889

def unit=(value)
  @unit = value
end

#valuesArray<Value>

Returns the value of the values attribute.



20898
20899
20900
# File 'lib/ovirtsdk4/types.rb', line 20898

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.



20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
# 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

#vmVm

Returns the value of the vm attribute.



20924
20925
20926
# File 'lib/ovirtsdk4/types.rb', line 20924

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.



20937
20938
20939
20940
20941
20942
# File 'lib/ovirtsdk4/types.rb', line 20937

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