Class: OvirtSDK4::AffinityGroup
- Inherits:
-
Identified
- Object
- Struct
- Identified
- OvirtSDK4::AffinityGroup
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
true
ifself
andother
have the same attributes and values. -
#cluster ⇒ Cluster
Returns the value of the
cluster
attribute. -
#cluster=(value) ⇒ Object
Sets the value of the
cluster
attribute. -
#comment ⇒ String
Returns the value of the
comment
attribute. -
#comment=(value) ⇒ Object
Sets the value of the
comment
attribute. -
#description ⇒ String
Returns the value of the
description
attribute. -
#description=(value) ⇒ Object
Sets the value of the
description
attribute. -
#enforcing ⇒ Boolean
Returns the value of the
enforcing
attribute. -
#enforcing=(value) ⇒ Object
Sets the value of the
enforcing
attribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#hosts ⇒ Array<Host>
Returns the value of the
hosts
attribute. -
#hosts=(list) ⇒ Object
Sets the value of the
hosts
attribute. -
#hosts_rule ⇒ AffinityRule
Returns the value of the
hosts_rule
attribute. -
#hosts_rule=(value) ⇒ Object
Sets the value of the
hosts_rule
attribute. -
#id ⇒ String
Returns the value of the
id
attribute. -
#id=(value) ⇒ Object
Sets the value of the
id
attribute. -
#initialize(opts = {}) ⇒ AffinityGroup
constructor
Creates a new instance of the AffinityGroup class.
-
#name ⇒ String
Returns the value of the
name
attribute. -
#name=(value) ⇒ Object
Sets the value of the
name
attribute. -
#positive ⇒ Boolean
Returns the value of the
positive
attribute. -
#positive=(value) ⇒ Object
Sets the value of the
positive
attribute. -
#vms ⇒ Array<Vm>
Returns the value of the
vms
attribute. -
#vms=(list) ⇒ Object
Sets the value of the
vms
attribute. -
#vms_rule ⇒ AffinityRule
Returns the value of the
vms_rule
attribute. -
#vms_rule=(value) ⇒ Object
Sets the value of the
vms_rule
attribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ AffinityGroup
Creates a new instance of the OvirtSDK4::AffinityGroup class.
29833 29834 29835 29836 29837 29838 29839 29840 29841 29842 |
# 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 |
Instance Method Details
#==(other) ⇒ Object
Returns true
if self
and other
have the same attributes and values.
29847 29848 29849 29850 29851 29852 29853 29854 29855 29856 |
# 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 |
#cluster ⇒ Cluster
Returns the value of the cluster
attribute.
29573 29574 29575 |
# File 'lib/ovirtsdk4/types.rb', line 29573 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.
29586 29587 29588 29589 29590 29591 |
# File 'lib/ovirtsdk4/types.rb', line 29586 def cluster=(value) if value.is_a?(Hash) value = Cluster.new(value) end @cluster = value end |
#comment ⇒ String
Returns the value of the comment
attribute.
29598 29599 29600 |
# File 'lib/ovirtsdk4/types.rb', line 29598 def comment @comment end |
#comment=(value) ⇒ Object
Sets the value of the comment
attribute.
29607 29608 29609 |
# File 'lib/ovirtsdk4/types.rb', line 29607 def comment=(value) @comment = value end |
#description ⇒ String
Returns the value of the description
attribute.
29616 29617 29618 |
# File 'lib/ovirtsdk4/types.rb', line 29616 def description @description end |
#description=(value) ⇒ Object
Sets the value of the description
attribute.
29625 29626 29627 |
# File 'lib/ovirtsdk4/types.rb', line 29625 def description=(value) @description = value end |
#enforcing ⇒ Boolean
Returns the value of the enforcing
attribute.
29634 29635 29636 |
# File 'lib/ovirtsdk4/types.rb', line 29634 def enforcing @enforcing end |
#enforcing=(value) ⇒ Object
Sets the value of the enforcing
attribute.
29643 29644 29645 |
# File 'lib/ovirtsdk4/types.rb', line 29643 def enforcing=(value) @enforcing = value end |
#hash ⇒ Object
Generates a hash value for this object.
29861 29862 29863 29864 29865 29866 29867 29868 29869 29870 |
# 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 |
#hosts ⇒ Array<Host>
Returns the value of the hosts
attribute.
29652 29653 29654 |
# File 'lib/ovirtsdk4/types.rb', line 29652 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
29661 29662 29663 29664 29665 29666 29667 29668 29669 29670 29671 |
# 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 |
#hosts_rule ⇒ AffinityRule
Returns the value of the hosts_rule
attribute.
29678 29679 29680 |
# File 'lib/ovirtsdk4/types.rb', line 29678 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.
29691 29692 29693 29694 29695 29696 |
# 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 |
#id ⇒ String
Returns the value of the id
attribute.
29703 29704 29705 |
# File 'lib/ovirtsdk4/types.rb', line 29703 def id @id end |
#id=(value) ⇒ Object
Sets the value of the id
attribute.
29712 29713 29714 |
# File 'lib/ovirtsdk4/types.rb', line 29712 def id=(value) @id = value end |
#name ⇒ String
Returns the value of the name
attribute.
29721 29722 29723 |
# File 'lib/ovirtsdk4/types.rb', line 29721 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
29730 29731 29732 |
# File 'lib/ovirtsdk4/types.rb', line 29730 def name=(value) @name = value end |
#positive ⇒ Boolean
Returns the value of the positive
attribute.
29739 29740 29741 |
# File 'lib/ovirtsdk4/types.rb', line 29739 def positive @positive end |
#positive=(value) ⇒ Object
Sets the value of the positive
attribute.
29748 29749 29750 |
# File 'lib/ovirtsdk4/types.rb', line 29748 def positive=(value) @positive = value end |
#vms ⇒ Array<Vm>
Returns the value of the vms
attribute.
29757 29758 29759 |
# File 'lib/ovirtsdk4/types.rb', line 29757 def vms @vms end |
#vms=(list) ⇒ Object
Sets the value of the vms
attribute.
29766 29767 29768 29769 29770 29771 29772 29773 29774 29775 29776 |
# 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 |
#vms_rule ⇒ AffinityRule
Returns the value of the vms_rule
attribute.
29783 29784 29785 |
# File 'lib/ovirtsdk4/types.rb', line 29783 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.
29796 29797 29798 29799 29800 29801 |
# 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 |