1Ravada::Front(3)      User Contributed Perl Documentation     Ravada::Front(3)
2
3
4

NAME

6       Ravada::Front - Web Frontend library for Ravada
7
8   BUILD
9       Internal constructor
10
11   list_bases
12       Returns a list of the base domains as a listref
13
14           my $bases = $rvd_front->list_bases();
15
16   list_machines_user
17       Returns a list of machines available to the user
18
19       If the user has ever clone the base, it shows this information. It show
20       the base data if not.
21
22       Arguments: user
23
24       Returns: listref of machines
25
26       sub search_clone_data {
27           my $self = shift;
28           my %args = @_;
29           my $query = "SELECT * FROM domains WHERE "
30               .(join(" AND ", map { "$_ = ? " } sort keys %args));
31
32           my $sth = $CONNECTOR->dbh->prepare($query);
33           $sth->execute( map { $args{$_} } sort keys %args );
34           my $row = $sth->fetchrow_hashref;
35           return ( $row or {});
36
37       }
38
39   list_domains
40       Returns a list of the domains as a listref
41
42           my $bases = $rvd_front->list_domains();
43
44   filter_base_without_clones
45       filters the list of domains and drops all machines that are unacessible
46       and bases with 0 machines accessible
47
48   list_clones Returns a list of the domains that are clones as a listref
49             my $clones = $rvd_front->list_clones();
50
51   domain_info
52       Returns information of a domain
53
54           my $info = $rvd_front->domain_info( id => $id);
55           my $info = $rvd_front->domain_info( name => $name);
56
57   domain_exists
58       Returns true if the domain name exists
59
60           if ($rvd->domain_exists('domain_name')) {
61               ...
62           }
63
64   node_exists
65       Returns true if the node name exists
66
67           if ($rvd->node('node_name')) {
68               ...
69           }
70
71   list_vm_types
72       Returns a reference to a list of Virtual Machine Managers known by the
73       system
74
75   list_vms
76       Returns a list of Virtual Managers
77
78   list_iso_images
79       Returns a reference to a list of the ISO images known by the system
80
81   iso_file
82       Returns a reference to a list of the ISOs known by the system
83
84   list_lxc_templates
85       Returns a reference to a list of the LXC templates known by the system
86
87   list_users
88       Returns a reference to a list of the users
89
90   create_domain
91       Request the creation of a new domain or virtual machine
92
93           # TODO: document the args here
94           my $req = $rvd_front->create_domain( ... );
95
96   wait_request
97       Waits for a request for some seconds.
98
99       Arguments
100
101       •   request
102
103       •   timeout (optional defaults to $Ravada::Front::TIMEOUT
104
105       Returns: the request
106
107   ping_backend
108       Checks if the backend is alive.
109
110       Return true if alive, false otherwise.
111
112   open_vm
113       Connects to a Virtual Machine Manager ( or VMM ( or VM )).  Returns a
114       read-only connection to the VM.
115
116         my $vm = $front->open_vm('KVM');
117
118   search_vm
119       Calls to open_vm
120
121   search_clone
122       Search for a clone of a domain owned by an user.
123
124           my $domain_clone = $rvd_front->(id_base => $domain_base->id , id_owner => $user->id);
125
126       arguments
127
128       id_base : The id of the base domain
129       id_user
130
131       Returns the domain
132
133   search_domain
134       Searches a domain by name
135
136           my $domain = $rvd_front->search_domain($name);
137
138       Returns a Ravada::Domain object
139
140   list_requests
141       Returns a list of ruquests : ( id , domain_name, status, error )
142
143   search_domain_by_id
144         my $domain = $ravada->search_domain_by_id($id);
145
146   start_domain
147       Request to start a domain.
148
149       arguments
150
151       user => $user : a Ravada::Auth::SQL user
152       name => $name : the domain name
153       remote_ip => $remote_ip: a Ravada::Auth::SQL user
154
155       Returns an object: Ravada::Request.
156
157           my $req = $rvd_front->start_domain(
158                      user => $user
159                     ,name => 'mydomain'
160               , remote_ip => '192.168.1.1');
161
162   list_bases_anonymous
163       List the available bases for anonymous user in a remote IP
164
165           my $list = $rvd_front->list_bases_anonymous($remote_ip);
166
167   disconnect_vm
168       Disconnects all the conneted VMs
169
170   enable_node
171       Enables, disables or delete a node
172
173           $rvd->enable_node($id_node, $value);
174
175       Returns true if the node is enabled, false otherwise.
176
177   remove_node
178       Remove new node from the table VMs
179
180   add_node
181       Inserts a new node in the table VMs
182
183   list_network_interfaces
184       Request to list the network interfaces. Returns a reference to the
185       list.
186
187           my $interfaces = $rvd_front->list_network_interfaces(
188               vm_type => 'KVM'
189               ,type => 'bridge'
190               ,user => $user
191           )
192
193   settings_global
194       Returns the list of global settings as a hash
195
196   update_settings_global
197       Updates the global settings
198
199   is_in_maintenance
200       Returns wether the service is in maintenance mode
201
202   version
203       Returns the version of the main module
204
205
206
207perl v5.32.1                      2021-05-24                  Ravada::Front(3)
Impressum