class OvirtSDK4::MemoryPolicy

Public Class Methods

new(opts = {}) click to toggle source

Creates a new instance of the {MemoryPolicy} 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 [Boolean] :ballooning The value of attribute `ballooning`.

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

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

@option opts [MemoryOverCommit, Hash] :over_commit The value of attribute `over_commit`.

@option opts [TransparentHugePages, Hash] :transparent_huge_pages The value of attribute `transparent_huge_pages`.

Calls superclass method OvirtSDK4::Struct::new
# File lib/ovirtsdk4/types.rb, line 9763
def initialize(opts = {})
  super(opts)
  self.ballooning = opts[:ballooning]
  self.guaranteed = opts[:guaranteed]
  self.max = opts[:max]
  self.over_commit = opts[:over_commit]
  self.transparent_huge_pages = opts[:transparent_huge_pages]
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::Struct#==
# File lib/ovirtsdk4/types.rb, line 9775
def ==(other)
  super &&
  @ballooning == other.ballooning &&
  @guaranteed == other.guaranteed &&
  @max == other.max &&
  @over_commit == other.over_commit &&
  @transparent_huge_pages == other.transparent_huge_pages
end
ballooning() click to toggle source

Returns the value of the `ballooning` attribute.

@return [Boolean]

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

Sets the value of the `ballooning` attribute.

@param value [Boolean]

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

Returns the value of the `guaranteed` attribute.

@return [Integer]

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

Sets the value of the `guaranteed` attribute.

@param value [Integer]

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

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Struct#hash
# File lib/ovirtsdk4/types.rb, line 9787
def hash
  super +
  @ballooning.hash +
  @guaranteed.hash +
  @max.hash +
  @over_commit.hash +
  @transparent_huge_pages.hash
end
max() click to toggle source

Returns the value of the `max` attribute.

@return [Integer]

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

Sets the value of the `max` attribute.

@param value [Integer]

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

Returns the value of the `over_commit` attribute.

@return [MemoryOverCommit]

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

Sets the value of the `over_commit` attribute.

@param value [MemoryOverCommit, Hash]

The `value` parameter can be an instance of {OvirtSDK4::MemoryOverCommit} 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 9713
def over_commit=(value)
  if value.is_a?(Hash)
    value = MemoryOverCommit.new(value)
  end
  @over_commit = value
end
transparent_huge_pages() click to toggle source

Returns the value of the `transparent_huge_pages` attribute.

@return [TransparentHugePages]

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

Sets the value of the `transparent_huge_pages` attribute.

@param value [TransparentHugePages, Hash]

The `value` parameter can be an instance of {OvirtSDK4::TransparentHugePages} 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 9738
def transparent_huge_pages=(value)
  if value.is_a?(Hash)
    value = TransparentHugePages.new(value)
  end
  @transparent_huge_pages = value
end