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. -
#broken ⇒ Boolean
Returns the value of the
broken
attribute. -
#broken=(value) ⇒ Object
Sets the value of the
broken
attribute. -
#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.
31381 31382 31383 31384 31385 31386 31387 31388 31389 31390 31391 31392 31393 31394 |
# File 'lib/ovirtsdk4/types.rb', line 31381 def initialize(opts = {}) super(opts) self.broken = opts[:broken] 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.
31399 31400 31401 31402 31403 31404 31405 31406 31407 31408 31409 31410 31411 31412 |
# File 'lib/ovirtsdk4/types.rb', line 31399 def ==(other) super && @broken == other.broken && @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 |
#broken ⇒ Boolean
Returns the value of the broken
attribute.
31025 31026 31027 |
# File 'lib/ovirtsdk4/types.rb', line 31025 def broken @broken end |
#broken=(value) ⇒ Object
Sets the value of the broken
attribute.
31034 31035 31036 |
# File 'lib/ovirtsdk4/types.rb', line 31034 def broken=(value) @broken = value end |
#cluster ⇒ Cluster
Returns the value of the cluster
attribute.
31043 31044 31045 |
# File 'lib/ovirtsdk4/types.rb', line 31043 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.
31056 31057 31058 31059 31060 31061 |
# File 'lib/ovirtsdk4/types.rb', line 31056 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.
31068 31069 31070 |
# File 'lib/ovirtsdk4/types.rb', line 31068 def comment @comment end |
#comment=(value) ⇒ Object
Sets the value of the comment
attribute.
31077 31078 31079 |
# File 'lib/ovirtsdk4/types.rb', line 31077 def comment=(value) @comment = value end |
#description ⇒ String
Returns the value of the description
attribute.
31086 31087 31088 |
# File 'lib/ovirtsdk4/types.rb', line 31086 def description @description end |
#description=(value) ⇒ Object
Sets the value of the description
attribute.
31095 31096 31097 |
# File 'lib/ovirtsdk4/types.rb', line 31095 def description=(value) @description = value end |
#enforcing ⇒ Boolean
Returns the value of the enforcing
attribute.
31104 31105 31106 |
# File 'lib/ovirtsdk4/types.rb', line 31104 def enforcing @enforcing end |
#enforcing=(value) ⇒ Object
Sets the value of the enforcing
attribute.
31113 31114 31115 |
# File 'lib/ovirtsdk4/types.rb', line 31113 def enforcing=(value) @enforcing = value end |
#hash ⇒ Object
Generates a hash value for this object.
31417 31418 31419 31420 31421 31422 31423 31424 31425 31426 31427 31428 31429 31430 |
# File 'lib/ovirtsdk4/types.rb', line 31417 def hash super + @broken.hash + @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.
31122 31123 31124 |
# File 'lib/ovirtsdk4/types.rb', line 31122 def host_labels @host_labels end |
#host_labels=(list) ⇒ Object
Sets the value of the host_labels
attribute.
31131 31132 31133 31134 31135 31136 31137 31138 31139 31140 31141 |
# File 'lib/ovirtsdk4/types.rb', line 31131 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.
31148 31149 31150 |
# File 'lib/ovirtsdk4/types.rb', line 31148 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
31157 31158 31159 31160 31161 31162 31163 31164 31165 31166 31167 |
# File 'lib/ovirtsdk4/types.rb', line 31157 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.
31174 31175 31176 |
# File 'lib/ovirtsdk4/types.rb', line 31174 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.
31187 31188 31189 31190 31191 31192 |
# File 'lib/ovirtsdk4/types.rb', line 31187 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.
31199 31200 31201 |
# File 'lib/ovirtsdk4/types.rb', line 31199 def id @id end |
#id=(value) ⇒ Object
Sets the value of the id
attribute.
31208 31209 31210 |
# File 'lib/ovirtsdk4/types.rb', line 31208 def id=(value) @id = value end |
#name ⇒ String
Returns the value of the name
attribute.
31217 31218 31219 |
# File 'lib/ovirtsdk4/types.rb', line 31217 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
31226 31227 31228 |
# File 'lib/ovirtsdk4/types.rb', line 31226 def name=(value) @name = value end |
#positive ⇒ Boolean
Returns the value of the positive
attribute.
31235 31236 31237 |
# File 'lib/ovirtsdk4/types.rb', line 31235 def positive @positive end |
#positive=(value) ⇒ Object
Sets the value of the positive
attribute.
31244 31245 31246 |
# File 'lib/ovirtsdk4/types.rb', line 31244 def positive=(value) @positive = value end |
#priority ⇒ Float
Returns the value of the priority
attribute.
31253 31254 31255 |
# File 'lib/ovirtsdk4/types.rb', line 31253 def priority @priority end |
#priority=(value) ⇒ Object
Sets the value of the priority
attribute.
31262 31263 31264 |
# File 'lib/ovirtsdk4/types.rb', line 31262 def priority=(value) @priority = value end |
#vm_labels ⇒ Array<AffinityLabel>
Returns the value of the vm_labels
attribute.
31271 31272 31273 |
# File 'lib/ovirtsdk4/types.rb', line 31271 def vm_labels @vm_labels end |
#vm_labels=(list) ⇒ Object
Sets the value of the vm_labels
attribute.
31280 31281 31282 31283 31284 31285 31286 31287 31288 31289 31290 |
# File 'lib/ovirtsdk4/types.rb', line 31280 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.
31297 31298 31299 |
# File 'lib/ovirtsdk4/types.rb', line 31297 def vms @vms end |
#vms=(list) ⇒ Object
Sets the value of the vms
attribute.
31306 31307 31308 31309 31310 31311 31312 31313 31314 31315 31316 |
# File 'lib/ovirtsdk4/types.rb', line 31306 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.
31323 31324 31325 |
# File 'lib/ovirtsdk4/types.rb', line 31323 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.
31336 31337 31338 31339 31340 31341 |
# File 'lib/ovirtsdk4/types.rb', line 31336 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end |