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.
29662 29663 29664 29665 29666 29667 29668 29669 29670 29671 |
# File 'lib/ovirtsdk4/types.rb', line 29662 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.
29676 29677 29678 29679 29680 29681 29682 29683 29684 29685 |
# File 'lib/ovirtsdk4/types.rb', line 29676 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.
29402 29403 29404 |
# File 'lib/ovirtsdk4/types.rb', line 29402 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.
29415 29416 29417 29418 29419 29420 |
# File 'lib/ovirtsdk4/types.rb', line 29415 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.
29427 29428 29429 |
# File 'lib/ovirtsdk4/types.rb', line 29427 def comment @comment end |
#comment=(value) ⇒ Object
Sets the value of the comment
attribute.
29436 29437 29438 |
# File 'lib/ovirtsdk4/types.rb', line 29436 def comment=(value) @comment = value end |
#description ⇒ String
Returns the value of the description
attribute.
29445 29446 29447 |
# File 'lib/ovirtsdk4/types.rb', line 29445 def description @description end |
#description=(value) ⇒ Object
Sets the value of the description
attribute.
29454 29455 29456 |
# File 'lib/ovirtsdk4/types.rb', line 29454 def description=(value) @description = value end |
#enforcing ⇒ Boolean
Returns the value of the enforcing
attribute.
29463 29464 29465 |
# File 'lib/ovirtsdk4/types.rb', line 29463 def enforcing @enforcing end |
#enforcing=(value) ⇒ Object
Sets the value of the enforcing
attribute.
29472 29473 29474 |
# File 'lib/ovirtsdk4/types.rb', line 29472 def enforcing=(value) @enforcing = value end |
#hash ⇒ Object
Generates a hash value for this object.
29690 29691 29692 29693 29694 29695 29696 29697 29698 29699 |
# File 'lib/ovirtsdk4/types.rb', line 29690 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.
29481 29482 29483 |
# File 'lib/ovirtsdk4/types.rb', line 29481 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
29490 29491 29492 29493 29494 29495 29496 29497 29498 29499 29500 |
# File 'lib/ovirtsdk4/types.rb', line 29490 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.
29507 29508 29509 |
# File 'lib/ovirtsdk4/types.rb', line 29507 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.
29520 29521 29522 29523 29524 29525 |
# File 'lib/ovirtsdk4/types.rb', line 29520 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.
29532 29533 29534 |
# File 'lib/ovirtsdk4/types.rb', line 29532 def id @id end |
#id=(value) ⇒ Object
Sets the value of the id
attribute.
29541 29542 29543 |
# File 'lib/ovirtsdk4/types.rb', line 29541 def id=(value) @id = value end |
#name ⇒ String
Returns the value of the name
attribute.
29550 29551 29552 |
# File 'lib/ovirtsdk4/types.rb', line 29550 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
29559 29560 29561 |
# File 'lib/ovirtsdk4/types.rb', line 29559 def name=(value) @name = value end |
#positive ⇒ Boolean
Returns the value of the positive
attribute.
29568 29569 29570 |
# File 'lib/ovirtsdk4/types.rb', line 29568 def positive @positive end |
#positive=(value) ⇒ Object
Sets the value of the positive
attribute.
29577 29578 29579 |
# File 'lib/ovirtsdk4/types.rb', line 29577 def positive=(value) @positive = value end |
#vms ⇒ Array<Vm>
Returns the value of the vms
attribute.
29586 29587 29588 |
# File 'lib/ovirtsdk4/types.rb', line 29586 def vms @vms end |
#vms=(list) ⇒ Object
Sets the value of the vms
attribute.
29595 29596 29597 29598 29599 29600 29601 29602 29603 29604 29605 |
# File 'lib/ovirtsdk4/types.rb', line 29595 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.
29612 29613 29614 |
# File 'lib/ovirtsdk4/types.rb', line 29612 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.
29625 29626 29627 29628 29629 29630 |
# File 'lib/ovirtsdk4/types.rb', line 29625 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end |