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
trueifselfandotherhave the same attributes and values. -
#cluster ⇒ Cluster
Returns the value of the
clusterattribute. -
#cluster=(value) ⇒ Object
Sets the value of the
clusterattribute. -
#comment ⇒ String
Returns the value of the
commentattribute. -
#comment=(value) ⇒ Object
Sets the value of the
commentattribute. -
#description ⇒ String
Returns the value of the
descriptionattribute. -
#description=(value) ⇒ Object
Sets the value of the
descriptionattribute. -
#enforcing ⇒ Boolean
Returns the value of the
enforcingattribute. -
#enforcing=(value) ⇒ Object
Sets the value of the
enforcingattribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#hosts ⇒ Array<Host>
Returns the value of the
hostsattribute. -
#hosts=(list) ⇒ Object
Sets the value of the
hostsattribute. -
#hosts_rule ⇒ AffinityRule
Returns the value of the
hosts_ruleattribute. -
#hosts_rule=(value) ⇒ Object
Sets the value of the
hosts_ruleattribute. -
#id ⇒ String
Returns the value of the
idattribute. -
#id=(value) ⇒ Object
Sets the value of the
idattribute. -
#initialize(opts = {}) ⇒ AffinityGroup
constructor
Creates a new instance of the AffinityGroup class.
-
#name ⇒ String
Returns the value of the
nameattribute. -
#name=(value) ⇒ Object
Sets the value of the
nameattribute. -
#positive ⇒ Boolean
Returns the value of the
positiveattribute. -
#positive=(value) ⇒ Object
Sets the value of the
positiveattribute. -
#vms ⇒ Array<Vm>
Returns the value of the
vmsattribute. -
#vms=(list) ⇒ Object
Sets the value of the
vmsattribute. -
#vms_rule ⇒ AffinityRule
Returns the value of the
vms_ruleattribute. -
#vms_rule=(value) ⇒ Object
Sets the value of the
vms_ruleattribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ AffinityGroup
Creates a new instance of the OvirtSDK4::AffinityGroup class.
29540 29541 29542 29543 29544 29545 29546 29547 29548 29549 |
# File 'lib/ovirtsdk4/types.rb', line 29540 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.
29554 29555 29556 29557 29558 29559 29560 29561 29562 29563 |
# File 'lib/ovirtsdk4/types.rb', line 29554 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.
29280 29281 29282 |
# File 'lib/ovirtsdk4/types.rb', line 29280 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.
29293 29294 29295 29296 29297 29298 |
# File 'lib/ovirtsdk4/types.rb', line 29293 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.
29305 29306 29307 |
# File 'lib/ovirtsdk4/types.rb', line 29305 def comment @comment end |
#comment=(value) ⇒ Object
Sets the value of the comment attribute.
29314 29315 29316 |
# File 'lib/ovirtsdk4/types.rb', line 29314 def comment=(value) @comment = value end |
#description ⇒ String
Returns the value of the description attribute.
29323 29324 29325 |
# File 'lib/ovirtsdk4/types.rb', line 29323 def description @description end |
#description=(value) ⇒ Object
Sets the value of the description attribute.
29332 29333 29334 |
# File 'lib/ovirtsdk4/types.rb', line 29332 def description=(value) @description = value end |
#enforcing ⇒ Boolean
Returns the value of the enforcing attribute.
29341 29342 29343 |
# File 'lib/ovirtsdk4/types.rb', line 29341 def enforcing @enforcing end |
#enforcing=(value) ⇒ Object
Sets the value of the enforcing attribute.
29350 29351 29352 |
# File 'lib/ovirtsdk4/types.rb', line 29350 def enforcing=(value) @enforcing = value end |
#hash ⇒ Object
Generates a hash value for this object.
29568 29569 29570 29571 29572 29573 29574 29575 29576 29577 |
# File 'lib/ovirtsdk4/types.rb', line 29568 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.
29359 29360 29361 |
# File 'lib/ovirtsdk4/types.rb', line 29359 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts attribute.
29368 29369 29370 29371 29372 29373 29374 29375 29376 29377 29378 |
# File 'lib/ovirtsdk4/types.rb', line 29368 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.
29385 29386 29387 |
# File 'lib/ovirtsdk4/types.rb', line 29385 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.
29398 29399 29400 29401 29402 29403 |
# File 'lib/ovirtsdk4/types.rb', line 29398 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.
29410 29411 29412 |
# File 'lib/ovirtsdk4/types.rb', line 29410 def id @id end |
#id=(value) ⇒ Object
Sets the value of the id attribute.
29419 29420 29421 |
# File 'lib/ovirtsdk4/types.rb', line 29419 def id=(value) @id = value end |
#name ⇒ String
Returns the value of the name attribute.
29428 29429 29430 |
# File 'lib/ovirtsdk4/types.rb', line 29428 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name attribute.
29437 29438 29439 |
# File 'lib/ovirtsdk4/types.rb', line 29437 def name=(value) @name = value end |
#positive ⇒ Boolean
Returns the value of the positive attribute.
29446 29447 29448 |
# File 'lib/ovirtsdk4/types.rb', line 29446 def positive @positive end |
#positive=(value) ⇒ Object
Sets the value of the positive attribute.
29455 29456 29457 |
# File 'lib/ovirtsdk4/types.rb', line 29455 def positive=(value) @positive = value end |
#vms ⇒ Array<Vm>
Returns the value of the vms attribute.
29464 29465 29466 |
# File 'lib/ovirtsdk4/types.rb', line 29464 def vms @vms end |
#vms=(list) ⇒ Object
Sets the value of the vms attribute.
29473 29474 29475 29476 29477 29478 29479 29480 29481 29482 29483 |
# File 'lib/ovirtsdk4/types.rb', line 29473 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.
29490 29491 29492 |
# File 'lib/ovirtsdk4/types.rb', line 29490 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.
29503 29504 29505 29506 29507 29508 |
# File 'lib/ovirtsdk4/types.rb', line 29503 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end |