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_or_name) ⇒ AffinityGroupHostService
Access the service that manages the host assignment to this affinity group by host id or name.
-
#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 HTTP/1.1
With the following body:
<host id="789"/>
1307 1308 1309 |
# File 'lib/ovirtsdk4/services.rb', line 1307 def add(host, opts = {}) internal_add(host, Host, ADD, opts) end |
#host_service(id_or_name) ⇒ AffinityGroupHostService
Access the service that manages the host assignment to this affinity group by host id or name.
1353 1354 1355 |
# File 'lib/ovirtsdk4/services.rb', line 1353 def host_service(id_or_name) AffinityGroupHostService.new(self, id_or_name) end |
#list(opts = {}) ⇒ Array<Host>
List all hosts assigned to this affinity group.
The order of the returned hosts isn’t guaranteed.
1342 1343 1344 |
# File 'lib/ovirtsdk4/services.rb', line 1342 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 |
# File 'lib/ovirtsdk4/services.rb', line 1364 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 |