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.


20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
# 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

Instance Method Details

#==(other) ⇒ Object

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


20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
# 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

#brickGlusterBrick

Returns the value of the brick attribute.

Returns:


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

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:


19713
19714
19715
19716
19717
19718
# File 'lib/ovirtsdk4/types.rb', line 19713

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)

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

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

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

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

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

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

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

def description=(value)
  @description = value
end

#diskDisk

Returns the value of the disk attribute.

Returns:


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

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)

19774
19775
19776
19777
19778
19779
# File 'lib/ovirtsdk4/types.rb', line 19774

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:


19786
19787
19788
# File 'lib/ovirtsdk4/types.rb', line 19786

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:


19799
19800
19801
19802
19803
19804
# 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

#hashObject

Generates a hash value for this object.


20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
# 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

#hostHost

Returns the value of the host attribute.

Returns:


19811
19812
19813
# File 'lib/ovirtsdk4/types.rb', line 19811

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)

19824
19825
19826
19827
19828
19829
# File 'lib/ovirtsdk4/types.rb', line 19824

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:


19836
19837
19838
# File 'lib/ovirtsdk4/types.rb', line 19836

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:


19849
19850
19851
19852
19853
19854
# 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_nodeNumaNode

Returns the value of the host_numa_node attribute.

Returns:


19861
19862
19863
# File 'lib/ovirtsdk4/types.rb', line 19861

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:


19874
19875
19876
19877
19878
19879
# 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

#idString

Returns the value of the id attribute.

Returns:

  • (String)

19886
19887
19888
# File 'lib/ovirtsdk4/types.rb', line 19886

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

19895
19896
19897
# File 'lib/ovirtsdk4/types.rb', line 19895

def id=(value)
  @id = value
end

#kindStatisticKind

Returns the value of the kind attribute.

Returns:


19904
19905
19906
# File 'lib/ovirtsdk4/types.rb', line 19904

def kind
  @kind
end

#kind=(value) ⇒ Object

Sets the value of the kind attribute.

Parameters:


19913
19914
19915
# File 'lib/ovirtsdk4/types.rb', line 19913

def kind=(value)
  @kind = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

19922
19923
19924
# File 'lib/ovirtsdk4/types.rb', line 19922

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

19931
19932
19933
# File 'lib/ovirtsdk4/types.rb', line 19931

def name=(value)
  @name = value
end

#nicNic

Returns the value of the nic attribute.

Returns:


19940
19941
19942
# File 'lib/ovirtsdk4/types.rb', line 19940

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)

19953
19954
19955
19956
19957
19958
# File 'lib/ovirtsdk4/types.rb', line 19953

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:


19965
19966
19967
# File 'lib/ovirtsdk4/types.rb', line 19965

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)

19978
19979
19980
19981
19982
19983
# File 'lib/ovirtsdk4/types.rb', line 19978

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:


19990
19991
19992
# File 'lib/ovirtsdk4/types.rb', line 19990

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:


19999
20000
20001
# File 'lib/ovirtsdk4/types.rb', line 19999

def type=(value)
  @type = value
end

#unitStatisticUnit

Returns the value of the unit attribute.

Returns:


20008
20009
20010
# File 'lib/ovirtsdk4/types.rb', line 20008

def unit
  @unit
end

#unit=(value) ⇒ Object

Sets the value of the unit attribute.

Parameters:


20017
20018
20019
# File 'lib/ovirtsdk4/types.rb', line 20017

def unit=(value)
  @unit = value
end

#valuesArray<Value>

Returns the value of the values attribute.

Returns:


20026
20027
20028
# File 'lib/ovirtsdk4/types.rb', line 20026

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.

Parameters:


20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
# 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

#vmVm

Returns the value of the vm attribute.

Returns:


20052
20053
20054
# File 'lib/ovirtsdk4/types.rb', line 20052

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)

20065
20066
20067
20068
20069
20070
# File 'lib/ovirtsdk4/types.rb', line 20065

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