Class: OvirtSDK4::SnapshotService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#cdroms_service ⇒ SnapshotCdromsService
Locates the
cdroms
service. -
#disks_service ⇒ SnapshotDisksService
Locates the
disks
service. -
#get(opts = {}) ⇒ Snapshot
Returns the representation of the object managed by this service.
-
#nics_service ⇒ SnapshotNicsService
Locates the
nics
service. -
#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.
20811 20812 20813 |
# File 'lib/ovirtsdk4/services.rb', line 20811 def cdroms_service @cdroms_service ||= SnapshotCdromsService.new(self, 'cdroms') end |
#disks_service ⇒ SnapshotDisksService
Locates the disks
service.
20820 20821 20822 |
# File 'lib/ovirtsdk4/services.rb', line 20820 def disks_service @disks_service ||= SnapshotDisksService.new(self, 'disks') end |
#get(opts = {}) ⇒ Snapshot
Returns the representation of the object managed by this service.
20695 20696 20697 |
# File 'lib/ovirtsdk4/services.rb', line 20695 def get(opts = {}) internal_get(GET, opts) end |
#nics_service ⇒ SnapshotNicsService
Locates the nics
service.
20829 20830 20831 |
# File 'lib/ovirtsdk4/services.rb', line 20829 def nics_service @nics_service ||= SnapshotNicsService.new(self, 'nics') end |
#remove(opts = {}) ⇒ Object
Deletes the object managed by this service.
20731 20732 20733 |
# File 'lib/ovirtsdk4/services.rb', line 20731 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
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. |
20802 20803 20804 |
# File 'lib/ovirtsdk4/services.rb', line 20802 def restore(opts = {}) internal_action(:restore, nil, RESTORE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
20840 20841 20842 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 |
# File 'lib/ovirtsdk4/services.rb', line 20840 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 |