Class: OvirtSDK4::VmPlacementPolicy

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (VmPlacementPolicy) initialize(opts = {})

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

  • :affinity (VmAffinity)

    The value of attribute affinity.

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

    The values of attribute hosts.



19674
19675
19676
19677
19678
# File 'lib/ovirtsdk4/types.rb', line 19674

def initialize(opts = {})
  super(opts)
  self.affinity = opts[:affinity]
  self.hosts = opts[:hosts]
end

Instance Method Details

- (VmAffinity) affinity

Returns the value of the affinity attribute.

Returns:



19624
19625
19626
# File 'lib/ovirtsdk4/types.rb', line 19624

def affinity
  return @affinity
end

- (Object) affinity=(value)

Sets the value of the affinity attribute.

Parameters:



19633
19634
19635
# File 'lib/ovirtsdk4/types.rb', line 19633

def affinity=(value)
  @affinity = value
end

- (Array<Host>) hosts

Returns the value of the hosts attribute.

Returns:



19642
19643
19644
# File 'lib/ovirtsdk4/types.rb', line 19642

def hosts
  return @hosts
end

- (Object) hosts=(list)

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)


19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
# File 'lib/ovirtsdk4/types.rb', line 19650

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