Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
6b073c1f
Commit
6b073c1f
authored
Mar 04, 2021
by
Francesc Guasch
Browse files
doc(backend): compact API
parent
7cdd32df
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/Ravada/Domain.pm
View file @
6b073c1f
...
...
@@ -4371,6 +4371,23 @@ sub base_in_vm($self,$id_vm) {
}
=head2 base_files_in_vm
=head3 arguments
=over
=item vm : The virtual manager to check
=back
Returns true if all te base files exist in the virtual manager o node
$domain->base_files_in_vm($node);
=cut
sub
base_files_in_vm
($self,$vm) {
$vm
=
Ravada::
VM
->
open
(
$vm
)
if
!
ref
(
$vm
);
for
my
$file
(
$self
->
list_files_base
)
{
...
...
@@ -5374,6 +5391,12 @@ sub _domain_in_nodes($self) {
return
$self
->
list_instances
>
1
;
}
=head2 compact
Compacts virtual machine volumes
=cut
sub
compact
($self, $request=undef) {
#first check if active, that will trigger status refresh
die
"
Error:
"
.
$self
->
name
.
"
can't be compacted because it is active
\n
"
...
...
@@ -5407,6 +5430,12 @@ sub compact($self, $request=undef) {
$self
->
_data
('
has_backups
'
=>
$self
->
_data
('
has_backups
')
+
1
)
if
$keep_backup
;
}
=head2 purge
Removes backups from virtual machine volumes
=cut
sub
purge
($self, $request=undef) {
my
$vm
=
$self
->
_vm
->
new
(
host
=>
'
localhost
'
);
for
my
$vol
(
$self
->
list_volumes_info
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment