Class: OvirtSDK4::TemplateMediatedDeviceService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#get(opts = {}) ⇒ VmMediatedDevice
Gets mediated device configuration of the template.
-
#remove(opts = {}) ⇒ Object
Remove the mediated device from the template.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#update(devices, opts = {}) ⇒ VmMediatedDevice
Updates the information about the mediated device.
Methods inherited from Service
Instance Method Details
#get(opts = {}) ⇒ VmMediatedDevice
Gets mediated device configuration of the template.
27780 27781 27782 |
# File 'lib/ovirtsdk4/services.rb', line 27780 def get(opts = {}) internal_get(GET, opts) end |
#remove(opts = {}) ⇒ Object
Remove the mediated device from the template.
27805 27806 27807 |
# File 'lib/ovirtsdk4/services.rb', line 27805 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
27882 27883 27884 27885 27886 27887 |
# File 'lib/ovirtsdk4/services.rb', line 27882 def service(path) if path.nil? || path == '' return self end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
#update(devices, 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/templates/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/templates/123/mediateddevices/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
<template href="/ovirt-engine/api/templates/123" id="123"/>
<spec_params>
<property>
<name>mdevType</name>
<value>nvidia-11</value>
</property>
</spec_params>
</vm_mediated_device>
27871 27872 27873 |
# File 'lib/ovirtsdk4/services.rb', line 27871 def update(devices, opts = {}) internal_update(devices, VmMediatedDevice, UPDATE, opts) end |