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>
32210 32211 32212 |
# File 'lib/ovirtsdk4/services.rb', line 32210 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.
32244 32245 32246 |
# File 'lib/ovirtsdk4/services.rb', line 32244 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
32266 32267 32268 32269 32270 32271 32272 32273 32274 32275 |
# File 'lib/ovirtsdk4/services.rb', line 32266 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.
32255 32256 32257 |
# File 'lib/ovirtsdk4/services.rb', line 32255 def watchdog_service(id) VmWatchdogService.new(self, id) end |