Class: OvirtSDK4::AffinityGroupHostsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(host, opts = {}) ⇒ Host
Adds a host to the affinity group.
-
#host_service(id) ⇒ AffinityGroupHostService
Access the service that manages the host assignment to this affinity group.
-
#list(opts = {}) ⇒ Array<Host>
List all hosts assigned to this affinity group.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(host, opts = {}) ⇒ Host
Adds a host to the affinity group.
For example, to add the host 789
to the affinity group 456
of cluster 123
, send a request like
this:
POST /ovirt-engine/api/clusters/123/affinitygroups/456/hosts
With the following body:
<host id="789"/>
1293 1294 1295 |
# File 'lib/ovirtsdk4/services.rb', line 1293 def add(host, opts = {}) internal_add(host, Host, ADD, opts) end |
#host_service(id) ⇒ AffinityGroupHostService
Access the service that manages the host assignment to this affinity group.
1339 1340 1341 |
# File 'lib/ovirtsdk4/services.rb', line 1339 def host_service(id) AffinityGroupHostService.new(self, id) end |
#list(opts = {}) ⇒ Array<Host>
List all hosts assigned to this affinity group.
The order of the returned hosts isn’t guaranteed.
1328 1329 1330 |
# File 'lib/ovirtsdk4/services.rb', line 1328 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 |
# File 'lib/ovirtsdk4/services.rb', line 1350 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 |