Class: Fog::Hyperv::Compute::FloppyDrive

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#initialize, #merge_attributes

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 BIOS configuration is attached to.

Returns:

  • (String)

    the name of the computer running the VM that this BIOS configuration is attached to



14
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 14

attribute :computer_name, type: :string

#idString (readonly)

Returns the combined GUID of this floppy drive.

Returns:

  • (String)

    the combined GUID of this floppy drive



7
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 7

identity :id, type: :string

#nameString (readonly)

Returns the name of this floppy drive.

Returns:

  • (String)

    the name of this floppy drive



18
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 18

attribute :name, type: :string

#pathString

Returns the path this floppy drive is serving.

Returns:

  • (String)

    the path this floppy drive is serving



21
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 21

attribute :path

#pool_nameString

Returns the pool storing this floppy drive’s image.

Returns:

  • (String)

    the pool storing this floppy drive’s image



24
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 24

attribute :pool_name

#vm_idString (readonly)

Returns the GUID of the VM this BIOS configuration is attached to.

Returns:

  • (String)

    the GUID of the VM this BIOS configuration is attached to



11
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 11

attribute :vm_id, type: :string

Instance Method Details

#reloadObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 49

def reload
  requires :vm_id, :id

  data = service.get_vm_floppy_disk_drive(
    computer_name:,
    vm_id:,
    id:,

    _return_fields: self.class.attributes
  )
  return unless data

  merge_attributes(data)
end

#updateObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 26

def update
  requires :vm_id, :id

  changes = {
    resource_pool_name: changed!(:pool_name)
  }.compact
  changes[:path] = path if changed? :path
  return self unless changes.any?

  merge_attributes(
    service.set_vm_floppy_disk_drive(
      computer_name:,
      vm_id:,
      id:,

      **changes,

      _always_include: changes.keys,
      _return_fields: self.class.attributes
    )
  )
end