Class: Fog::Compute::Hyperv::FloppyDrive
- Inherits:
-
Hyperv::Model
- Object
- Model
- Hyperv::Model
- Fog::Compute::Hyperv::FloppyDrive
- Defined in:
- lib/fog/hyperv/models/compute/floppy_drive.rb
Instance Method Summary collapse
- #reload ⇒ Object
-
#save ⇒ Object
TODO? VM Snapshots?.
Methods inherited from Hyperv::Model
Methods included from Hyperv::ModelExtends
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
#reload ⇒ Object
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 |
#save ⇒ Object
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 |