Class: OvirtSDK4::VmPoolsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(pool, opts = {}) ⇒ VmPool
Creates a new virtual machine pool.
-
#list(opts = {}) ⇒ Array<VmPool>
Get a list of available virtual machines pools.
-
#pool_service(id) ⇒ VmPoolService
Reference to the service that manages a specific virtual machine pool.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(pool, opts = {}) ⇒ VmPool
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:
POST /ovirt-engine/api/vmpools
With the following body:
<vmpool>
<name>mypool</name>
<cluster id="123"/>
<template id="456"/>
</vmpool>
35024 35025 35026 |
# File 'lib/ovirtsdk4/services.rb', line 35024 def add(pool, opts = {}) internal_add(pool, VmPool, ADD, opts) end |
#list(opts = {}) ⇒ Array<VmPool>
Get a list of available virtual machines pools.
GET /ovirt-engine/api/vmpools
You will receive the following response:
<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.
35087 35088 35089 |
# File 'lib/ovirtsdk4/services.rb', line 35087 def list(opts = {}) internal_get(LIST, opts) end |
#pool_service(id) ⇒ VmPoolService
Reference to the service that manages a specific virtual machine pool.
35098 35099 35100 |
# File 'lib/ovirtsdk4/services.rb', line 35098 def pool_service(id) VmPoolService.new(self, id) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
35109 35110 35111 35112 35113 35114 35115 35116 35117 35118 |
# 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 |