Class: OvirtSDK4::OpenstackVolumeProviderService

Inherits:
ExternalProviderService 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

#authentication_keys_service ⇒ OpenstackVolumeAuthenticationKeysService

Locates the authentication_keys service.

Returns:



18225
18226
18227
# File 'lib/ovirtsdk4/services.rb', line 18225

def authentication_keys_service
  @authentication_keys_service ||= OpenstackVolumeAuthenticationKeysService.new(self, 'authenticationkeys')
end

#certificates_service ⇒ ExternalProviderCertificatesService

A service to view certificates for this external provider.

Returns:



18234
18235
18236
# File 'lib/ovirtsdk4/services.rb', line 18234

def certificates_service
  @certificates_service ||= ExternalProviderCertificatesService.new(self, 'certificates')
end

#get(opts = {}) ⇒ OpenStackVolumeProvider

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:



18100
18101
18102
# File 'lib/ovirtsdk4/services.rb', line 18100

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

#import_certificates(opts = {}) ⇒ Object

Import the SSL certificates of the external host provider.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :certificates (Array<Certificate>)
  • :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.



18126
18127
18128
# File 'lib/ovirtsdk4/services.rb', line 18126

def import_certificates(opts = {})
  internal_action(:importcertificates, nil, IMPORT_CERTIFICATES, opts)
end

#remove(opts = {}) ⇒ Object

Deletes the object managed by this service.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean) —

    Indicates if the remove should be performed asynchronously.

  • :force (Boolean) —

    Indicates if the operation should succeed, and the provider removed from the database, even if something fails during the operation.

    This parameter is optional, and the default value is false.

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



18156
18157
18158
# File 'lib/ovirtsdk4/services.rb', line 18156

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:



18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
# File 'lib/ovirtsdk4/services.rb', line 18254

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'authenticationkeys'
    return authentication_keys_service
  end
  if path.start_with?('authenticationkeys/')
    return authentication_keys_service.service(path[19..-1])
  end
  if path == 'certificates'
    return certificates_service
  end
  if path.start_with?('certificates/')
    return certificates_service.service(path[13..-1])
  end
  if path == 'volumetypes'
    return volume_types_service
  end
  if path.start_with?('volumetypes/')
    return volume_types_service.service(path[12..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#test_connectivity(opts = {}) ⇒ Object

In order to test connectivity for external provider we need to run following request where 123 is an id of a provider.

POST /ovirt-engine/api/externalhostproviders/123/testconnectivity HTTP/1.1

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean) —

    Indicates if the test 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.



18187
18188
18189
# File 'lib/ovirtsdk4/services.rb', line 18187

def test_connectivity(opts = {})
  internal_action(:testconnectivity, nil, TEST_CONNECTIVITY, opts)
end

#update(provider, opts = {}) ⇒ OpenStackVolumeProvider

Update the specified OpenStack volume provider in the system.

Parameters:

  • provider (OpenStackVolumeProvider) —

    The provider to update.

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



18216
18217
18218
# File 'lib/ovirtsdk4/services.rb', line 18216

def update(provider, opts = {})
  internal_update(provider, OpenStackVolumeProvider, UPDATE, opts)
end

#volume_types_service ⇒ OpenstackVolumeTypesService

Locates the volume_types service.

Returns:



18243
18244
18245
# File 'lib/ovirtsdk4/services.rb', line 18243

def volume_types_service
  @volume_types_service ||= OpenstackVolumeTypesService.new(self, 'volumetypes')
end