Class: OvirtSDK4::PowerManagement

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 = {}) ⇒ PowerManagement

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

  • :address (String)

    The value of attribute address.

  • :agents (Array<Agent>, Array<Hash>)

    The values of attribute agents.

  • :automatic_pm_enabled (Boolean)

    The value of attribute automatic_pm_enabled.

  • :enabled (Boolean)

    The value of attribute enabled.

  • :kdump_detection (Boolean)

    The value of attribute kdump_detection.

  • :options (Array<Option>, Array<Hash>)

    The values of attribute options.

  • :password (String)

    The value of attribute password.

  • :pm_proxies (Array<PmProxy>, Array<Hash>)

    The values of attribute pm_proxies.

  • :status (PowerManagementStatus)

    The value of attribute status.

  • :type (String)

    The value of attribute type.

  • :username (String)

    The value of attribute username.



14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
# File 'lib/ovirtsdk4/types.rb', line 14528

def initialize(opts = {})
  super(opts)
  self.address = opts[:address]
  self.agents = opts[:agents]
  self.automatic_pm_enabled = opts[:automatic_pm_enabled]
  self.enabled = opts[:enabled]
  self.kdump_detection = opts[:kdump_detection]
  self.options = opts[:options]
  self.password = opts[:password]
  self.pm_proxies = opts[:pm_proxies]
  self.status = opts[:status]
  self.type = opts[:type]
  self.username = opts[:username]
end

Instance Method Details

#==(other) ⇒ Object

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



14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
# File 'lib/ovirtsdk4/types.rb', line 14546

def ==(other)
  super &&
  @address == other.address &&
  @agents == other.agents &&
  @automatic_pm_enabled == other.automatic_pm_enabled &&
  @enabled == other.enabled &&
  @kdump_detection == other.kdump_detection &&
  @options == other.options &&
  @password == other.password &&
  @pm_proxies == other.pm_proxies &&
  @status == other.status &&
  @type == other.type &&
  @username == other.username
end

#addressString

Returns the value of the address attribute.

Returns:

  • (String)


14281
14282
14283
# File 'lib/ovirtsdk4/types.rb', line 14281

def address
  @address
end

#address=(value) ⇒ Object

Sets the value of the address attribute.

Parameters:

  • value (String)


14290
14291
14292
# File 'lib/ovirtsdk4/types.rb', line 14290

def address=(value)
  @address = value
end

#agentsArray<Agent>

Returns the value of the agents attribute.

Returns:



14299
14300
14301
# File 'lib/ovirtsdk4/types.rb', line 14299

def agents
  @agents
end

#agents=(list) ⇒ Object

Sets the value of the agents attribute.

Parameters:



14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
# File 'lib/ovirtsdk4/types.rb', line 14308

def agents=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Agent.new(value)
      end
    end
  end
  @agents = list
end

#automatic_pm_enabledBoolean

Returns the value of the automatic_pm_enabled attribute.

Returns:

  • (Boolean)


14325
14326
14327
# File 'lib/ovirtsdk4/types.rb', line 14325

def automatic_pm_enabled
  @automatic_pm_enabled
end

#automatic_pm_enabled=(value) ⇒ Object

Sets the value of the automatic_pm_enabled attribute.

Parameters:

  • value (Boolean)


14334
14335
14336
# File 'lib/ovirtsdk4/types.rb', line 14334

def automatic_pm_enabled=(value)
  @automatic_pm_enabled = value
end

#enabledBoolean

Returns the value of the enabled attribute.

Returns:

  • (Boolean)


14343
14344
14345
# File 'lib/ovirtsdk4/types.rb', line 14343

def enabled
  @enabled
end

#enabled=(value) ⇒ Object

Sets the value of the enabled attribute.

Parameters:

  • value (Boolean)


14352
14353
14354
# File 'lib/ovirtsdk4/types.rb', line 14352

def enabled=(value)
  @enabled = value
end

#hashObject

Generates a hash value for this object.



14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
# File 'lib/ovirtsdk4/types.rb', line 14564

def hash
  super +
  @address.hash +
  @agents.hash +
  @automatic_pm_enabled.hash +
  @enabled.hash +
  @kdump_detection.hash +
  @options.hash +
  @password.hash +
  @pm_proxies.hash +
  @status.hash +
  @type.hash +
  @username.hash
end

#kdump_detectionBoolean

Returns the value of the kdump_detection attribute.

Returns:

  • (Boolean)


14361
14362
14363
# File 'lib/ovirtsdk4/types.rb', line 14361

def kdump_detection
  @kdump_detection
end

#kdump_detection=(value) ⇒ Object

Sets the value of the kdump_detection attribute.

Parameters:

  • value (Boolean)


14370
14371
14372
# File 'lib/ovirtsdk4/types.rb', line 14370

def kdump_detection=(value)
  @kdump_detection = value
end

#optionsArray<Option>

Returns the value of the options attribute.

Returns:



14379
14380
14381
# File 'lib/ovirtsdk4/types.rb', line 14379

def options
  @options
end

#options=(list) ⇒ Object

Sets the value of the options attribute.

Parameters:



14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
# File 'lib/ovirtsdk4/types.rb', line 14388

def options=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Option.new(value)
      end
    end
  end
  @options = list
end

#passwordString

Returns the value of the password attribute.

Returns:

  • (String)


14405
14406
14407
# File 'lib/ovirtsdk4/types.rb', line 14405

def password
  @password
end

#password=(value) ⇒ Object

Sets the value of the password attribute.

Parameters:

  • value (String)


14414
14415
14416
# File 'lib/ovirtsdk4/types.rb', line 14414

def password=(value)
  @password = value
end

#pm_proxiesArray<PmProxy>

Returns the value of the pm_proxies attribute.

Returns:



14423
14424
14425
# File 'lib/ovirtsdk4/types.rb', line 14423

def pm_proxies
  @pm_proxies
end

#pm_proxies=(list) ⇒ Object

Sets the value of the pm_proxies attribute.

Parameters:



14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
# File 'lib/ovirtsdk4/types.rb', line 14432

def pm_proxies=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = PmProxy.new(value)
      end
    end
  end
  @pm_proxies = list
end

#statusPowerManagementStatus

Returns the value of the status attribute.



14449
14450
14451
# File 'lib/ovirtsdk4/types.rb', line 14449

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



14458
14459
14460
# File 'lib/ovirtsdk4/types.rb', line 14458

def status=(value)
  @status = value
end

#typeString

Returns the value of the type attribute.

Returns:

  • (String)


14467
14468
14469
# File 'lib/ovirtsdk4/types.rb', line 14467

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:

  • value (String)


14476
14477
14478
# File 'lib/ovirtsdk4/types.rb', line 14476

def type=(value)
  @type = value
end

#usernameString

Returns the value of the username attribute.

Returns:

  • (String)


14485
14486
14487
# File 'lib/ovirtsdk4/types.rb', line 14485

def username
  @username
end

#username=(value) ⇒ Object

Sets the value of the username attribute.

Parameters:

  • value (String)


14494
14495
14496
# File 'lib/ovirtsdk4/types.rb', line 14494

def username=(value)
  @username = value
end