class OvirtSDK4::AffinityGroup
Public Class Methods
Creates a new instance of the {AffinityGroup} class.
@param opts [Hash] 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.
@option opts [Cluster, Hash] :cluster The value of attribute `cluster`.
@option opts [String] :comment The value of attribute `comment`.
@option opts [String] :description The value of attribute `description`.
@option opts [Boolean] :enforcing The value of attribute `enforcing`.
@option opts [Array<AffinityLabel>, Array<Hash>] :host_labels The values of attribute `host_labels`.
@option opts [Array<Host>, Array<Hash>] :hosts The values of attribute `hosts`.
@option opts [AffinityRule, Hash] :hosts_rule The value of attribute `hosts_rule`.
@option opts [String] :id The value of attribute `id`.
@option opts [String] :name The value of attribute `name`.
@option opts [Boolean] :positive The value of attribute `positive`.
@option opts [Float] :priority The value of attribute `priority`.
@option opts [Array<AffinityLabel>, Array<Hash>] :vm_labels The values of attribute `vm_labels`.
@option opts [Array<Vm>, Array<Hash>] :vms The values of attribute `vms`.
@option opts [AffinityRule, Hash] :vms_rule The value of attribute `vms_rule`.
# File lib/ovirtsdk4/types.rb, line 30674 def initialize(opts = {}) super(opts) 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
Public Instance Methods
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 30691 def ==(other) super && @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
Returns the value of the `cluster` attribute.
@return [Cluster]
# File lib/ovirtsdk4/types.rb, line 30338 def cluster @cluster end
Sets the value of the `cluster` attribute.
@param value [Cluster, Hash]
The `value` parameter can be an instance of {OvirtSDK4::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.
# File lib/ovirtsdk4/types.rb, line 30351 def cluster=(value) if value.is_a?(Hash) value = Cluster.new(value) end @cluster = value end
Returns the value of the `comment` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 30363 def comment @comment end
Sets the value of the `comment` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 30372 def comment=(value) @comment = value end
Returns the value of the `description` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 30381 def description @description end
Sets the value of the `description` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 30390 def description=(value) @description = value end
Returns the value of the `enforcing` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 30399 def enforcing @enforcing end
Sets the value of the `enforcing` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 30408 def enforcing=(value) @enforcing = value end
Generates a hash value for this object.
# File lib/ovirtsdk4/types.rb, line 30708 def hash super + @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
Returns the value of the `host_labels` attribute.
@return [Array<AffinityLabel>]
# File lib/ovirtsdk4/types.rb, line 30417 def host_labels @host_labels end
Sets the value of the `host_labels` attribute.
@param list [Array<AffinityLabel>]
# File lib/ovirtsdk4/types.rb, line 30426 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
Returns the value of the `hosts` attribute.
@return [Array<Host>]
# File lib/ovirtsdk4/types.rb, line 30443 def hosts @hosts end
Sets the value of the `hosts` attribute.
@param list [Array<Host>]
# File lib/ovirtsdk4/types.rb, line 30452 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
Returns the value of the `hosts_rule` attribute.
@return [AffinityRule]
# File lib/ovirtsdk4/types.rb, line 30469 def hosts_rule @hosts_rule end
Sets the value of the `hosts_rule` attribute.
@param value [AffinityRule, Hash]
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.
# File lib/ovirtsdk4/types.rb, line 30482 def hosts_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @hosts_rule = value end
Returns the value of the `id` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 30494 def id @id end
Sets the value of the `id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 30503 def id=(value) @id = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 30512 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 30521 def name=(value) @name = value end
Returns the value of the `positive` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 30530 def positive @positive end
Sets the value of the `positive` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 30539 def positive=(value) @positive = value end
Returns the value of the `priority` attribute.
@return [Float]
# File lib/ovirtsdk4/types.rb, line 30548 def priority @priority end
Sets the value of the `priority` attribute.
@param value [Float]
# File lib/ovirtsdk4/types.rb, line 30557 def priority=(value) @priority = value end
Returns the value of the `vm_labels` attribute.
@return [Array<AffinityLabel>]
# File lib/ovirtsdk4/types.rb, line 30566 def vm_labels @vm_labels end
Sets the value of the `vm_labels` attribute.
@param list [Array<AffinityLabel>]
# File lib/ovirtsdk4/types.rb, line 30575 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
Returns the value of the `vms` attribute.
@return [Array<Vm>]
# File lib/ovirtsdk4/types.rb, line 30592 def vms @vms end
Sets the value of the `vms` attribute.
@param list [Array<Vm>]
# File lib/ovirtsdk4/types.rb, line 30601 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
Returns the value of the `vms_rule` attribute.
@return [AffinityRule]
# File lib/ovirtsdk4/types.rb, line 30618 def vms_rule @vms_rule end
Sets the value of the `vms_rule` attribute.
@param value [AffinityRule, Hash]
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.
# File lib/ovirtsdk4/types.rb, line 30631 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end