Class: OvirtSDK4::VmWatchdogsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(watchdog, opts = {}) ⇒ Watchdog
Adds new watchdog to the virtual machine.
-
#list(opts = {}) ⇒ Array<Watchdog>
The list of watchdogs of the virtual machine.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#watchdog_service(id) ⇒ VmWatchdogService
Returns a reference to the service that manages a specific watchdog.
Methods inherited from Service
Instance Method Details
#add(watchdog, opts = {}) ⇒ Watchdog
Adds new watchdog to the virtual machine.
For example, to add a watchdog to a virtual machine, send a request like this:
POST /ovirt-engine/api/vms/123/watchdogs
<watchdog>
<action>poweroff</action>
<model>i6300esb</model>
</watchdog>
with response body:
<watchdog href="/ovirt-engine/api/vms/123/watchdogs/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
<vm href="/ovirt-engine/api/vms/123" id="123"/>
<action>poweroff</action>
<model>i6300esb</model>
</watchdog>
35560 35561 35562 |
# File 'lib/ovirtsdk4/services.rb', line 35560 def add(watchdog, opts = {}) internal_add(watchdog, Watchdog, ADD, opts) end |
#list(opts = {}) ⇒ Array<Watchdog>
The list of watchdogs of the virtual machine.
The order of the returned list of watchdogs isn’t guaranteed.
35594 35595 35596 |
# File 'lib/ovirtsdk4/services.rb', line 35594 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
35616 35617 35618 35619 35620 35621 35622 35623 35624 35625 |
# File 'lib/ovirtsdk4/services.rb', line 35616 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return watchdog_service(path) end return watchdog_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |
#watchdog_service(id) ⇒ VmWatchdogService
Returns a reference to the service that manages a specific watchdog.
35605 35606 35607 |
# File 'lib/ovirtsdk4/services.rb', line 35605 def watchdog_service(id) VmWatchdogService.new(self, id) end |