class OvirtSDK4::VmBackupsService

Constants

ADD
LIST

Public Instance Methods

add(backup, opts = {}) click to toggle source

Adds a new backup entity to a virtual machine.

For example, to start a new incremental backup of a virtual machine since checkpoint id `previous-checkpoint-uuid`, send a request like this:

source

POST /ovirt-engine/api/vms/123/backups


With a request body like this:

source,xml

<backup>

<from_checkpoint_id>previous-checkpoint-uuid</from_checkpoint_id>
<disks>
    <disk id="disk-uuid" />
    ...
</disks>

</backup>


The response body:

source,xml

<backup id=“backup-uuid”>

<from_checkpoint_id>previous-checkpoint-uuid</from_checkpoint_id>
<to_checkpoint_id>new-checkpoint-uuid</to_checkpoint_id>
<disks>
    <disk id="disk-uuid" />
    ...
    ...
</disks>
<status>initializing</status>
<creation_date>

</backup>


To provide the ID of the created backup, send a request like this:

source

POST /ovirt-engine/api/vms/123/backups


With a request body like this:

source,xml

<backup id=“backup-uuid”>

<from_checkpoint_id>previous-checkpoint-uuid</from_checkpoint_id>
<disks>
    <disk id="disk-uuid" />
    ...
</disks>

</backup>


@param backup [Backup] The information about the virtual machine backup entity.

@param opts [Hash] Additional options.

@option opts [Boolean] :require_consistency Indicates if the backup will fail if VM failed to freeze or not.

If requireConsistency=True VM backup will fail in case of a
failure to freeze the VM.

The REST API call should look like this:

....
POST /ovirt-engine/api/vms/123/backups?require_consistency=true
....

The default value of the requireConsistency flag is `false`.

@option opts [Boolean] :use_active Indicate whether to use the active volume for performing the backup.

If useActive=False a snapshot will be created for the backup operation.

The REST API call should look like this:

....
POST /ovirt-engine/api/vms/123/backups?use_active=false
....

The default value of the useActive flag is `false`.

@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 [Backup]

# File lib/ovirtsdk4/services.rb, line 32261
def add(backup, opts = {})
  internal_add(backup, Backup, ADD, opts)
end
backup_service(id) click to toggle source

Returns a reference to the service that manages a specific VM backup.

@param id [String] The identifier of the `backup`.

@return [VmBackupService] A reference to the `backup` service.

# File lib/ovirtsdk4/services.rb, line 32304
def backup_service(id)
  VmBackupService.new(self, id)
end
list(opts = {}) click to toggle source

The list of virtual machine backups.

@param opts [Hash] Additional options.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Integer] :max Sets the maximum number of virtual machine backups to return. If not specified, all the virtual machine backups 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<Backup>]

# File lib/ovirtsdk4/services.rb, line 32293
def list(opts = {})
  internal_get(LIST, 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 32315
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return backup_service(path)
  end
  return backup_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end