Class: OvirtSDK4::VmBackupsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(backup, opts = {}) ⇒ Backup
Adds a new backup entity to a virtual machine.
-
#backup_service(id) ⇒ VmBackupService
Returns a reference to the service that manages a specific VM backup.
-
#list(opts = {}) ⇒ Array<Backup>
The list of virtual machine backups.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
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>
30133 30134 30135 |
# File 'lib/ovirtsdk4/services.rb', line 30133 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.
30176 30177 30178 |
# File 'lib/ovirtsdk4/services.rb', line 30176 def backup_service(id) VmBackupService.new(self, id) end |
#list(opts = {}) ⇒ Array<Backup>
The list of virtual machine backups.
30165 30166 30167 |
# File 'lib/ovirtsdk4/services.rb', line 30165 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
30187 30188 30189 30190 30191 30192 30193 30194 30195 30196 |
# File 'lib/ovirtsdk4/services.rb', line 30187 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 |