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.


15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
# File 'lib/ovirtsdk4/types.rb', line 15894

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.


15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
# File 'lib/ovirtsdk4/types.rb', line 15912

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)

15536
15537
15538
# File 'lib/ovirtsdk4/types.rb', line 15536

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)

15545
15546
15547
# File 'lib/ovirtsdk4/types.rb', line 15545

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)

15554
15555
15556
# File 'lib/ovirtsdk4/types.rb', line 15554

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)

15563
15564
15565
# File 'lib/ovirtsdk4/types.rb', line 15563

def cluster_soft_limit_pct=(value)
  @cluster_soft_limit_pct = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

15572
15573
15574
# File 'lib/ovirtsdk4/types.rb', line 15572

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

15581
15582
15583
# File 'lib/ovirtsdk4/types.rb', line 15581

def comment=(value)
  @comment = value
end

#data_centerDataCenter

Returns the value of the data_center attribute.

Returns:


15590
15591
15592
# File 'lib/ovirtsdk4/types.rb', line 15590

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:


15603
15604
15605
15606
15607
15608
# File 'lib/ovirtsdk4/types.rb', line 15603

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)

15615
15616
15617
# File 'lib/ovirtsdk4/types.rb', line 15615

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

15624
15625
15626
# File 'lib/ovirtsdk4/types.rb', line 15624

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:


15633
15634
15635
# File 'lib/ovirtsdk4/types.rb', line 15633

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)

15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
# File 'lib/ovirtsdk4/types.rb', line 15642

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.


15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
# File 'lib/ovirtsdk4/types.rb', line 15930

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)

15659
15660
15661
# File 'lib/ovirtsdk4/types.rb', line 15659

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

15668
15669
15670
# File 'lib/ovirtsdk4/types.rb', line 15668

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

15677
15678
15679
# File 'lib/ovirtsdk4/types.rb', line 15677

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

15686
15687
15688
# File 'lib/ovirtsdk4/types.rb', line 15686

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:


15695
15696
15697
# File 'lib/ovirtsdk4/types.rb', line 15695

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:


15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
# File 'lib/ovirtsdk4/types.rb', line 15704

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:


15721
15722
15723
# File 'lib/ovirtsdk4/types.rb', line 15721

def quota_cluster_limits
  @quota_cluster_limits
end

#quota_cluster_limits=(list) ⇒ Object

Sets the value of the quota_cluster_limits attribute.

Parameters:


15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
# File 'lib/ovirtsdk4/types.rb', line 15730

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:


15747
15748
15749
# File 'lib/ovirtsdk4/types.rb', line 15747

def quota_storage_limits
  @quota_storage_limits
end

#quota_storage_limits=(list) ⇒ Object

Sets the value of the quota_storage_limits attribute.

Parameters:


15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
# File 'lib/ovirtsdk4/types.rb', line 15756

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)

15773
15774
15775
# File 'lib/ovirtsdk4/types.rb', line 15773

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)

15782
15783
15784
# File 'lib/ovirtsdk4/types.rb', line 15782

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)

15791
15792
15793
# File 'lib/ovirtsdk4/types.rb', line 15791

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)

15800
15801
15802
# File 'lib/ovirtsdk4/types.rb', line 15800

def storage_soft_limit_pct=(value)
  @storage_soft_limit_pct = value
end

#usersArray<User>

Returns the value of the users attribute.

Returns:


15809
15810
15811
# File 'lib/ovirtsdk4/types.rb', line 15809

def users
  @users
end

#users=(list) ⇒ Object

Sets the value of the users attribute.

Parameters:

  • list (Array<User>)

15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
# File 'lib/ovirtsdk4/types.rb', line 15818

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

15835
15836
15837
# File 'lib/ovirtsdk4/types.rb', line 15835

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)

15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
# File 'lib/ovirtsdk4/types.rb', line 15844

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