Class: OvirtSDK4::ExternalDiscoveredHostsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#host_service(id) ⇒ ExternalDiscoveredHostService
Locates the
host
service. -
#list(opts = {}) ⇒ Array<ExternalDiscoveredHost>
Get list of discovered hosts' information.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#host_service(id) ⇒ ExternalDiscoveredHostService
Locates the host
service.
9527 9528 9529 |
# File 'lib/ovirtsdk4/services.rb', line 9527 def host_service(id) ExternalDiscoveredHostService.new(self, id) end |
#list(opts = {}) ⇒ Array<ExternalDiscoveredHost>
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:
GET /ovirt-engine/api/externalhostproviders/123/discoveredhost
<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.
9516 9517 9518 |
# File 'lib/ovirtsdk4/services.rb', line 9516 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 |
# 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 |