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.
-
#host_labels ⇒ Array<AffinityLabel>
Returns the value of the
host_labels
attribute. -
#host_labels=(list) ⇒ Object
Sets the value of the
host_labels
attribute. -
#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. -
#priority ⇒ Float
Returns the value of the
priority
attribute. -
#priority=(value) ⇒ Object
Sets the value of the
priority
attribute. -
#vm_labels ⇒ Array<AffinityLabel>
Returns the value of the
vm_labels
attribute. -
#vm_labels=(list) ⇒ Object
Sets the value of the
vm_labels
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.
30674 30675 30676 30677 30678 30679 30680 30681 30682 30683 30684 30685 30686 |
# File 'lib/ovirtsdk4/types.rb', line 30674 def initialize(opts = {}) super(opts) 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 |
Instance Method Details
#==(other) ⇒ Object
Returns true
if self
and other
have the same attributes and values.
30691 30692 30693 30694 30695 30696 30697 30698 30699 30700 30701 30702 30703 |
# File 'lib/ovirtsdk4/types.rb', line 30691 def ==(other) super && @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 |
#cluster ⇒ Cluster
Returns the value of the cluster
attribute.
30338 30339 30340 |
# File 'lib/ovirtsdk4/types.rb', line 30338 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.
30351 30352 30353 30354 30355 30356 |
# File 'lib/ovirtsdk4/types.rb', line 30351 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.
30363 30364 30365 |
# File 'lib/ovirtsdk4/types.rb', line 30363 def comment @comment end |
#comment=(value) ⇒ Object
Sets the value of the comment
attribute.
30372 30373 30374 |
# File 'lib/ovirtsdk4/types.rb', line 30372 def comment=(value) @comment = value end |
#description ⇒ String
Returns the value of the description
attribute.
30381 30382 30383 |
# File 'lib/ovirtsdk4/types.rb', line 30381 def description @description end |
#description=(value) ⇒ Object
Sets the value of the description
attribute.
30390 30391 30392 |
# File 'lib/ovirtsdk4/types.rb', line 30390 def description=(value) @description = value end |
#enforcing ⇒ Boolean
Returns the value of the enforcing
attribute.
30399 30400 30401 |
# File 'lib/ovirtsdk4/types.rb', line 30399 def enforcing @enforcing end |
#enforcing=(value) ⇒ Object
Sets the value of the enforcing
attribute.
30408 30409 30410 |
# File 'lib/ovirtsdk4/types.rb', line 30408 def enforcing=(value) @enforcing = value end |
#hash ⇒ Object
Generates a hash value for this object.
30708 30709 30710 30711 30712 30713 30714 30715 30716 30717 30718 30719 30720 |
# File 'lib/ovirtsdk4/types.rb', line 30708 def hash super + @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 ⇒ Array<AffinityLabel>
Returns the value of the host_labels
attribute.
30417 30418 30419 |
# File 'lib/ovirtsdk4/types.rb', line 30417 def host_labels @host_labels end |
#host_labels=(list) ⇒ Object
Sets the value of the host_labels
attribute.
30426 30427 30428 30429 30430 30431 30432 30433 30434 30435 30436 |
# File 'lib/ovirtsdk4/types.rb', line 30426 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 ⇒ Array<Host>
Returns the value of the hosts
attribute.
30443 30444 30445 |
# File 'lib/ovirtsdk4/types.rb', line 30443 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
30452 30453 30454 30455 30456 30457 30458 30459 30460 30461 30462 |
# File 'lib/ovirtsdk4/types.rb', line 30452 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.
30469 30470 30471 |
# File 'lib/ovirtsdk4/types.rb', line 30469 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.
30482 30483 30484 30485 30486 30487 |
# File 'lib/ovirtsdk4/types.rb', line 30482 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.
30494 30495 30496 |
# File 'lib/ovirtsdk4/types.rb', line 30494 def id @id end |
#id=(value) ⇒ Object
Sets the value of the id
attribute.
30503 30504 30505 |
# File 'lib/ovirtsdk4/types.rb', line 30503 def id=(value) @id = value end |
#name ⇒ String
Returns the value of the name
attribute.
30512 30513 30514 |
# File 'lib/ovirtsdk4/types.rb', line 30512 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
30521 30522 30523 |
# File 'lib/ovirtsdk4/types.rb', line 30521 def name=(value) @name = value end |
#positive ⇒ Boolean
Returns the value of the positive
attribute.
30530 30531 30532 |
# File 'lib/ovirtsdk4/types.rb', line 30530 def positive @positive end |
#positive=(value) ⇒ Object
Sets the value of the positive
attribute.
30539 30540 30541 |
# File 'lib/ovirtsdk4/types.rb', line 30539 def positive=(value) @positive = value end |
#priority ⇒ Float
Returns the value of the priority
attribute.
30548 30549 30550 |
# File 'lib/ovirtsdk4/types.rb', line 30548 def priority @priority end |
#priority=(value) ⇒ Object
Sets the value of the priority
attribute.
30557 30558 30559 |
# File 'lib/ovirtsdk4/types.rb', line 30557 def priority=(value) @priority = value end |
#vm_labels ⇒ Array<AffinityLabel>
Returns the value of the vm_labels
attribute.
30566 30567 30568 |
# File 'lib/ovirtsdk4/types.rb', line 30566 def vm_labels @vm_labels end |
#vm_labels=(list) ⇒ Object
Sets the value of the vm_labels
attribute.
30575 30576 30577 30578 30579 30580 30581 30582 30583 30584 30585 |
# File 'lib/ovirtsdk4/types.rb', line 30575 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 ⇒ Array<Vm>
Returns the value of the vms
attribute.
30592 30593 30594 |
# File 'lib/ovirtsdk4/types.rb', line 30592 def vms @vms end |
#vms=(list) ⇒ Object
Sets the value of the vms
attribute.
30601 30602 30603 30604 30605 30606 30607 30608 30609 30610 30611 |
# File 'lib/ovirtsdk4/types.rb', line 30601 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.
30618 30619 30620 |
# File 'lib/ovirtsdk4/types.rb', line 30618 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.
30631 30632 30633 30634 30635 30636 |
# File 'lib/ovirtsdk4/types.rb', line 30631 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end |