Class: Fog::Hyperv::Compute::IntegrationService

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/hyperv/compute/models/integration_service.rb

Constant Summary collapse

INTEGRATION_SERVICE_STATUS_ENUM_VALUES =
Note:

Defined by Microsoft.HyperV.PowerShell.VMIntegrationComponentOperationalStatus

Integration service statuses

{
  Ok:                    2,
  Degraded:              3,
  Error:                 6,
  NonRecoverableError:   7,
  NoContact:             12,
  LostCommunication:     13,
  Disabled:              32_896,
  ProtocolMismatch:      32_775,
  ApplicationCritical:   32_782,
  CommunicationTimedOut: 32_783,
  CommunicationFailed:   32_784
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#initialize

Methods included from ModelExtends

#collection

Methods included from ModelIncludes

#cluster, #computer, #dirty, #dirty?, #vm

Constructor Details

This class inherits a constructor from Fog::Hyperv::Model

Instance Attribute Details

#computer_nameString (readonly)

Returns the name of the computer running the VM that this integration service is attached to.

Returns:

  • (String)

    the name of the computer running the VM that this integration service is attached to



30
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 30

attribute :computer_name

#enabledBoolean

Returns if the integration service is enabled or not.

Returns:

  • (Boolean)

    if the integration service is enabled or not



37
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 37

attribute :enabled, type: :boolean

#nameString (readonly)

Returns the name of the integration service.

Returns:

  • (String)

    the name of the integration service



26
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 26

identity :name

#operational_statusSymbol (readonly)

Returns the statuses of the integration service.

Returns:

  • (Symbol)

    the statuses of the integration service

See Also:



41
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 41

attribute :operational_status, type: :hypervenumarray, values: INTEGRATION_SERVICE_STATUS_ENUM_VALUES

#vm_idString (readonly)

Returns the GUID of the VM this integration service is attached to.

Returns:

  • (String)

    the GUID of the VM this integration service is attached to



33
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 33

attribute :vm_id

Instance Method Details

#reloadObject



55
56
57
58
59
60
61
62
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 55

def reload
  requires :name, :vm_id

  data = service.get_vm_integration_service computer_name: computer_name, vm_id: vm_id, name: name
  return unless data

  merge_attributes(data)
end

#updateObject



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/hyperv/compute/models/integration_service.rb', line 43

def update
  requires :name, :vm_id

  return self unless changed? :enabled

  method = enabled ? :enable : :disable
  service.send(:"#{method}_vm_integration_service", computer_name: computer_name, vm_id: vm_id, name: name)

  old.enabled = attributes[:enabled]
  self
end