Class: OvirtSDK4::AffinityGroup

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ AffinityGroup

Creates a new instance of the OvirtSDK4::AffinityGroup class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :broken (Boolean)

    The value of attribute broken.

  • :cluster (Cluster, Hash)

    The value of attribute cluster.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :enforcing (Boolean)

    The value of attribute enforcing.

  • :host_labels (Array<AffinityLabel>, Array<Hash>)

    The values of attribute host_labels.

  • :hosts (Array<Host>, Array<Hash>)

    The values of attribute hosts.

  • :hosts_rule (AffinityRule, Hash)

    The value of attribute hosts_rule.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :positive (Boolean)

    The value of attribute positive.

  • :priority (Float)

    The value of attribute priority.

  • :vm_labels (Array<AffinityLabel>, Array<Hash>)

    The values of attribute vm_labels.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.

  • :vms_rule (AffinityRule, Hash)

    The value of attribute vms_rule.



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

#brokenBoolean

Returns the value of the broken attribute.

Returns:

  • (Boolean)


31025
31026
31027
# File 'lib/ovirtsdk4/types.rb', line 31025

def broken
  @broken
end

#broken=(value) ⇒ Object

Sets the value of the broken attribute.

Parameters:

  • value (Boolean)


31034
31035
31036
# File 'lib/ovirtsdk4/types.rb', line 31034

def broken=(value)
  @broken = value
end

#clusterCluster

Returns the value of the cluster attribute.

Returns:



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.

Parameters:



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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


31068
31069
31070
# File 'lib/ovirtsdk4/types.rb', line 31068

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


31077
31078
31079
# File 'lib/ovirtsdk4/types.rb', line 31077

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


31086
31087
31088
# File 'lib/ovirtsdk4/types.rb', line 31086

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


31095
31096
31097
# File 'lib/ovirtsdk4/types.rb', line 31095

def description=(value)
  @description = value
end

#enforcingBoolean

Returns the value of the enforcing attribute.

Returns:

  • (Boolean)


31104
31105
31106
# File 'lib/ovirtsdk4/types.rb', line 31104

def enforcing
  @enforcing
end

#enforcing=(value) ⇒ Object

Sets the value of the enforcing attribute.

Parameters:

  • value (Boolean)


31113
31114
31115
# File 'lib/ovirtsdk4/types.rb', line 31113

def enforcing=(value)
  @enforcing = value
end

#hashObject

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_labelsArray<AffinityLabel>

Returns the value of the host_labels attribute.

Returns:



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.

Parameters:



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

#hostsArray<Host>

Returns the value of the hosts attribute.

Returns:



31148
31149
31150
# File 'lib/ovirtsdk4/types.rb', line 31148

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)


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_ruleAffinityRule

Returns the value of the hosts_rule attribute.

Returns:



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.

Parameters:



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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


31199
31200
31201
# File 'lib/ovirtsdk4/types.rb', line 31199

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


31208
31209
31210
# File 'lib/ovirtsdk4/types.rb', line 31208

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


31217
31218
31219
# File 'lib/ovirtsdk4/types.rb', line 31217

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


31226
31227
31228
# File 'lib/ovirtsdk4/types.rb', line 31226

def name=(value)
  @name = value
end

#positiveBoolean

Returns the value of the positive attribute.

Returns:

  • (Boolean)


31235
31236
31237
# File 'lib/ovirtsdk4/types.rb', line 31235

def positive
  @positive
end

#positive=(value) ⇒ Object

Sets the value of the positive attribute.

Parameters:

  • value (Boolean)


31244
31245
31246
# File 'lib/ovirtsdk4/types.rb', line 31244

def positive=(value)
  @positive = value
end

#priorityFloat

Returns the value of the priority attribute.

Returns:

  • (Float)


31253
31254
31255
# File 'lib/ovirtsdk4/types.rb', line 31253

def priority
  @priority
end

#priority=(value) ⇒ Object

Sets the value of the priority attribute.

Parameters:

  • value (Float)


31262
31263
31264
# File 'lib/ovirtsdk4/types.rb', line 31262

def priority=(value)
  @priority = value
end

#vm_labelsArray<AffinityLabel>

Returns the value of the vm_labels attribute.

Returns:



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.

Parameters:



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

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


31297
31298
31299
# File 'lib/ovirtsdk4/types.rb', line 31297

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


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_ruleAffinityRule

Returns the value of the vms_rule attribute.

Returns:



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.

Parameters:



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