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.
29480 29481 29482 29483 29484 29485 29486 29487 29488 29489 |
# File 'lib/ovirtsdk4/types.rb', line 29480 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.
29494 29495 29496 29497 29498 29499 29500 29501 29502 29503 |
# File 'lib/ovirtsdk4/types.rb', line 29494 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.
29220 29221 29222 |
# File 'lib/ovirtsdk4/types.rb', line 29220 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.
29233 29234 29235 29236 29237 29238 |
# File 'lib/ovirtsdk4/types.rb', line 29233 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.
29245 29246 29247 |
# File 'lib/ovirtsdk4/types.rb', line 29245 def comment @comment end |
#comment=(value) ⇒ Object
Sets the value of the comment
attribute.
29254 29255 29256 |
# File 'lib/ovirtsdk4/types.rb', line 29254 def comment=(value) @comment = value end |
#description ⇒ String
Returns the value of the description
attribute.
29263 29264 29265 |
# File 'lib/ovirtsdk4/types.rb', line 29263 def description @description end |
#description=(value) ⇒ Object
Sets the value of the description
attribute.
29272 29273 29274 |
# File 'lib/ovirtsdk4/types.rb', line 29272 def description=(value) @description = value end |
#enforcing ⇒ Boolean
Returns the value of the enforcing
attribute.
29281 29282 29283 |
# File 'lib/ovirtsdk4/types.rb', line 29281 def enforcing @enforcing end |
#enforcing=(value) ⇒ Object
Sets the value of the enforcing
attribute.
29290 29291 29292 |
# File 'lib/ovirtsdk4/types.rb', line 29290 def enforcing=(value) @enforcing = value end |
#hash ⇒ Object
Generates a hash value for this object.
29508 29509 29510 29511 29512 29513 29514 29515 29516 29517 |
# File 'lib/ovirtsdk4/types.rb', line 29508 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.
29299 29300 29301 |
# File 'lib/ovirtsdk4/types.rb', line 29299 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
29308 29309 29310 29311 29312 29313 29314 29315 29316 29317 29318 |
# File 'lib/ovirtsdk4/types.rb', line 29308 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.
29325 29326 29327 |
# File 'lib/ovirtsdk4/types.rb', line 29325 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.
29338 29339 29340 29341 29342 29343 |
# File 'lib/ovirtsdk4/types.rb', line 29338 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.
29350 29351 29352 |
# File 'lib/ovirtsdk4/types.rb', line 29350 def id @id end |
#id=(value) ⇒ Object
Sets the value of the id
attribute.
29359 29360 29361 |
# File 'lib/ovirtsdk4/types.rb', line 29359 def id=(value) @id = value end |
#name ⇒ String
Returns the value of the name
attribute.
29368 29369 29370 |
# File 'lib/ovirtsdk4/types.rb', line 29368 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
29377 29378 29379 |
# File 'lib/ovirtsdk4/types.rb', line 29377 def name=(value) @name = value end |
#positive ⇒ Boolean
Returns the value of the positive
attribute.
29386 29387 29388 |
# File 'lib/ovirtsdk4/types.rb', line 29386 def positive @positive end |
#positive=(value) ⇒ Object
Sets the value of the positive
attribute.
29395 29396 29397 |
# File 'lib/ovirtsdk4/types.rb', line 29395 def positive=(value) @positive = value end |
#vms ⇒ Array<Vm>
Returns the value of the vms
attribute.
29404 29405 29406 |
# File 'lib/ovirtsdk4/types.rb', line 29404 def vms @vms end |
#vms=(list) ⇒ Object
Sets the value of the vms
attribute.
29413 29414 29415 29416 29417 29418 29419 29420 29421 29422 29423 |
# File 'lib/ovirtsdk4/types.rb', line 29413 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.
29430 29431 29432 |
# File 'lib/ovirtsdk4/types.rb', line 29430 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.
29443 29444 29445 29446 29447 29448 |
# File 'lib/ovirtsdk4/types.rb', line 29443 def vms_rule=(value) if value.is_a?(Hash) value = AffinityRule.new(value) end @vms_rule = value end |