Class: OvirtSDK4::TemplateMediatedDeviceService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#get(opts = {}) ⇒ VmMediatedDevice

Gets mediated device configuration of the template.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



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.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the remove should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



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.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



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>

Parameters:

  • devices (VmMediatedDevice)

    The information about the mediated device.

    The request data must contain specParams properties. The response data contains complete information about the updated mediated device.

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the update should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



28230
28231
28232
# File 'lib/ovirtsdk4/services.rb', line 28230

def update(devices, opts = {})
  internal_update(devices, VmMediatedDevice, UPDATE, opts)
end