Method: OvirtSDK4::HostsService#list

Defined in:
lib/ovirtsdk4/services.rb

#list(opts = {}) ⇒ Array<Host>

Get a list of all available hosts.

For example, to list the hosts send the following request:

GET /ovirt-engine/api/hosts

The response body will be similar to this:

<hosts>
  <host href="/ovirt-engine/api/hosts/123" id="123">
    ...
  </host>
  <host href="/ovirt-engine/api/hosts/456" id="456">
    ...
  </host>
  ...
</host>

The order of the returned list of hosts is guaranteed only if the sortby clause is included in the search parameter.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :all_content (Boolean)

    Indicates if all of the attributes of the hosts should be included in the response.

    By default the following host attributes are excluded:

    • hosted_engine

    For example, to retrieve the complete representation of the hosts:

    GET /ovirt-engine/api/hosts?all_content=true
    Note
    These attributes are not included by default because retrieving them impacts performance. They are seldom used and require additional queries to the database. Use this parameter with caution and only when specifically required.
  • :case_sensitive (Boolean)

    Indicates if the search performed using the search parameter should be performed taking case into account. The default value is true, which means that case is taken into account. If you want to search ignoring case set it to false.

  • :check_vms_in_affinity_closure (Boolean)

    This parameter can be used with migration_target_of to get valid migration targets for the listed virtual machines and all other virtual machines that are in positive enforcing affinity with the listed virtual machines.

    This is useful in case the virtual machines will be migrated together with others in positive affinity groups.

    The default value is false.

    GET /ovirt-engine/api/hosts?migration_target_of=123,456&check_vms_in_affinity_closure=true
  • :filter (Boolean)

    Indicates if the results should be filtered according to the permissions of the user.

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

  • :max (Integer)

    Sets the maximum number of hosts to return. If not specified all the hosts are returned.

  • :migration_target_of (String)

    Accepts a comma-separated list of virtual machine IDs and returns the hosts that these virtual machines can be migrated to.

    For example, to retrieve the list of hosts to which the virtual machine with ID 123 and the virtual machine with ID 456 can be migrated to, send the following request:

    GET /ovirt-engine/api/hosts?migration_target_of=123,456
  • :search (String)

    A query string used to restrict the returned hosts.

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



12881
12882
12883
# File 'lib/ovirtsdk4/services.rb', line 12881

def list(opts = {})
  internal_get(LIST, opts)
end