Ravada::Front - Web Frontend library for Ravada
Internal constructor
Returns a list of the base domains as a listref
my $bases = $rvd_front->list_bases();
Returns a list of machines available to the user
If the user has ever clone the base, it shows this information. It show the base data if not.
Arguments: user
Returns: listref of machines
sub search_clone_data { my $self = shift; my %args = @_; my $query = "SELECT * FROM domains WHERE " .(join(" AND ", map { "$_ = ? " } sort keys %args));
my $sth = $CONNECTOR->dbh->prepare($query); $sth->execute( map { $args{$_} } sort keys %args ); my $row = $sth->fetchrow_hashref; return ( $row or {});
}
Returns a list of the domains as a listref
my $bases = $rvd_front->list_domains();
Returns information of a domain
my $info = $rvd_front->domain_info( id => $id); my $info = $rvd_front->domain_info( name => $name);
Returns true if the domain name exists
if ($rvd->domain_exists('domain_name')) { ... }
Returns a reference to a list of Virtual Machine Managers known by the system
Returns a reference to a list of the ISO images known by the system
Returns a reference to a list of the LXC templates known by the system
Returns a reference to a list of the users
Request the creation of a new domain or virtual machine
# TODO: document the args here my $req = $rvd_front->create_domain( ... );
Waits for a request for some seconds.
Returns: the request
Checks if the backend is alive.
Return true if alive, false otherwise.
Connects to a Virtual Machine Manager ( or VMM ( or VM )). Returns a read-only connection to the VM.
my $vm = $front->open_vm('KVM');
Calls to open_vm
Search for a clone of a domain owned by an user.
my $domain_clone = $rvd_front->(id_base => $domain_base->id , id_owner => $user->id);
Returns the domain
Searches a domain by name
my $domain = $rvd_front->search_domain($name);
Returns a Ravada::Domain object
Returns a list of ruquests : ( id , domain_name, status, error )
my $domain = $ravada->search_domain_by_id($id);
Request to start a domain.
Returns an object: Ravada::Request.
my $req = $rvd_front->start_domain( user => $user ,name => 'mydomain' , remote_ip => '192.168.1.1');
List the available bases for anonymous user in a remote IP
my $list = $rvd_front->list_bases_anonymous($remote_ip);
Disconnects all the conneted VMs
Returns the version of the main module