Class: OvirtSDK4::Quota

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 = {}) ⇒ Quota

Creates a new instance of the OvirtSDK4::Quota 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):

  • :cluster_hard_limit_pct (Integer)

    The value of attribute cluster_hard_limit_pct.

  • :cluster_soft_limit_pct (Integer)

    The value of attribute cluster_soft_limit_pct.

  • :comment (String)

    The value of attribute comment.

  • :data_center (DataCenter, Hash)

    The value of attribute data_center.

  • :description (String)

    The value of attribute description.

  • :disks (Array<Disk>, Array<Hash>)

    The values of attribute disks.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

  • :quota_cluster_limits (Array<QuotaClusterLimit>, Array<Hash>)

    The values of attribute quota_cluster_limits.

  • :quota_storage_limits (Array<QuotaStorageLimit>, Array<Hash>)

    The values of attribute quota_storage_limits.

  • :storage_hard_limit_pct (Integer)

    The value of attribute storage_hard_limit_pct.

  • :storage_soft_limit_pct (Integer)

    The value of attribute storage_soft_limit_pct.

  • :users (Array<User>, Array<Hash>)

    The values of attribute users.

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

    The values of attribute vms.



16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
# File 'lib/ovirtsdk4/types.rb', line 16473

def initialize(opts = {})
  super(opts)
  self.cluster_hard_limit_pct = opts[:cluster_hard_limit_pct]
  self.cluster_soft_limit_pct = opts[:cluster_soft_limit_pct]
  self.data_center = opts[:data_center]
  self.disks = opts[:disks]
  self.permissions = opts[:permissions]
  self.quota_cluster_limits = opts[:quota_cluster_limits]
  self.quota_storage_limits = opts[:quota_storage_limits]
  self.storage_hard_limit_pct = opts[:storage_hard_limit_pct]
  self.storage_soft_limit_pct = opts[:storage_soft_limit_pct]
  self.users = opts[:users]
  self.vms = opts[:vms]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
# File 'lib/ovirtsdk4/types.rb', line 16491

def ==(other)
  super &&
  @cluster_hard_limit_pct == other.cluster_hard_limit_pct &&
  @cluster_soft_limit_pct == other.cluster_soft_limit_pct &&
  @data_center == other.data_center &&
  @disks == other.disks &&
  @permissions == other.permissions &&
  @quota_cluster_limits == other.quota_cluster_limits &&
  @quota_storage_limits == other.quota_storage_limits &&
  @storage_hard_limit_pct == other.storage_hard_limit_pct &&
  @storage_soft_limit_pct == other.storage_soft_limit_pct &&
  @users == other.users &&
  @vms == other.vms
end

#cluster_hard_limit_pctInteger

Returns the value of the cluster_hard_limit_pct attribute.

Returns:

  • (Integer)


16115
16116
16117
# File 'lib/ovirtsdk4/types.rb', line 16115

def cluster_hard_limit_pct
  @cluster_hard_limit_pct
end

#cluster_hard_limit_pct=(value) ⇒ Object

Sets the value of the cluster_hard_limit_pct attribute.

Parameters:

  • value (Integer)


16124
16125
16126
# File 'lib/ovirtsdk4/types.rb', line 16124

def cluster_hard_limit_pct=(value)
  @cluster_hard_limit_pct = value
end

#cluster_soft_limit_pctInteger

Returns the value of the cluster_soft_limit_pct attribute.

Returns:

  • (Integer)


16133
16134
16135
# File 'lib/ovirtsdk4/types.rb', line 16133

def cluster_soft_limit_pct
  @cluster_soft_limit_pct
end

#cluster_soft_limit_pct=(value) ⇒ Object

Sets the value of the cluster_soft_limit_pct attribute.

Parameters:

  • value (Integer)


16142
16143
16144
# File 'lib/ovirtsdk4/types.rb', line 16142

def cluster_soft_limit_pct=(value)
  @cluster_soft_limit_pct = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


16151
16152
16153
# File 'lib/ovirtsdk4/types.rb', line 16151

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


16160
16161
16162
# File 'lib/ovirtsdk4/types.rb', line 16160

def comment=(value)
  @comment = value
end

#data_centerDataCenter

Returns the value of the data_center attribute.

Returns:



16169
16170
16171
# File 'lib/ovirtsdk4/types.rb', line 16169

def data_center
  @data_center
end

#data_center=(value) ⇒ Object

Sets the value of the data_center attribute.

The value parameter can be an instance of DataCenter 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:



16182
16183
16184
16185
16186
16187
# File 'lib/ovirtsdk4/types.rb', line 16182

def data_center=(value)
  if value.is_a?(Hash)
    value = DataCenter.new(value)
  end
  @data_center = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


16194
16195
16196
# File 'lib/ovirtsdk4/types.rb', line 16194

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


16203
16204
16205
# File 'lib/ovirtsdk4/types.rb', line 16203

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



16212
16213
16214
# File 'lib/ovirtsdk4/types.rb', line 16212

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
# File 'lib/ovirtsdk4/types.rb', line 16221

def disks=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Disk.new(value)
      end
    end
  end
  @disks = list
end

#hashObject

Generates a hash value for this object.



16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
# File 'lib/ovirtsdk4/types.rb', line 16509

def hash
  super +
  @cluster_hard_limit_pct.hash +
  @cluster_soft_limit_pct.hash +
  @data_center.hash +
  @disks.hash +
  @permissions.hash +
  @quota_cluster_limits.hash +
  @quota_storage_limits.hash +
  @storage_hard_limit_pct.hash +
  @storage_soft_limit_pct.hash +
  @users.hash +
  @vms.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


16238
16239
16240
# File 'lib/ovirtsdk4/types.rb', line 16238

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


16247
16248
16249
# File 'lib/ovirtsdk4/types.rb', line 16247

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


16256
16257
16258
# File 'lib/ovirtsdk4/types.rb', line 16256

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


16265
16266
16267
# File 'lib/ovirtsdk4/types.rb', line 16265

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



16274
16275
16276
# File 'lib/ovirtsdk4/types.rb', line 16274

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
# File 'lib/ovirtsdk4/types.rb', line 16283

def permissions=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Permission.new(value)
      end
    end
  end
  @permissions = list
end

#quota_cluster_limitsArray<QuotaClusterLimit>

Returns the value of the quota_cluster_limits attribute.

Returns:



16300
16301
16302
# File 'lib/ovirtsdk4/types.rb', line 16300

def quota_cluster_limits
  @quota_cluster_limits
end

#quota_cluster_limits=(list) ⇒ Object

Sets the value of the quota_cluster_limits attribute.

Parameters:



16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
# File 'lib/ovirtsdk4/types.rb', line 16309

def quota_cluster_limits=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = QuotaClusterLimit.new(value)
      end
    end
  end
  @quota_cluster_limits = list
end

#quota_storage_limitsArray<QuotaStorageLimit>

Returns the value of the quota_storage_limits attribute.

Returns:



16326
16327
16328
# File 'lib/ovirtsdk4/types.rb', line 16326

def quota_storage_limits
  @quota_storage_limits
end

#quota_storage_limits=(list) ⇒ Object

Sets the value of the quota_storage_limits attribute.

Parameters:



16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
# File 'lib/ovirtsdk4/types.rb', line 16335

def quota_storage_limits=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = QuotaStorageLimit.new(value)
      end
    end
  end
  @quota_storage_limits = list
end

#storage_hard_limit_pctInteger

Returns the value of the storage_hard_limit_pct attribute.

Returns:

  • (Integer)


16352
16353
16354
# File 'lib/ovirtsdk4/types.rb', line 16352

def storage_hard_limit_pct
  @storage_hard_limit_pct
end

#storage_hard_limit_pct=(value) ⇒ Object

Sets the value of the storage_hard_limit_pct attribute.

Parameters:

  • value (Integer)


16361
16362
16363
# File 'lib/ovirtsdk4/types.rb', line 16361

def storage_hard_limit_pct=(value)
  @storage_hard_limit_pct = value
end

#storage_soft_limit_pctInteger

Returns the value of the storage_soft_limit_pct attribute.

Returns:

  • (Integer)


16370
16371
16372
# File 'lib/ovirtsdk4/types.rb', line 16370

def storage_soft_limit_pct
  @storage_soft_limit_pct
end

#storage_soft_limit_pct=(value) ⇒ Object

Sets the value of the storage_soft_limit_pct attribute.

Parameters:

  • value (Integer)


16379
16380
16381
# File 'lib/ovirtsdk4/types.rb', line 16379

def storage_soft_limit_pct=(value)
  @storage_soft_limit_pct = value
end

#usersArray<User>

Returns the value of the users attribute.

Returns:



16388
16389
16390
# File 'lib/ovirtsdk4/types.rb', line 16388

def users
  @users
end

#users=(list) ⇒ Object

Sets the value of the users attribute.

Parameters:

  • list (Array<User>)


16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
# File 'lib/ovirtsdk4/types.rb', line 16397

def users=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = User.new(value)
      end
    end
  end
  @users = list
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


16414
16415
16416
# File 'lib/ovirtsdk4/types.rb', line 16414

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
# File 'lib/ovirtsdk4/types.rb', line 16423

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