Commit 6b073c1f authored by Francesc Guasch's avatar Francesc Guasch
Browse files

doc(backend): compact API

parent 7cdd32df
...@@ -4371,6 +4371,23 @@ sub base_in_vm($self,$id_vm) { ...@@ -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) { sub base_files_in_vm($self,$vm) {
$vm = Ravada::VM->open($vm) if !ref($vm); $vm = Ravada::VM->open($vm) if !ref($vm);
for my $file ($self->list_files_base) { for my $file ($self->list_files_base) {
...@@ -5374,6 +5391,12 @@ sub _domain_in_nodes($self) { ...@@ -5374,6 +5391,12 @@ sub _domain_in_nodes($self) {
return $self->list_instances > 1; return $self->list_instances > 1;
} }
=head2 compact
Compacts virtual machine volumes
=cut
sub compact($self, $request=undef) { sub compact($self, $request=undef) {
#first check if active, that will trigger status refresh #first check if active, that will trigger status refresh
die "Error: ".$self->name." can't be compacted because it is active\n" die "Error: ".$self->name." can't be compacted because it is active\n"
...@@ -5407,6 +5430,12 @@ sub compact($self, $request=undef) { ...@@ -5407,6 +5430,12 @@ sub compact($self, $request=undef) {
$self->_data('has_backups' => $self->_data('has_backups') +1 ) if $keep_backup; $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) { sub purge($self, $request=undef) {
my $vm = $self->_vm->new ( host => 'localhost' ); my $vm = $self->_vm->new ( host => 'localhost' );
for my $vol ( $self->list_volumes_info ) { for my $vol ( $self->list_volumes_info ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment