Class: Fog::Hyperv::Compute::FloppyDrive
- Defined in:
- lib/fog/hyperv/compute/models/floppy_drive.rb
Instance Attribute Summary collapse
-
#computer_name ⇒ String
readonly
The name of the computer running the VM that this BIOS configuration is attached to.
-
#id ⇒ String
readonly
The combined GUID of this floppy drive.
-
#name ⇒ String
readonly
The name of this floppy drive.
-
#path ⇒ String
The path this floppy drive is serving.
-
#pool_name ⇒ String
The pool storing this floppy drive’s image.
-
#vm_id ⇒ String
readonly
The GUID of the VM this BIOS configuration is attached to.
Instance Method Summary collapse
Methods inherited from Model
#initialize, #merge_attributes
Methods included from ModelExtends
Methods included from ModelIncludes
#cluster, #computer, #dirty, #dirty?, #vm
Constructor Details
This class inherits a constructor from Fog::Hyperv::Model
Instance Attribute Details
#computer_name ⇒ String (readonly)
Returns 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 |
#id ⇒ String (readonly)
Returns the combined GUID of this floppy drive.
7 |
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 7 identity :id, type: :string |
#name ⇒ String (readonly)
Returns the name of this floppy drive.
18 |
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 18 attribute :name, type: :string |
#path ⇒ String
Returns the path this floppy drive is serving.
21 |
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 21 attribute :path |
#pool_name ⇒ String
Returns the pool storing this floppy drive’s image.
24 |
# File 'lib/fog/hyperv/compute/models/floppy_drive.rb', line 24 attribute :pool_name |
#vm_id ⇒ String (readonly)
Returns 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
#reload ⇒ Object
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 |
#update ⇒ Object
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 |