class OvirtSDK4::Quota

Public Class Methods

new(opts = {}) click to toggle source

Creates a new instance of the {Quota} class.

@param opts [Hash] 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.

@option opts [Integer] :cluster_hard_limit_pct The value of attribute `cluster_hard_limit_pct`.

@option opts [Integer] :cluster_soft_limit_pct The value of attribute `cluster_soft_limit_pct`.

@option opts [String] :comment The value of attribute `comment`.

@option opts [DataCenter, Hash] :data_center The value of attribute `data_center`.

@option opts [String] :description The value of attribute `description`.

@option opts [Array<Disk>, Array<Hash>] :disks The values of attribute `disks`.

@option opts [String] :id The value of attribute `id`.

@option opts [String] :name The value of attribute `name`.

@option opts [Array<Permission>, Array<Hash>] :permissions The values of attribute `permissions`.

@option opts [Array<QuotaClusterLimit>, Array<Hash>] :quota_cluster_limits The values of attribute `quota_cluster_limits`.

@option opts [Array<QuotaStorageLimit>, Array<Hash>] :quota_storage_limits The values of attribute `quota_storage_limits`.

@option opts [Integer] :storage_hard_limit_pct The value of attribute `storage_hard_limit_pct`.

@option opts [Integer] :storage_soft_limit_pct The value of attribute `storage_soft_limit_pct`.

@option opts [Array<User>, Array<Hash>] :users The values of attribute `users`.

@option opts [Array<Vm>, Array<Hash>] :vms The values of attribute `vms`.

Calls superclass method OvirtSDK4::Identified::new
# File lib/ovirtsdk4/types.rb, line 16000
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

Public Instance Methods

==(other) click to toggle source

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

Calls superclass method OvirtSDK4::Identified#==
# File lib/ovirtsdk4/types.rb, line 16018
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_pct() click to toggle source

Returns the value of the `cluster_hard_limit_pct` attribute.

@return [Integer]

# File lib/ovirtsdk4/types.rb, line 15642
def cluster_hard_limit_pct
  @cluster_hard_limit_pct
end
cluster_hard_limit_pct=(value) click to toggle source

Sets the value of the `cluster_hard_limit_pct` attribute.

@param value [Integer]

# File lib/ovirtsdk4/types.rb, line 15651
def cluster_hard_limit_pct=(value)
  @cluster_hard_limit_pct = value
end
cluster_soft_limit_pct() click to toggle source

Returns the value of the `cluster_soft_limit_pct` attribute.

@return [Integer]

# File lib/ovirtsdk4/types.rb, line 15660
def cluster_soft_limit_pct
  @cluster_soft_limit_pct
end
cluster_soft_limit_pct=(value) click to toggle source

Sets the value of the `cluster_soft_limit_pct` attribute.

@param value [Integer]

# File lib/ovirtsdk4/types.rb, line 15669
def cluster_soft_limit_pct=(value)
  @cluster_soft_limit_pct = value
end
comment() click to toggle source

Returns the value of the `comment` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 15678
def comment
  @comment
end
comment=(value) click to toggle source

Sets the value of the `comment` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 15687
def comment=(value)
  @comment = value
end
data_center() click to toggle source

Returns the value of the `data_center` attribute.

@return [DataCenter]

# File lib/ovirtsdk4/types.rb, line 15696
def data_center
  @data_center
end
data_center=(value) click to toggle source

Sets the value of the `data_center` attribute.

@param value [DataCenter, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 15709
def data_center=(value)
  if value.is_a?(Hash)
    value = DataCenter.new(value)
  end
  @data_center = value
end
description() click to toggle source

Returns the value of the `description` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 15721
def description
  @description
end
description=(value) click to toggle source

Sets the value of the `description` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 15730
def description=(value)
  @description = value
end
disks() click to toggle source

Returns the value of the `disks` attribute.

@return [Array<Disk>]

# File lib/ovirtsdk4/types.rb, line 15739
def disks
  @disks
end
disks=(list) click to toggle source

Sets the value of the `disks` attribute.

@param list [Array<Disk>]

# File lib/ovirtsdk4/types.rb, line 15748
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
hash() click to toggle source

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Identified#hash
# File lib/ovirtsdk4/types.rb, line 16036
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
id() click to toggle source

Returns the value of the `id` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 15765
def id
  @id
end
id=(value) click to toggle source

Sets the value of the `id` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 15774
def id=(value)
  @id = value
end
name() click to toggle source

Returns the value of the `name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 15783
def name
  @name
end
name=(value) click to toggle source

Sets the value of the `name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 15792
def name=(value)
  @name = value
end
permissions() click to toggle source

Returns the value of the `permissions` attribute.

@return [Array<Permission>]

# File lib/ovirtsdk4/types.rb, line 15801
def permissions
  @permissions
end
permissions=(list) click to toggle source

Sets the value of the `permissions` attribute.

@param list [Array<Permission>]

# File lib/ovirtsdk4/types.rb, line 15810
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_limits() click to toggle source

Returns the value of the `quota_cluster_limits` attribute.

@return [Array<QuotaClusterLimit>]

# File lib/ovirtsdk4/types.rb, line 15827
def quota_cluster_limits
  @quota_cluster_limits
end
quota_cluster_limits=(list) click to toggle source

Sets the value of the `quota_cluster_limits` attribute.

@param list [Array<QuotaClusterLimit>]

# File lib/ovirtsdk4/types.rb, line 15836
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_limits() click to toggle source

Returns the value of the `quota_storage_limits` attribute.

@return [Array<QuotaStorageLimit>]

# File lib/ovirtsdk4/types.rb, line 15853
def quota_storage_limits
  @quota_storage_limits
end
quota_storage_limits=(list) click to toggle source

Sets the value of the `quota_storage_limits` attribute.

@param list [Array<QuotaStorageLimit>]

# File lib/ovirtsdk4/types.rb, line 15862
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_pct() click to toggle source

Returns the value of the `storage_hard_limit_pct` attribute.

@return [Integer]

# File lib/ovirtsdk4/types.rb, line 15879
def storage_hard_limit_pct
  @storage_hard_limit_pct
end
storage_hard_limit_pct=(value) click to toggle source

Sets the value of the `storage_hard_limit_pct` attribute.

@param value [Integer]

# File lib/ovirtsdk4/types.rb, line 15888
def storage_hard_limit_pct=(value)
  @storage_hard_limit_pct = value
end
storage_soft_limit_pct() click to toggle source

Returns the value of the `storage_soft_limit_pct` attribute.

@return [Integer]

# File lib/ovirtsdk4/types.rb, line 15897
def storage_soft_limit_pct
  @storage_soft_limit_pct
end
storage_soft_limit_pct=(value) click to toggle source

Sets the value of the `storage_soft_limit_pct` attribute.

@param value [Integer]

# File lib/ovirtsdk4/types.rb, line 15906
def storage_soft_limit_pct=(value)
  @storage_soft_limit_pct = value
end
users() click to toggle source

Returns the value of the `users` attribute.

@return [Array<User>]

# File lib/ovirtsdk4/types.rb, line 15915
def users
  @users
end
users=(list) click to toggle source

Sets the value of the `users` attribute.

@param list [Array<User>]

# File lib/ovirtsdk4/types.rb, line 15924
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
vms() click to toggle source

Returns the value of the `vms` attribute.

@return [Array<Vm>]

# File lib/ovirtsdk4/types.rb, line 15941
def vms
  @vms
end
vms=(list) click to toggle source

Sets the value of the `vms` attribute.

@param list [Array<Vm>]

# File lib/ovirtsdk4/types.rb, line 15950
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