Class: OvirtSDK4::OpenstackImageProviderService

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

#certificates_serviceExternalProviderCertificatesService

A service to view certificates for this external provider.



15891
15892
15893
# File 'lib/ovirtsdk4/services.rb', line 15891

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

#get(opts = {}) ⇒ OpenStackImageProvider

Returns the representation of the object managed by this service.

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.



15770
15771
15772
# File 'lib/ovirtsdk4/services.rb', line 15770

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

#images_serviceOpenstackImagesService

Locates the images service.



15900
15901
15902
# File 'lib/ovirtsdk4/services.rb', line 15900

def images_service
  @images_service ||= OpenstackImagesService.new(self, 'images')
end

#import_certificates(opts = {}) ⇒ Object

Import the SSL certificates of the external host provider.

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.



15796
15797
15798
# File 'lib/ovirtsdk4/services.rb', line 15796

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

#remove(opts = {}) ⇒ Object

Deletes the object managed by this service.

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.



15821
15822
15823
# File 'lib/ovirtsdk4/services.rb', line 15821

def remove(opts = {})
  internal_remove(REMOVE, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Raises:



15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
# File 'lib/ovirtsdk4/services.rb', line 15911

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'certificates'
    return certificates_service
  end
  if path.start_with?('certificates/')
    return certificates_service.service(path[13..-1])
  end
  if path == 'images'
    return images_service
  end
  if path.start_with?('images/')
    return images_service.service(path[7..-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

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.



15853
15854
15855
# File 'lib/ovirtsdk4/services.rb', line 15853

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

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

Update the specified OpenStack image provider in the system.

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.



15882
15883
15884
# File 'lib/ovirtsdk4/services.rb', line 15882

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