Class: OvirtSDK4::TemplateMediatedDevicesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(device, opts = {}) ⇒ VmMediatedDevice
Add new mediated device to the template.
-
#device_service(id) ⇒ TemplateMediatedDeviceService
Returns a reference to the service that manages a mediated device of a template.
-
#list(opts = {}) ⇒ Array<VmMediatedDevice>
Lists all the configured mediated devices of the template.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(device, opts = {}) ⇒ VmMediatedDevice
Add new mediated device to the template.
28275 28276 28277 |
# File 'lib/ovirtsdk4/services.rb', line 28275 def add(device, opts = {}) internal_add(device, VmMediatedDevice, ADD, opts) end |
#device_service(id) ⇒ TemplateMediatedDeviceService
Returns a reference to the service that manages a mediated device of a template.
28321 28322 28323 |
# File 'lib/ovirtsdk4/services.rb', line 28321 def device_service(id) TemplateMediatedDeviceService.new(self, id) end |
#list(opts = {}) ⇒ Array<VmMediatedDevice>
Lists all the configured mediated devices of the template.
The order of the returned list of mediated devices isn’t guaranteed.
28310 28311 28312 |
# File 'lib/ovirtsdk4/services.rb', line 28310 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
28332 28333 28334 28335 28336 28337 28338 28339 28340 28341 |
# File 'lib/ovirtsdk4/services.rb', line 28332 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return device_service(path) end return device_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |