Creates a virtual machine snapshot.
For example, to create a new snapshot for virtual machine `123` send a request like this:
POST /ovirt-engine/api/vms/123/snapshots
With a request body like this:
<snapshot>
<description>My snapshot</description>
</snapshot>
@param snapshot [Snapshot] The `snapshot` to add.
@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 18384 def add(snapshot, opts = {}) internal_add(snapshot, Snapshot, ADD, opts) end
Returns the representation of 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 virtual machine with id `123` snapshots send a request like this: .... GET /ovirt-engine/api/vms/123/snapshots?all_content=true ....
@option opts [Integer] :max Sets the maximum number of snapshots to return. If not specified all the snapshots are returned.
@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 [Array<Snapshot>]
# File lib/ovirtsdk4/services.rb, line 18424 def list(opts = {}) internal_get(LIST, 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 18446 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return snapshot_service(path) end return snapshot_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end
Locates the `snapshot` service.
@param id [String] The identifier of the `snapshot`.
@return [SnapshotService] A reference to the `snapshot` service.
# File lib/ovirtsdk4/services.rb, line 18435 def snapshot_service(id) SnapshotService.new(self, id) end
Returns an string representation of this service.
@return [String]
# File lib/ovirtsdk4/services.rb, line 18462 def to_s "#<#{SnapshotsService}:#{absolute_path}>" end