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.



20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
# File 'lib/ovirtsdk4/types.rb', line 20716

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.



20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
# File 'lib/ovirtsdk4/types.rb', line 20736

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:



20302
20303
20304
# File 'lib/ovirtsdk4/types.rb', line 20302

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:



20315
20316
20317
20318
20319
20320
# File 'lib/ovirtsdk4/types.rb', line 20315

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)


20327
20328
20329
# File 'lib/ovirtsdk4/types.rb', line 20327

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


20336
20337
20338
# File 'lib/ovirtsdk4/types.rb', line 20336

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


20345
20346
20347
# File 'lib/ovirtsdk4/types.rb', line 20345

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


20354
20355
20356
# File 'lib/ovirtsdk4/types.rb', line 20354

def description=(value)
  @description = value
end

#diskDisk

Returns the value of the disk attribute.

Returns:



20363
20364
20365
# File 'lib/ovirtsdk4/types.rb', line 20363

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)


20376
20377
20378
20379
20380
20381
# File 'lib/ovirtsdk4/types.rb', line 20376

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:



20388
20389
20390
# File 'lib/ovirtsdk4/types.rb', line 20388

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:



20401
20402
20403
20404
20405
20406
# File 'lib/ovirtsdk4/types.rb', line 20401

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.



20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
# File 'lib/ovirtsdk4/types.rb', line 20756

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:



20413
20414
20415
# File 'lib/ovirtsdk4/types.rb', line 20413

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)


20426
20427
20428
20429
20430
20431
# File 'lib/ovirtsdk4/types.rb', line 20426

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:



20438
20439
20440
# File 'lib/ovirtsdk4/types.rb', line 20438

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:



20451
20452
20453
20454
20455
20456
# File 'lib/ovirtsdk4/types.rb', line 20451

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:



20463
20464
20465
# File 'lib/ovirtsdk4/types.rb', line 20463

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:



20476
20477
20478
20479
20480
20481
# File 'lib/ovirtsdk4/types.rb', line 20476

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)


20488
20489
20490
# File 'lib/ovirtsdk4/types.rb', line 20488

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


20497
20498
20499
# File 'lib/ovirtsdk4/types.rb', line 20497

def id=(value)
  @id = value
end

#kindStatisticKind

Returns the value of the kind attribute.

Returns:



20506
20507
20508
# File 'lib/ovirtsdk4/types.rb', line 20506

def kind
  @kind
end

#kind=(value) ⇒ Object

Sets the value of the kind attribute.

Parameters:



20515
20516
20517
# File 'lib/ovirtsdk4/types.rb', line 20515

def kind=(value)
  @kind = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


20524
20525
20526
# File 'lib/ovirtsdk4/types.rb', line 20524

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


20533
20534
20535
# File 'lib/ovirtsdk4/types.rb', line 20533

def name=(value)
  @name = value
end

#nicNic

Returns the value of the nic attribute.

Returns:



20542
20543
20544
# File 'lib/ovirtsdk4/types.rb', line 20542

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)


20555
20556
20557
20558
20559
20560
# File 'lib/ovirtsdk4/types.rb', line 20555

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:



20567
20568
20569
# File 'lib/ovirtsdk4/types.rb', line 20567

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)


20580
20581
20582
20583
20584
20585
# File 'lib/ovirtsdk4/types.rb', line 20580

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:



20592
20593
20594
# File 'lib/ovirtsdk4/types.rb', line 20592

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:



20601
20602
20603
# File 'lib/ovirtsdk4/types.rb', line 20601

def type=(value)
  @type = value
end

#unitStatisticUnit

Returns the value of the unit attribute.

Returns:



20610
20611
20612
# File 'lib/ovirtsdk4/types.rb', line 20610

def unit
  @unit
end

#unit=(value) ⇒ Object

Sets the value of the unit attribute.

Parameters:



20619
20620
20621
# File 'lib/ovirtsdk4/types.rb', line 20619

def unit=(value)
  @unit = value
end

#valuesArray<Value>

Returns the value of the values attribute.

Returns:



20628
20629
20630
# File 'lib/ovirtsdk4/types.rb', line 20628

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.

Parameters:



20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
# File 'lib/ovirtsdk4/types.rb', line 20637

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:



20654
20655
20656
# File 'lib/ovirtsdk4/types.rb', line 20654

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)


20667
20668
20669
20670
20671
20672
# File 'lib/ovirtsdk4/types.rb', line 20667

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