Class: Fog::Compute::Hyperv::Firmware
Instance Method Summary
collapse
#lazy_attributes
#dirty?, #lazy_attributes, #parent
Instance Method Details
#reload ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/fog/hyperv/models/compute/firmware.rb', line 37
def reload
requires :computer_name, :vm_name
data = service.get_firmware(
computer_name: computer_name,
vm_name: vm_name,
_return_fields: self.class.attribute
)
merge_attributes(data.attributes)
self
end
|
#save ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/fog/hyperv/models/compute/firmware.rb', line 15
def save
requires :computetr_name, :vm_name
raise Fog::Hyperv::Errors::ServiceError, "Can't create Firmware instances" unless persisted?
data = service.set_firmware(
computer_name: computer_name,
vm_name: vm_name,
passthru: true,
enable_secure_boot: changed?(:secure_boot) ? (secure_boot && 'On' || 'Off') : nil,
preferred_network_boot_protocol: changed!(:preferred_network_boot_protocol),
console_mode: changed!(:console_mode),
_return_fields: self.class.attributes
)
merge_attributes(data)
@old = dup
self
end
|