class OvirtSDK4::ExternalHostProviderService

Constants

GET
REMOVE
UPDATE

Public Instance Methods

certificates_service() click to toggle source

A service to view certificates for this external provider.

@return [ExternalProviderCertificatesService] A reference to `certificates` service.

# File lib/ovirtsdk4/services.rb, line 28903
def certificates_service
  @certificates_service ||= ExternalProviderCertificatesService.new(self, 'certificates')
end
compute_resources_service() click to toggle source

Locates the `compute_resources` service.

@return [ExternalComputeResourcesService] A reference to `compute_resources` service.

# File lib/ovirtsdk4/services.rb, line 28912
def compute_resources_service
  @compute_resources_service ||= ExternalComputeResourcesService.new(self, 'computeresources')
end
discovered_hosts_service() click to toggle source

Locates the `discovered_hosts` service.

@return [ExternalDiscoveredHostsService] A reference to `discovered_hosts` service.

# File lib/ovirtsdk4/services.rb, line 28921
def discovered_hosts_service
  @discovered_hosts_service ||= ExternalDiscoveredHostsService.new(self, 'discoveredhosts')
end
get(opts = {}) click to toggle source

Get external host provider information

Host provider, Foreman or Satellite, can be set as an external provider in ovirt. To see details about specific host providers attached to ovirt use this API.

For example, to get the details of host provider `123`, send a request like this:

.… GET /ovirt-engine/api/externalhostproviders/123 .…

The response will be like this:

source,xml

<external_host_provider href=“/ovirt-engine/api/externalhostproviders/123” id=“123”>

<name>mysatellite</name>
<requires_authentication>true</requires_authentication>
<url>https://mysatellite.example.com</url>
<username>admin</username>

</external_host_provider>


@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [ExternalHostProvider]

# File lib/ovirtsdk4/services.rb, line 28794
def get(opts = {})
  internal_get(GET, opts)
end
host_groups_service() click to toggle source

Locates the `host_groups` service.

@return [ExternalHostGroupsService] A reference to `host_groups` service.

# File lib/ovirtsdk4/services.rb, line 28930
def host_groups_service
  @host_groups_service ||= ExternalHostGroupsService.new(self, 'hostgroups')
end
hosts_service() click to toggle source

Locates the `hosts` service.

@return [ExternalHostsService] A reference to `hosts` service.

# File lib/ovirtsdk4/services.rb, line 28939
def hosts_service
  @hosts_service ||= ExternalHostsService.new(self, 'hosts')
end
import_certificates(opts = {}) click to toggle source

Executes the `import_certificates` method.

@param opts [Hash] Additional options.

@option opts [Array<Certificate>] :certificates

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

# File lib/ovirtsdk4/services.rb, line 28814
def import_certificates(opts = {})
  internal_action(:importcertificates, nil, opts)
end
remove(opts = {}) click to toggle source

Deletes the object managed by this service.

@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the remove should be performed asynchronously. @option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

# File lib/ovirtsdk4/services.rb, line 28839
def remove(opts = {})
  internal_remove(REMOVE, opts)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 28950
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 == 'computeresources'
    return compute_resources_service
  end
  if path.start_with?('computeresources/')
    return compute_resources_service.service(path[17..-1])
  end
  if path == 'discoveredhosts'
    return discovered_hosts_service
  end
  if path.start_with?('discoveredhosts/')
    return discovered_hosts_service.service(path[16..-1])
  end
  if path == 'hostgroups'
    return host_groups_service
  end
  if path.start_with?('hostgroups/')
    return host_groups_service.service(path[11..-1])
  end
  if path == 'hosts'
    return hosts_service
  end
  if path.start_with?('hosts/')
    return hosts_service.service(path[6..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end
test_connectivity(opts = {}) click to toggle source

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

source

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


@param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the test should be performed asynchronously.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

# File lib/ovirtsdk4/services.rb, line 28865
def test_connectivity(opts = {})
  internal_action(:testconnectivity, nil, opts)
end
update(provider, opts = {}) click to toggle source

Updates the `provider`.

@param provider [ExternalHostProvider] The `provider` to update. @param opts [Hash] Additional options.

@option opts [Boolean] :async Indicates if the update should be performed asynchronously.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [ExternalHostProvider]

# File lib/ovirtsdk4/services.rb, line 28894
def update(provider, opts = {})
  internal_update(provider, ExternalHostProvider, UPDATE, opts)
end