Class: OvirtSDK4::SnapshotService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#cdroms_service ⇒ SnapshotCdromsService
Locates the
cdromsservice. -
#disks_service ⇒ SnapshotDisksService
Locates the
disksservice. -
#get(opts = {}) ⇒ Snapshot
Returns the representation of the object managed by this service.
-
#nics_service ⇒ SnapshotNicsService
Locates the
nicsservice. -
#remove(opts = {}) ⇒ Object
Deletes the object managed by this service.
-
#restore(opts = {}) ⇒ Object
Restores a virtual machine snapshot.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#cdroms_service ⇒ SnapshotCdromsService
Locates the cdroms service.
20667 20668 20669 |
# File 'lib/ovirtsdk4/services.rb', line 20667 def cdroms_service @cdroms_service ||= SnapshotCdromsService.new(self, 'cdroms') end |
#disks_service ⇒ SnapshotDisksService
Locates the disks service.
20676 20677 20678 |
# File 'lib/ovirtsdk4/services.rb', line 20676 def disks_service @disks_service ||= SnapshotDisksService.new(self, 'disks') end |
#get(opts = {}) ⇒ Snapshot
Returns the representation of the object managed by this service.
20555 20556 20557 |
# File 'lib/ovirtsdk4/services.rb', line 20555 def get(opts = {}) internal_get(GET, opts) end |
#nics_service ⇒ SnapshotNicsService
Locates the nics service.
20685 20686 20687 |
# File 'lib/ovirtsdk4/services.rb', line 20685 def nics_service @nics_service ||= SnapshotNicsService.new(self, 'nics') end |
#remove(opts = {}) ⇒ Object
Deletes the object managed by this service.
20591 20592 20593 |
# File 'lib/ovirtsdk4/services.rb', line 20591 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#restore(opts = {}) ⇒ Object
Restores a virtual machine snapshot.
For example, to restore the snapshot with identifier 456 of virtual machine with identifier 123 send a
request like this:
POST /ovirt-engine/api/vms/123/snapshots/456/restore HTTP/1.1
With an empty action in the body:
<action/>
|
Note
|
Confirm that the commit operation is finished and the virtual machine is down before running the virtual machine. |
20658 20659 20660 |
# File 'lib/ovirtsdk4/services.rb', line 20658 def restore(opts = {}) internal_action(:restore, nil, RESTORE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
20696 20697 20698 20699 20700 20701 20702 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 20718 20719 |
# File 'lib/ovirtsdk4/services.rb', line 20696 def service(path) if path.nil? || path == '' return self end if path == 'cdroms' return cdroms_service end if path.start_with?('cdroms/') return cdroms_service.service(path[7..-1]) end if path == 'disks' return disks_service end if path.start_with?('disks/') return disks_service.service(path[6..-1]) end if path == 'nics' return nics_service end if path.start_with?('nics/') return nics_service.service(path[5..-1]) end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |