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<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 [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 29833 def initialize(opts = {}) super(opts) self.cluster = opts[:cluster] self.enforcing = opts[:enforcing] self.hosts = opts[:hosts] self.hosts_rule = opts[:hosts_rule] self.positive = opts[:positive] 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 29847 def ==(other) super && @cluster == other.cluster && @enforcing == other.enforcing && @hosts == other.hosts && @hosts_rule == other.hosts_rule && @positive == other.positive && @vms == other.vms && @vms_rule == other.vms_rule end
Returns the value of the `cluster` attribute.
@return [Cluster]
# File lib/ovirtsdk4/types.rb, line 29573 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 29586 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 29598 def comment @comment end
Sets the value of the `comment` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 29607 def comment=(value) @comment = value end
Returns the value of the `description` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 29616 def description @description end
Sets the value of the `description` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 29625 def description=(value) @description = value end
Returns the value of the `enforcing` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 29634 def enforcing @enforcing end
Sets the value of the `enforcing` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 29643 def enforcing=(value) @enforcing = value end
Generates a hash value for this object.
# File lib/ovirtsdk4/types.rb, line 29861 def hash super + @cluster.hash + @enforcing.hash + @hosts.hash + @hosts_rule.hash + @positive.hash + @vms.hash + @vms_rule.hash end
Returns the value of the `hosts` attribute.
@return [Array<Host>]
# File lib/ovirtsdk4/types.rb, line 29652 def hosts @hosts end
Sets the value of the `hosts` attribute.
@param list [Array<Host>]
# File lib/ovirtsdk4/types.rb, line 29661 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 29678 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 29691 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 29703 def id @id end
Sets the value of the `id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 29712 def id=(value) @id = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 29721 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 29730 def name=(value) @name = value end
Returns the value of the `positive` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 29739 def positive @positive end
Sets the value of the `positive` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 29748 def positive=(value) @positive = value end
Returns the value of the `vms` attribute.
@return [Array<Vm>]
# File lib/ovirtsdk4/types.rb, line 29757 def vms @vms end
Sets the value of the `vms` attribute.
@param list [Array<Vm>]
# File lib/ovirtsdk4/types.rb, line 29766 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 29783 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 29796 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end