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.
28140 28141 28142 |
# File 'lib/ovirtsdk4/services.rb', line 28140 def get(opts = {}) internal_get(GET, opts) end |
#remove(opts = {}) ⇒ Object
Remove the mediated device from the template.
28165 28166 28167 |
# File 'lib/ovirtsdk4/services.rb', line 28165 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
28241 28242 28243 28244 28245 28246 |
# File 'lib/ovirtsdk4/services.rb', line 28241 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
<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>
28230 28231 28232 |
# File 'lib/ovirtsdk4/services.rb', line 28230 def update(devices, opts = {}) internal_update(devices, VmMediatedDevice, UPDATE, opts) end |