Class: OvirtSDK4::AffinityGroup

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 = {}) ⇒ AffinityGroup

Creates a new instance of the OvirtSDK4::AffinityGroup 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):

  • :broken (Boolean)

    The value of attribute broken.

  • :cluster (Cluster, Hash)

    The value of attribute cluster.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :enforcing (Boolean)

    The value of attribute enforcing.

  • :host_labels (Array<AffinityLabel>, Array<Hash>)

    The values of attribute host_labels.

  • :hosts (Array<Host>, Array<Hash>)

    The values of attribute hosts.

  • :hosts_rule (AffinityRule, Hash)

    The value of attribute hosts_rule.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :positive (Boolean)

    The value of attribute positive.

  • :priority (Float)

    The value of attribute priority.

  • :vm_labels (Array<AffinityLabel>, Array<Hash>)

    The values of attribute vm_labels.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.

  • :vms_rule (AffinityRule, Hash)

    The value of attribute vms_rule.



31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
# File 'lib/ovirtsdk4/types.rb', line 31674

def initialize(opts = {})
  super(opts)
  self.broken = opts[:broken]
  self.cluster = opts[:cluster]
  self.enforcing = opts[:enforcing]
  self.host_labels = opts[:host_labels]
  self.hosts = opts[:hosts]
  self.hosts_rule = opts[:hosts_rule]
  self.positive = opts[:positive]
  self.priority = opts[:priority]
  self.vm_labels = opts[:vm_labels]
  self.vms = opts[:vms]
  self.vms_rule = opts[:vms_rule]
end

Instance Method Details

#==(other) ⇒ Object

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



31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
# File 'lib/ovirtsdk4/types.rb', line 31692

def ==(other)
  super &&
  @broken == other.broken &&
  @cluster == other.cluster &&
  @enforcing == other.enforcing &&
  @host_labels == other.host_labels &&
  @hosts == other.hosts &&
  @hosts_rule == other.hosts_rule &&
  @positive == other.positive &&
  @priority == other.priority &&
  @vm_labels == other.vm_labels &&
  @vms == other.vms &&
  @vms_rule == other.vms_rule
end

#brokenBoolean

Returns the value of the broken attribute.

Returns:

  • (Boolean)


31318
31319
31320
# File 'lib/ovirtsdk4/types.rb', line 31318

def broken
  @broken
end

#broken=(value) ⇒ Object

Sets the value of the broken attribute.

Parameters:

  • value (Boolean)


31327
31328
31329
# File 'lib/ovirtsdk4/types.rb', line 31327

def broken=(value)
  @broken = value
end

#clusterCluster

Returns the value of the cluster attribute.

Returns:



31336
31337
31338
# File 'lib/ovirtsdk4/types.rb', line 31336

def cluster
  @cluster
end

#cluster=(value) ⇒ Object

Sets the value of the cluster attribute.

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



31349
31350
31351
31352
31353
31354
# File 'lib/ovirtsdk4/types.rb', line 31349

def cluster=(value)
  if value.is_a?(Hash)
    value = Cluster.new(value)
  end
  @cluster = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


31361
31362
31363
# File 'lib/ovirtsdk4/types.rb', line 31361

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


31370
31371
31372
# File 'lib/ovirtsdk4/types.rb', line 31370

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


31379
31380
31381
# File 'lib/ovirtsdk4/types.rb', line 31379

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


31388
31389
31390
# File 'lib/ovirtsdk4/types.rb', line 31388

def description=(value)
  @description = value
end

#enforcingBoolean

Returns the value of the enforcing attribute.

Returns:

  • (Boolean)


31397
31398
31399
# File 'lib/ovirtsdk4/types.rb', line 31397

def enforcing
  @enforcing
end

#enforcing=(value) ⇒ Object

Sets the value of the enforcing attribute.

Parameters:

  • value (Boolean)


31406
31407
31408
# File 'lib/ovirtsdk4/types.rb', line 31406

def enforcing=(value)
  @enforcing = value
end

#hashObject

Generates a hash value for this object.



31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
# File 'lib/ovirtsdk4/types.rb', line 31710

def hash
  super +
  @broken.hash +
  @cluster.hash +
  @enforcing.hash +
  @host_labels.hash +
  @hosts.hash +
  @hosts_rule.hash +
  @positive.hash +
  @priority.hash +
  @vm_labels.hash +
  @vms.hash +
  @vms_rule.hash
end

#host_labelsArray<AffinityLabel>

Returns the value of the host_labels attribute.

Returns:



31415
31416
31417
# File 'lib/ovirtsdk4/types.rb', line 31415

def host_labels
  @host_labels
end

#host_labels=(list) ⇒ Object

Sets the value of the host_labels attribute.

Parameters:



31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
# File 'lib/ovirtsdk4/types.rb', line 31424

def host_labels=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = AffinityLabel.new(value)
      end
    end
  end
  @host_labels = list
end

#hostsArray<Host>

Returns the value of the hosts attribute.

Returns:



31441
31442
31443
# File 'lib/ovirtsdk4/types.rb', line 31441

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)


31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
# File 'lib/ovirtsdk4/types.rb', line 31450

def hosts=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Host.new(value)
      end
    end
  end
  @hosts = list
end

#hosts_ruleAffinityRule

Returns the value of the hosts_rule attribute.

Returns:



31467
31468
31469
# File 'lib/ovirtsdk4/types.rb', line 31467

def hosts_rule
  @hosts_rule
end

#hosts_rule=(value) ⇒ Object

Sets the value of the hosts_rule attribute.

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



31480
31481
31482
31483
31484
31485
# File 'lib/ovirtsdk4/types.rb', line 31480

def hosts_rule=(value)
  if value.is_a?(Hash)
    value = AffinityRule.new(value)
  end
  @hosts_rule = value
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


31492
31493
31494
# File 'lib/ovirtsdk4/types.rb', line 31492

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


31501
31502
31503
# File 'lib/ovirtsdk4/types.rb', line 31501

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


31510
31511
31512
# File 'lib/ovirtsdk4/types.rb', line 31510

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


31519
31520
31521
# File 'lib/ovirtsdk4/types.rb', line 31519

def name=(value)
  @name = value
end

#positiveBoolean

Returns the value of the positive attribute.

Returns:

  • (Boolean)


31528
31529
31530
# File 'lib/ovirtsdk4/types.rb', line 31528

def positive
  @positive
end

#positive=(value) ⇒ Object

Sets the value of the positive attribute.

Parameters:

  • value (Boolean)


31537
31538
31539
# File 'lib/ovirtsdk4/types.rb', line 31537

def positive=(value)
  @positive = value
end

#priorityFloat

Returns the value of the priority attribute.

Returns:

  • (Float)


31546
31547
31548
# File 'lib/ovirtsdk4/types.rb', line 31546

def priority
  @priority
end

#priority=(value) ⇒ Object

Sets the value of the priority attribute.

Parameters:

  • value (Float)


31555
31556
31557
# File 'lib/ovirtsdk4/types.rb', line 31555

def priority=(value)
  @priority = value
end

#vm_labelsArray<AffinityLabel>

Returns the value of the vm_labels attribute.

Returns:



31564
31565
31566
# File 'lib/ovirtsdk4/types.rb', line 31564

def vm_labels
  @vm_labels
end

#vm_labels=(list) ⇒ Object

Sets the value of the vm_labels attribute.

Parameters:



31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
# File 'lib/ovirtsdk4/types.rb', line 31573

def vm_labels=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = AffinityLabel.new(value)
      end
    end
  end
  @vm_labels = list
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


31590
31591
31592
# File 'lib/ovirtsdk4/types.rb', line 31590

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
# File 'lib/ovirtsdk4/types.rb', line 31599

def vms=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Vm.new(value)
      end
    end
  end
  @vms = list
end

#vms_ruleAffinityRule

Returns the value of the vms_rule attribute.

Returns:



31616
31617
31618
# File 'lib/ovirtsdk4/types.rb', line 31616

def vms_rule
  @vms_rule
end

#vms_rule=(value) ⇒ Object

Sets the value of the vms_rule attribute.

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



31629
31630
31631
31632
31633
31634
# File 'lib/ovirtsdk4/types.rb', line 31629

def vms_rule=(value)
  if value.is_a?(Hash)
    value = AffinityRule.new(value)
  end
  @vms_rule = value
end