Class: OvirtSDK4::OpenstackImageService

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 = {}) ⇒ OpenStackImage

Returns the representation of the object managed by this service.

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:


16758
16759
16760
# File 'lib/ovirtsdk4/services.rb', line 16758

def get(opts = {})
  internal_get(GET, opts)
end

#import(opts = {}) ⇒ Object

Imports a virtual machine from a Glance image storage domain.

For example, to import the image with identifier 456 from the storage domain with identifier 123 send a request like this:

POST /ovirt-engine/api/openstackimageproviders/123/images/456/import

With a request body like this:

<action>
  <storage_domain>
    <name>images0</name>
  </storage_domain>
  <cluster>
    <name>images0</name>
  </cluster>
</action>

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the import should be performed asynchronously.

  • :cluster (Cluster)

    This parameter is mandatory in case of using import_as_template and indicates which cluster should be used for import glance image as template.

  • :disk (Disk)
  • :import_as_template (Boolean)

    Indicates whether the image should be imported as a template.

  • :storage_domain (StorageDomain)
  • :template (Template)
  • :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.


16822
16823
16824
# File 'lib/ovirtsdk4/services.rb', line 16822

def import(opts = {})
  internal_action(:import, nil, IMPORT, 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:


16833
16834
16835
16836
16837
16838
# File 'lib/ovirtsdk4/services.rb', line 16833

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