Class: OvirtSDK4::StorageServerConnectionExtensionsService

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(extension, opts = {}) ⇒ StorageConnectionExtension

Creates a new storage server connection extension for the given host.

The extension lets the user define credentials for an iSCSI target for a specific host. For example to use myuser and mypassword as the credentials when connecting to the iSCSI target from host 123 send a request like this:

POST /ovirt-engine/api/hosts/123/storageconnectionextensions

With a request body like this:

<storage_connection_extension>
  <target>iqn.2016-01.com.example:mytarget</target>
  <username>myuser</username>
  <password>mypassword</password>
</storage_connection_extension>

Parameters:

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:


24979
24980
24981
# File 'lib/ovirtsdk4/services.rb', line 24979

def add(extension, opts = {})
  internal_add(extension, StorageConnectionExtension, ADD, opts)
end

#list(opts = {}) ⇒ Array<StorageConnectionExtension>

Returns the list os storage connection extensions.

The order of the returned list of storage connections isn’t guaranteed.

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.

  • :max (Integer)

    Sets the maximum number of extensions to return. If not specified all the extensions are returned.

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


25013
25014
25015
# File 'lib/ovirtsdk4/services.rb', line 25013

def list(opts = {})
  internal_get(LIST, 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.


25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
# File 'lib/ovirtsdk4/services.rb', line 25035

def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return storage_connection_extension_service(path)
  end
  return storage_connection_extension_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end

#storage_connection_extension_service(id) ⇒ StorageServerConnectionExtensionService

Locates the storage_connection_extension service.

Parameters:

  • id (String)

    The identifier of the storage_connection_extension.

Returns:


25024
25025
25026
# File 'lib/ovirtsdk4/services.rb', line 25024

def storage_connection_extension_service(id)
  StorageServerConnectionExtensionService.new(self, id)
end