Class: Fog::Hyperv::Compute::ComPort
- Defined in:
- lib/fog/hyperv/compute/models/com_port.rb
Overview
The configuration of a virtual COM port on a VM
Instance Attribute Summary collapse
-
#computer_name ⇒ String
readonly
The name of the computer running the VM that this COM port is attached to.
-
#debugger_mode ⇒ :On, :Off
If a debugger enabled on this COM port.
-
#id ⇒ String
readonly
The combined GUID of this COM port.
-
#name ⇒ String
readonly
The name of this COM port.
-
#path ⇒ String
The path of the file/socket this COM port is attached to.
-
#vm_id ⇒ String
readonly
The GUID of the VM this COM port is attached to.
Instance Method Summary collapse
-
#reload ⇒ Object
Reload attributes from Hyper-V.
-
#update ⇒ Object
Save any modifications to Hyper-V.
Methods inherited from Model
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 COM port is attached to.
17 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 17 attribute :computer_name, type: :string |
#debugger_mode ⇒ :On, :Off
Returns if a debugger enabled on this COM port.
21 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 21 attribute :debugger_mode, type: :hypervenum, values: Fog::Hyperv::ON_OFF_STATE_ENUM_VALUES |
#id ⇒ String (readonly)
Returns the combined GUID of this COM port.
10 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 10 identity :id, type: :string |
#name ⇒ String (readonly)
Returns the name of this COM port.
24 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 24 attribute :name, type: :string |
#path ⇒ String
Returns the path of the file/socket this COM port is attached to.
27 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 27 attribute :path |
#vm_id ⇒ String (readonly)
Returns the GUID of the VM this COM port is attached to.
14 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 14 attribute :vm_id, type: :string |
Instance Method Details
#reload ⇒ Object
Reload attributes from Hyper-V
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 55 def reload requires :vm_id, :id data = service.get_vm_com_port( computer_name:, vm_id:, id:, _return_fields: self.class.attributes ) return unless data merge_attributes(data) end |
#update ⇒ Object
Save any modifications to Hyper-V
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fog/hyperv/compute/models/com_port.rb', line 30 def update requires :vm_id, :id changes = { debugger_mode: changed!(:debugger_mode) }.compact # Ensure path: nil is sent changes[:path] = path if changed? :path return self unless changes.any? merge_attributes( service.set_vm_com_port( computer_name:, vm_id:, id:, **changes, _always_include: changes.keys, _return_fields: self.class.attributes ) ) end |