class OvirtSDK4::AffinityGroup

Public Class Methods

new(opts = {}) click to toggle source

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 [Boolean] :broken The value of attribute `broken`.

@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`.

Calls superclass method OvirtSDK4::Identified::new
# File lib/ovirtsdk4/types.rb, line 31381
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

Public Instance Methods

==(other) click to toggle source

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

Calls superclass method OvirtSDK4::Identified#==
# File lib/ovirtsdk4/types.rb, line 31399
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
broken() click to toggle source

Returns the value of the `broken` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 31025
def broken
  @broken
end
broken=(value) click to toggle source

Sets the value of the `broken` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 31034
def broken=(value)
  @broken = value
end
cluster() click to toggle source

Returns the value of the `cluster` attribute.

@return [Cluster]

# File lib/ovirtsdk4/types.rb, line 31043
def cluster
  @cluster
end
cluster=(value) click to toggle source

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 31056
def cluster=(value)
  if value.is_a?(Hash)
    value = Cluster.new(value)
  end
  @cluster = value
end
comment() click to toggle source

Returns the value of the `comment` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 31068
def comment
  @comment
end
comment=(value) click to toggle source

Sets the value of the `comment` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 31077
def comment=(value)
  @comment = value
end
description() click to toggle source

Returns the value of the `description` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 31086
def description
  @description
end
description=(value) click to toggle source

Sets the value of the `description` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 31095
def description=(value)
  @description = value
end
enforcing() click to toggle source

Returns the value of the `enforcing` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 31104
def enforcing
  @enforcing
end
enforcing=(value) click to toggle source

Sets the value of the `enforcing` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 31113
def enforcing=(value)
  @enforcing = value
end
hash() click to toggle source

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Identified#hash
# File lib/ovirtsdk4/types.rb, line 31417
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_labels() click to toggle source

Returns the value of the `host_labels` attribute.

@return [Array<AffinityLabel>]

# File lib/ovirtsdk4/types.rb, line 31122
def host_labels
  @host_labels
end
host_labels=(list) click to toggle source

Sets the value of the `host_labels` attribute.

@param list [Array<AffinityLabel>]

# File lib/ovirtsdk4/types.rb, line 31131
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
hosts() click to toggle source

Returns the value of the `hosts` attribute.

@return [Array<Host>]

# File lib/ovirtsdk4/types.rb, line 31148
def hosts
  @hosts
end
hosts=(list) click to toggle source

Sets the value of the `hosts` attribute.

@param list [Array<Host>]

# File lib/ovirtsdk4/types.rb, line 31157
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_rule() click to toggle source

Returns the value of the `hosts_rule` attribute.

@return [AffinityRule]

# File lib/ovirtsdk4/types.rb, line 31174
def hosts_rule
  @hosts_rule
end
hosts_rule=(value) click to toggle source

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 31187
def hosts_rule=(value)
  if value.is_a?(Hash)
    value = AffinityRule.new(value)
  end
  @hosts_rule = value
end
id() click to toggle source

Returns the value of the `id` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 31199
def id
  @id
end
id=(value) click to toggle source

Sets the value of the `id` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 31208
def id=(value)
  @id = value
end
name() click to toggle source

Returns the value of the `name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 31217
def name
  @name
end
name=(value) click to toggle source

Sets the value of the `name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 31226
def name=(value)
  @name = value
end
positive() click to toggle source

Returns the value of the `positive` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 31235
def positive
  @positive
end
positive=(value) click to toggle source

Sets the value of the `positive` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 31244
def positive=(value)
  @positive = value
end
priority() click to toggle source

Returns the value of the `priority` attribute.

@return [Float]

# File lib/ovirtsdk4/types.rb, line 31253
def priority
  @priority
end
priority=(value) click to toggle source

Sets the value of the `priority` attribute.

@param value [Float]

# File lib/ovirtsdk4/types.rb, line 31262
def priority=(value)
  @priority = value
end
vm_labels() click to toggle source

Returns the value of the `vm_labels` attribute.

@return [Array<AffinityLabel>]

# File lib/ovirtsdk4/types.rb, line 31271
def vm_labels
  @vm_labels
end
vm_labels=(list) click to toggle source

Sets the value of the `vm_labels` attribute.

@param list [Array<AffinityLabel>]

# File lib/ovirtsdk4/types.rb, line 31280
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
vms() click to toggle source

Returns the value of the `vms` attribute.

@return [Array<Vm>]

# File lib/ovirtsdk4/types.rb, line 31297
def vms
  @vms
end
vms=(list) click to toggle source

Sets the value of the `vms` attribute.

@param list [Array<Vm>]

# File lib/ovirtsdk4/types.rb, line 31306
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_rule() click to toggle source

Returns the value of the `vms_rule` attribute.

@return [AffinityRule]

# File lib/ovirtsdk4/types.rb, line 31323
def vms_rule
  @vms_rule
end
vms_rule=(value) click to toggle source

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 31336
def vms_rule=(value)
  if value.is_a?(Hash)
    value = AffinityRule.new(value)
  end
  @vms_rule = value
end