class OvirtSDK4::VmPoolsService

Constants

ADD
LIST

Public Instance Methods

add(pool, opts = {}) click to toggle source

Creates a new virtual machine pool.

A new pool requires the `name`, `cluster` and `template` attributes. Identify the cluster and template with the `id` or `name` nested attributes:

source

POST /ovirt-engine/api/vmpools


With the following body:

source,xml

<vmpool>

<name>mypool</name>
<cluster id="123"/>
<template id="456"/>

</vmpool>


@param pool [VmPool] Pool to add.

@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 [VmPool]

# File lib/ovirtsdk4/services.rb, line 28573
def add(pool, opts = {})
  internal_add(pool, VmPool, ADD, opts)
end
list(opts = {}) click to toggle source

Get a list of available virtual machines pools.

source

GET /ovirt-engine/api/vmpools


You will receive the following response:

source,xml

<vm_pools>

<vm_pool id="123">
  ...
</vm_pool>
...

</vm_pools>


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

@param opts [Hash] Additional options.

@option opts [Boolean] :case_sensitive 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`.

@option opts [Boolean] :filter Indicates if the results should be filtered according to the permissions of the user.

@option opts [Integer] :max Sets the maximum number of pools to return. If this value is not specified, all of the pools are returned.

@option opts [String] :search A query string used to restrict the returned pools.

@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<VmPool>]

# File lib/ovirtsdk4/services.rb, line 28632
def list(opts = {})
  internal_get(LIST, opts)
end
pool_service(id) click to toggle source

Reference to the service that manages a specific virtual machine pool.

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

@return [VmPoolService] A reference to the `pool` service.

# File lib/ovirtsdk4/services.rb, line 28643
def pool_service(id)
  VmPoolService.new(@connection, "#{@path}/#{id}")
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 28654
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return pool_service(path)
  end
  return pool_service(path[0..(index - 1)]).service(path[(index +1)..-1])
end
to_s() click to toggle source

Returns an string representation of this service.

@return [String]

# File lib/ovirtsdk4/services.rb, line 28670
def to_s
  "#<#{VmPoolsService}:#{@path}>"
end