class OvirtSDK4::SnapshotService
Constants
- GET
- REMOVE
Public Instance Methods
Locates the `cdroms` service.
@return [SnapshotCdromsService] A reference to `cdroms` service.
# File lib/ovirtsdk4/services.rb, line 17377 def cdroms_service @cdroms_service ||= SnapshotCdromsService.new(self, 'cdroms') end
Locates the `disks` service.
@return [SnapshotDisksService] A reference to `disks` service.
# File lib/ovirtsdk4/services.rb, line 17386 def disks_service @disks_service ||= SnapshotDisksService.new(self, 'disks') end
Returns the representation of the object managed by this service.
@param opts [Hash] Additional options.
@option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
@return [Snapshot]
# File lib/ovirtsdk4/services.rb, line 17304 def get(opts = {}) internal_get(GET, opts) end
Locates the `nics` service.
@return [SnapshotNicsService] A reference to `nics` service.
# File lib/ovirtsdk4/services.rb, line 17395 def nics_service @nics_service ||= SnapshotNicsService.new(self, 'nics') end
Deletes the object managed by this service.
@param opts [Hash] Additional options.
@option opts [Boolean] :async Indicates if the remove should be performed asynchronously. @option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
# File lib/ovirtsdk4/services.rb, line 17329 def remove(opts = {}) internal_remove(REMOVE, opts) end
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:
- source
POST /ovirt-engine/api/vms/123/snapshots/456/restore
With an empty `action` in the body:
- source,xml
<action/>
@param opts [Hash] Additional options.
@option opts [Boolean] :async Indicates if the restore should be performed asynchronously.
@option opts [Array<Disk>] :disks
@option opts [Boolean] :restore_memory
@option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
# File lib/ovirtsdk4/services.rb, line 17368 def restore(opts = {}) internal_action(:restore, nil, opts) end
Locates the service corresponding to the given path.
@param path [String] The path of the service.
@return [Service] A reference to the service.
# File lib/ovirtsdk4/services.rb, line 17406 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