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 [Boolean] :seal Specifies if virtual machines created for the pool should be sealed after creation.

If this optional parameter is provided, and its value is `true`, virtual machines created for the pool
will be sealed after creation. If the value is 'false', the virtual machines will not be sealed.
If the parameter is not provided, the virtual machines will be sealed, only if they are created from
a sealed template and their guest OS is not set to Windows. This parameter affects only the virtual machines
created when the pool is created.

For example, to create a virtual machine pool with 5 virtual machines and to seal them, send a request
like this:

[source]
----
POST /ovirt-engine/api/vmpools?seal=true
----

With the following body:

[source,xml]
----
<vmpool>
  <name>mypool</name>
  <cluster id="123"/>
  <template id="456"/>
  <size>5</size>
</vmpool>
----

@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 35024
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 [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 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 35087
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 35098
def pool_service(id)
  VmPoolService.new(self, 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 35109
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