class OvirtSDK4::ExternalDiscoveredHostsService

Constants

LIST

Public Instance Methods

host_service(id) click to toggle source

Locates the `host` service.

@param id [String] The identifier of the `host`.

@return [ExternalDiscoveredHostService] A reference to the `host` service.

# File lib/ovirtsdk4/services.rb, line 9527
def host_service(id)
  ExternalDiscoveredHostService.new(self, id)
end
list(opts = {}) click to toggle source

Get list of discovered hosts' information.

Discovered hosts are fetched from third-party providers such as Foreman.

To list all discovered hosts for provider `123` send the following:

source

GET /ovirt-engine/api/externalhostproviders/123/discoveredhost


source,xml

<external_discovered_hosts>

<external_discovered_host href="/ovirt-engine/api/externalhostproviders/123/discoveredhosts/456" id="456">
 <name>mac001a4ad04031</name>
 <ip>10.34.67.42</ip>
 <last_report>2017-04-24 11:05:41 UTC</last_report>
 <mac>00:1a:4a:d0:40:31</mac>
 <subnet_name>sat0</subnet_name>
 <external_host_provider href="/ovirt-engine/api/externalhostproviders/123" id="123"/>
</external_discovered_host>
<external_discovered_host href="/ovirt-engine/api/externalhostproviders/123/discoveredhosts/789" id="789">
 <name>mac001a4ad04040</name>
 <ip>10.34.67.43</ip>
 <last_report>2017-04-24 11:05:41 UTC</last_report>
 <mac>00:1a:4a:d0:40:40</mac>
 <subnet_name>sat0</subnet_name>
 <external_host_provider href="/ovirt-engine/api/externalhostproviders/123" id="123"/>
</external_discovered_host>
...

</external_discovered_hosts>


The order of the returned list of hosts isn't guaranteed.

@param opts [Hash] Additional options.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Integer] :max Sets the maximum number of hosts to return. If not specified all the hosts are returned.

@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 [Array<ExternalDiscoveredHost>]

# File lib/ovirtsdk4/services.rb, line 9516
def list(opts = {})
  internal_get(LIST, 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 9538
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return host_service(path)
  end
  return host_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end