Class: OvirtSDK4::VmBackupsService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#add(backup, opts = {}) ⇒ Backup

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:

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

With a request body like this:

POST /ovirt-engine/api/vms/123/backups
<backup>
  <from_checkpoint_id>previous-checkpoint-uuid</from_checkpoint_id>
  <disks>
      <disk id="disk-uuid" />
      ...
  </disks>
</backup>

The response body:

<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>

Parameters:

  • backup (Backup)

    The information about the virtual machine backup entity.

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:


31170
31171
31172
# File 'lib/ovirtsdk4/services.rb', line 31170

def add(backup, opts = {})
  internal_add(backup, Backup, ADD, opts)
end

#backup_service(id) ⇒ VmBackupService

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

Parameters:

  • id (String)

    The identifier of the backup.

Returns:


31213
31214
31215
# File 'lib/ovirtsdk4/services.rb', line 31213

def backup_service(id)
  VmBackupService.new(self, id)
end

#list(opts = {}) ⇒ Array<Backup>

The list of virtual machine backups.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :max (Integer)

    Sets the maximum number of virtual machine backups to return. If not specified, all the virtual machine backups are returned.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:


31202
31203
31204
# File 'lib/ovirtsdk4/services.rb', line 31202

def list(opts = {})
  internal_get(LIST, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.


31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
# File 'lib/ovirtsdk4/services.rb', line 31224

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