Commit b33a26f5 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Documented main module

parent e29c17ac
......@@ -10,6 +10,18 @@ use YAML;
use Ravada::VM::KVM;
=head1 NAME
Ravada - Remove Virtual Desktop Manager
=head1 SYNOPSIS
use Ravada;
my $ravada = Ravada->new()
=cut
our $FILE_CONFIG = "/etc/ravada.conf";
......@@ -32,6 +44,13 @@ has 'connector' => (
is => 'ro'
);
=head2 BUILD
Internal constructor
=cut
sub BUILD {
my $self = shift;
$CONNECTOR = $self->connector if $self->connector;
......@@ -58,12 +77,39 @@ sub _create_vm {
return [ Ravada::VM::KVM->new( connector => $self->connector ) ];
}
=head2 create_domain
Creates a new domain based on an ISO image or another domain.
my $domain = $ravada->create_domain(
name => $name
, id_iso => 1
);
my $domain = $ravada->create_domain(
name => $name
, id_base => 3
);
=cut
sub create_domain {
my $self = shift;
return $self->vm->[0]->create_domain(@_);
}
=head2 remove_domain
Removes a domain
$ravada->remove_domain($name);
=cut
sub remove_domain {
my $self = shift;
my $name = shift or confess "Missing domain name";
......@@ -73,6 +119,12 @@ sub remove_domain {
$domain->remove();
}
=head2 search_domain
my $domain = $ravada->search_domain($name);
=cut
sub search_domain {
my $self = shift;
my $name = shift;
......@@ -83,6 +135,12 @@ sub search_domain {
}
}
=head2 remove_volume
$ravada->remove_volume($file);
=cut
sub remove_volume {
my $self = shift;
......@@ -104,6 +162,14 @@ sub remove_volume {
}
=head2 process_requests
This is run in the ravada backend. It processes the commands requested by the fronted
$ravada->process_requests();
=cut
sub process_requests {
my $self = shift;
......@@ -134,4 +200,15 @@ sub _execute {
die "Unknown command ".$request->command;
}
}
=head1 AUTHOR
Francesc Guasch-Ortiz , frankie@telecos.upc.edu
=head1 SEE ALSO
Sys::Virt
=cut
1;
use warnings;
use strict;
use Test::Pod::Coverage tests=>1;
pod_coverage_ok( "Ravada", "Ravada is covered" );
Markdown is supported
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