Class: OvirtSDK4::VmMediatedDeviceService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ VmMediatedDevice
Retrieves the configuration of mediated devices in the virtual machine.
-
#remove(opts = {}) ⇒ Object
Remove the mediated device from the virtual machine.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#update(device, opts = {}) ⇒ VmMediatedDevice
Updates the information about the mediated device.
Methods inherited from Service
Instance Method Details
#get(opts = {}) ⇒ VmMediatedDevice
Retrieves the configuration of mediated devices in the virtual machine.
33424 33425 33426 |
# File 'lib/ovirtsdk4/services.rb', line 33424 def get(opts = {}) internal_get(GET, opts) end |
#remove(opts = {}) ⇒ Object
Remove the mediated device from the virtual machine.
33449 33450 33451 |
# File 'lib/ovirtsdk4/services.rb', line 33449 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
33526 33527 33528 33529 33530 33531 |
# File 'lib/ovirtsdk4/services.rb', line 33526 def service(path) if path.nil? || path == '' return self end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
#update(device, opts = {}) ⇒ VmMediatedDevice
Updates the information about the mediated device.
You can update the information using specParams element.
For example, to update a mediated device, send a request like this:
PUT /ovirt-engine/api/vms/123/mediateddevices/00000000-0000-0000-0000-000000000000 HTTP/1.1
<vm_mediated_device>
<spec_params>
<property>
<name>mdevType</name>
<value>nvidia-11</value>
</property>
</spec_params>
</vm_mediated_device>
with response body:
<vm_mediated_device href="/ovirt-engine/api/vms/123/mediateddevices/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
<vm href="/ovirt-engine/api/vms/123" id="123"/>
<spec_params>
<property>
<name>mdevType</name>
<value>nvidia-11</value>
</property>
</spec_params>
</vm_mediated_device>
33515 33516 33517 |
# File 'lib/ovirtsdk4/services.rb', line 33515 def update(device, opts = {}) internal_update(device, VmMediatedDevice, UPDATE, opts) end |