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.



16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
# File 'lib/ovirtsdk4/types.rb', line 16743

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.



16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
# File 'lib/ovirtsdk4/types.rb', line 16761

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)


16385
16386
16387
# File 'lib/ovirtsdk4/types.rb', line 16385

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)


16394
16395
16396
# File 'lib/ovirtsdk4/types.rb', line 16394

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)


16403
16404
16405
# File 'lib/ovirtsdk4/types.rb', line 16403

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)


16412
16413
16414
# File 'lib/ovirtsdk4/types.rb', line 16412

def cluster_soft_limit_pct=(value)
  @cluster_soft_limit_pct = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


16421
16422
16423
# File 'lib/ovirtsdk4/types.rb', line 16421

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


16430
16431
16432
# File 'lib/ovirtsdk4/types.rb', line 16430

def comment=(value)
  @comment = value
end

#data_centerDataCenter

Returns the value of the data_center attribute.

Returns:



16439
16440
16441
# File 'lib/ovirtsdk4/types.rb', line 16439

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:



16452
16453
16454
16455
16456
16457
# File 'lib/ovirtsdk4/types.rb', line 16452

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)


16464
16465
16466
# File 'lib/ovirtsdk4/types.rb', line 16464

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


16473
16474
16475
# File 'lib/ovirtsdk4/types.rb', line 16473

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



16482
16483
16484
# File 'lib/ovirtsdk4/types.rb', line 16482

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


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

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.



16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
# File 'lib/ovirtsdk4/types.rb', line 16779

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)


16508
16509
16510
# File 'lib/ovirtsdk4/types.rb', line 16508

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


16517
16518
16519
# File 'lib/ovirtsdk4/types.rb', line 16517

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


16526
16527
16528
# File 'lib/ovirtsdk4/types.rb', line 16526

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


16535
16536
16537
# File 'lib/ovirtsdk4/types.rb', line 16535

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



16544
16545
16546
# File 'lib/ovirtsdk4/types.rb', line 16544

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
# File 'lib/ovirtsdk4/types.rb', line 16553

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:



16570
16571
16572
# File 'lib/ovirtsdk4/types.rb', line 16570

def quota_cluster_limits
  @quota_cluster_limits
end

#quota_cluster_limits=(list) ⇒ Object

Sets the value of the quota_cluster_limits attribute.

Parameters:



16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
# File 'lib/ovirtsdk4/types.rb', line 16579

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:



16596
16597
16598
# File 'lib/ovirtsdk4/types.rb', line 16596

def quota_storage_limits
  @quota_storage_limits
end

#quota_storage_limits=(list) ⇒ Object

Sets the value of the quota_storage_limits attribute.

Parameters:



16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
# File 'lib/ovirtsdk4/types.rb', line 16605

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)


16622
16623
16624
# File 'lib/ovirtsdk4/types.rb', line 16622

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)


16631
16632
16633
# File 'lib/ovirtsdk4/types.rb', line 16631

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)


16640
16641
16642
# File 'lib/ovirtsdk4/types.rb', line 16640

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)


16649
16650
16651
# File 'lib/ovirtsdk4/types.rb', line 16649

def storage_soft_limit_pct=(value)
  @storage_soft_limit_pct = value
end

#usersArray<User>

Returns the value of the users attribute.

Returns:



16658
16659
16660
# File 'lib/ovirtsdk4/types.rb', line 16658

def users
  @users
end

#users=(list) ⇒ Object

Sets the value of the users attribute.

Parameters:

  • list (Array<User>)


16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
# File 'lib/ovirtsdk4/types.rb', line 16667

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>)


16684
16685
16686
# File 'lib/ovirtsdk4/types.rb', line 16684

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
# File 'lib/ovirtsdk4/types.rb', line 16693

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