Class: Fog::Compute::Hyperv::Bios
- Inherits:
-
Hyperv::Model
- Object
- Model
- Hyperv::Model
- Fog::Compute::Hyperv::Bios
- Defined in:
- lib/fog/hyperv/models/compute/bios.rb
Instance Attribute Summary collapse
-
#computer ⇒ Object
readonly
Returns the value of attribute computer.
-
#vm ⇒ Object
readonly
Returns the value of attribute vm.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Bios
constructor
A new instance of Bios.
- #reload ⇒ Object
- #save ⇒ Object
Methods included from Hyperv::ModelExtends
Methods included from Hyperv::ModelIncludes
#cluster, #dirty?, #lazy_attributes, #parent
Constructor Details
#initialize(args = {}) ⇒ Bios
Returns a new instance of Bios.
16 17 18 19 20 |
# File 'lib/fog/hyperv/models/compute/bios.rb', line 16 def initialize(args = {}) super @computer = args.delete :computer @vm = args.delete :vm end |
Instance Attribute Details
#computer ⇒ Object (readonly)
Returns the value of attribute computer.
14 15 16 |
# File 'lib/fog/hyperv/models/compute/bios.rb', line 14 def computer @computer end |
#vm ⇒ Object (readonly)
Returns the value of attribute vm.
14 15 16 |
# File 'lib/fog/hyperv/models/compute/bios.rb', line 14 def vm @vm end |
Instance Method Details
#reload ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/fog/hyperv/models/compute/bios.rb', line 45 def reload requires :computer_name, :vm_name data = service.get_vm_bios( computer_name: computer_name, vm_name: vm_name, _return_fields: self.class.attributes, _json_depth: 1 ) merge_attributes(data) self end |
#save ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fog/hyperv/models/compute/bios.rb', line 22 def save requires :computer_name, :vm_name raise Fog::Hyperv::Errors::ServiceError, "Can't create Bios instances" unless persisted? data = service.set_vm_bios( computer_name: computer_name, vm_name: vm_name, passthru: true, disable_num_lock: changed?(:num_lock_enabled) && !num_lock_enabled, enable_num_lock: changed?(:num_lock_enabled) && num_lock_enabled, startup_order: changed!(:startup_order), _return_fields: self.class.attributes, _json_depth: 1 ) merge_attributes(data) @old = dup self end |