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

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

Instance Method Summary collapse

Methods inherited from Hyperv::Model

#initialize

Methods included from Hyperv::ModelExtends

#lazy_attributes

Methods included from Hyperv::ModelIncludes

#cluster, #computer, #dirty?, #lazy_attributes, #parent, #vm

Constructor Details

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

Instance Method Details

#reloadObject



41
42
43
44
45
46
47
48
49
# File 'lib/fog/hyperv/models/compute/floppy_drive.rb', line 41

def reload
  data = collection.get(
    computer_name: computer_name,
    vm_name: vm_name
  )
  merge_attributes(data.attributes)
  @old = data
  self
end

#saveObject

TODO? VM Snapshots?



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/hyperv/models/compute/floppy_drive.rb', line 18

def save
  raise Fog::Hyperv::Errors::ServiceError, "Can't create new floppy drives" unless persisted?

  requires :computer_name, :vm_name

  data = \
    service.set_vm_floppy_disk_drive(
      computer_name: old.computer_name,
      vm_name: old.vm_name,
      passthru: true,

      resource_pool_name: changed!(:pool_name),
      path: changed?(:path) && (path || '$null'),

      _return_fields: self.class.attributes,
      _json_depth: 1
    )

  merge_attributes(data)
  @old = dup
  self
end