class OvirtSDK4::SnapshotService

Constants

GET
REMOVE

Public Instance Methods

cdroms_service() click to toggle source

Locates the `cdroms` service.

@return [SnapshotCdromsService] A reference to `cdroms` service.

# File lib/ovirtsdk4/services.rb, line 19662
def cdroms_service
  @cdroms_service ||= SnapshotCdromsService.new(self, 'cdroms')
end
disks_service() click to toggle source

Locates the `disks` service.

@return [SnapshotDisksService] A reference to `disks` service.

# File lib/ovirtsdk4/services.rb, line 19671
def disks_service
  @disks_service ||= SnapshotDisksService.new(self, 'disks')
end
get(opts = {}) click to toggle source

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 19578
def get(opts = {})
  internal_get(GET, opts)
end
nics_service() click to toggle source

Locates the `nics` service.

@return [SnapshotNicsService] A reference to `nics` service.

# File lib/ovirtsdk4/services.rb, line 19680
def nics_service
  @nics_service ||= SnapshotNicsService.new(self, 'nics')
end
remove(opts = {}) click to toggle source

Deletes the object managed by this service.

@param opts [Hash] Additional options.

@option opts [Boolean] :all_content Indicates if all the attributes of the virtual machine snapshot should be included in the response.

By default the attribute `initialization.configuration.data` is excluded.

For example, to retrieve the complete representation of the snapshot with id `456` of the virtual machine
with id `123` send a request like this:

....
GET /ovirt-engine/api/vms/123/snapshots/456?all_content=true
....

@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 19614
def remove(opts = {})
  internal_remove(REMOVE, opts)
end
restore(opts = {}) click to toggle source

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 19653
def restore(opts = {})
  internal_action(:restore, nil, opts)
end
service(path) click to toggle source

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 19691
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
to_s() click to toggle source

Returns an string representation of this service.

@return [String]

# File lib/ovirtsdk4/services.rb, line 19721
def to_s
  "#<#{SnapshotService}:#{absolute_path}>"
end