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.
33868 33869 33870 |
# File 'lib/ovirtsdk4/services.rb', line 33868 def get(opts = {}) internal_get(GET, opts) end |
#remove(opts = {}) ⇒ Object
Remove the mediated device from the virtual machine.
33893 33894 33895 |
# File 'lib/ovirtsdk4/services.rb', line 33893 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
33969 33970 33971 33972 33973 33974 |
# File 'lib/ovirtsdk4/services.rb', line 33969 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
<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>
33958 33959 33960 |
# File 'lib/ovirtsdk4/services.rb', line 33958 def update(device, opts = {}) internal_update(device, VmMediatedDevice, UPDATE, opts) end |