Class: OvirtSDK4::MemoryPolicy

Inherits:
Struct
  • Object
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 = {}) ⇒ MemoryPolicy

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

  • :ballooning (Boolean)

    The value of attribute ballooning.

  • :guaranteed (Integer)

    The value of attribute guaranteed.

  • :max (Integer)

    The value of attribute max.

  • :over_commit (MemoryOverCommit, Hash)

    The value of attribute over_commit.

  • :transparent_huge_pages (TransparentHugePages, Hash)

    The value of attribute transparent_huge_pages.


9299
9300
9301
9302
9303
9304
9305
9306
# File 'lib/ovirtsdk4/types.rb', line 9299

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

Instance Method Details

#==(other) ⇒ Object

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


9311
9312
9313
9314
9315
9316
9317
9318
# File 'lib/ovirtsdk4/types.rb', line 9311

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

#ballooningBoolean

Returns the value of the ballooning attribute.

Returns:

  • (Boolean)

9182
9183
9184
# File 'lib/ovirtsdk4/types.rb', line 9182

def ballooning
  @ballooning
end

#ballooning=(value) ⇒ Object

Sets the value of the ballooning attribute.

Parameters:

  • value (Boolean)

9191
9192
9193
# File 'lib/ovirtsdk4/types.rb', line 9191

def ballooning=(value)
  @ballooning = value
end

#guaranteedInteger

Returns the value of the guaranteed attribute.

Returns:

  • (Integer)

9200
9201
9202
# File 'lib/ovirtsdk4/types.rb', line 9200

def guaranteed
  @guaranteed
end

#guaranteed=(value) ⇒ Object

Sets the value of the guaranteed attribute.

Parameters:

  • value (Integer)

9209
9210
9211
# File 'lib/ovirtsdk4/types.rb', line 9209

def guaranteed=(value)
  @guaranteed = value
end

#hashObject

Generates a hash value for this object.


9323
9324
9325
9326
9327
9328
9329
9330
# File 'lib/ovirtsdk4/types.rb', line 9323

def hash
  super +
  @ballooning.hash +
  @guaranteed.hash +
  @max.hash +
  @over_commit.hash +
  @transparent_huge_pages.hash
end

#maxInteger

Returns the value of the max attribute.

Returns:

  • (Integer)

9218
9219
9220
# File 'lib/ovirtsdk4/types.rb', line 9218

def max
  @max
end

#max=(value) ⇒ Object

Sets the value of the max attribute.

Parameters:

  • value (Integer)

9227
9228
9229
# File 'lib/ovirtsdk4/types.rb', line 9227

def max=(value)
  @max = value
end

#over_commitMemoryOverCommit

Returns the value of the over_commit attribute.

Returns:


9236
9237
9238
# File 'lib/ovirtsdk4/types.rb', line 9236

def over_commit
  @over_commit
end

#over_commit=(value) ⇒ Object

Sets the value of the over_commit attribute.

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.

Parameters:


9249
9250
9251
9252
9253
9254
# File 'lib/ovirtsdk4/types.rb', line 9249

def over_commit=(value)
  if value.is_a?(Hash)
    value = MemoryOverCommit.new(value)
  end
  @over_commit = value
end

#transparent_huge_pagesTransparentHugePages

Returns the value of the transparent_huge_pages attribute.


9261
9262
9263
# File 'lib/ovirtsdk4/types.rb', line 9261

def transparent_huge_pages
  @transparent_huge_pages
end

#transparent_huge_pages=(value) ⇒ Object

Sets the value of the transparent_huge_pages attribute.

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

Parameters:


9274
9275
9276
9277
9278
9279
# File 'lib/ovirtsdk4/types.rb', line 9274

def transparent_huge_pages=(value)
  if value.is_a?(Hash)
    value = TransparentHugePages.new(value)
  end
  @transparent_huge_pages = value
end