Class: OvirtSDK4::ExternalTemplateImportsService

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

#add(import, opts = {}) ⇒ ExternalTemplateImport

This operation is used to import a template from external hypervisor.

For example import of a template OVA can be facilitated using the following request:

POST /externaltemplateimports

With request body of type ExternalTemplateImport, for example:

<external_template_import>
  <template>
    <name>my_template</name>
  </template>
  <cluster id="2b18aca2-4469-11eb-9449-482ae35a5f83" />
  <storage_domain id="8bb5ade5-e988-4000-8b93-dbfc6717fe50" />
  <url>ova:///mnt/ova/ova_template.ova</url>
  <host id="8bb5ade5-e988-4000-8b93-dbfc6717fe50" />
</external_template_import>

Parameters:

  • import (ExternalTemplateImport)

    The import to add.

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

    Additional options.

Options Hash (opts):

  • :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:



10318
10319
10320
# File 'lib/ovirtsdk4/services.rb', line 10318

def add(import, opts = {})
  internal_add(import, ExternalTemplateImport, ADD, 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:



10329
10330
10331
10332
10333
10334
# File 'lib/ovirtsdk4/services.rb', line 10329

def service(path)
  if path.nil? || path == ''
    return self
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end