1Ravada::Front(3) User Contributed Perl Documentation Ravada::Front(3)
2
3
4
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 list_bases_network
91 Returns a reference to a list to all the bases in a network
92
93 my $list = $rvd_front->list_bases_network($id_network);
94
95 create_domain
96 Request the creation of a new domain or virtual machine
97
98 # TODO: document the args here
99 my $req = $rvd_front->create_domain( ... );
100
101 wait_request
102 Waits for a request for some seconds.
103
104 Arguments
105
106 • request
107
108 • timeout (optional defaults to $Ravada::Front::TIMEOUT
109
110 Returns: the request
111
112 ping_backend
113 Checks if the backend is alive.
114
115 Return true if alive, false otherwise.
116
117 open_vm
118 Connects to a Virtual Machine Manager ( or VMM ( or VM )). Returns a
119 read-only connection to the VM.
120
121 my $vm = $front->open_vm('KVM');
122
123 search_vm
124 Calls to open_vm
125
126 search_clone
127 Search for a clone of a domain owned by an user.
128
129 my $domain_clone = $rvd_front->(id_base => $domain_base->id , id_owner => $user->id);
130
131 arguments
132
133 id_base : The id of the base domain
134 id_user
135
136 Returns the domain
137
138 search_domain
139 Searches a domain by name
140
141 my $domain = $rvd_front->search_domain($name);
142
143 Returns a Ravada::Domain object
144
145 list_requests
146 Returns a list of requests : ( id , domain_name, status, error )
147
148 search_domain_by_id
149 my $domain = $ravada->search_domain_by_id($id);
150
151 start_domain
152 Request to start a domain.
153
154 arguments
155
156 user => $user : a Ravada::Auth::SQL user
157 name => $name : the domain name
158 remote_ip => $remote_ip: a Ravada::Auth::SQL user
159
160 Returns an object: Ravada::Request.
161
162 my $req = $rvd_front->start_domain(
163 user => $user
164 ,name => 'mydomain'
165 , remote_ip => '192.168.1.1');
166
167 list_bases_anonymous
168 List the available bases for anonymous user in a remote IP
169
170 my $list = $rvd_front->list_bases_anonymous($remote_ip);
171
172 disconnect_vm
173 Disconnects all the conneted VMs
174
175 enable_node
176 Enables, disables or delete a node
177
178 $rvd->enable_node($id_node, $value);
179
180 Returns true if the node is enabled, false otherwise.
181
182 remove_node
183 Remove new node from the table VMs
184
185 add_node
186 Inserts a new node in the table VMs
187
188 list_network_interfaces
189 Request to list the network interfaces. Returns a reference to the
190 list.
191
192 my $interfaces = $rvd_front->list_network_interfaces(
193 vm_type => 'KVM'
194 ,type => 'bridge'
195 ,user => $user
196 )
197
198 settings_global
199 Returns the list of global settings as a hash
200
201 setting
202 Sets or gets a global setting parameter
203
204 $rvd_front->('debug')
205
206 Settings are defined and stored in the table settings in the database.
207
208 feature
209 Returns if a feature is available
210
211 if ($rvd_front->$feature('ldap')) {
212 ....
213
214 update_settings_global
215 Updates the global settings
216
217 is_in_maintenance
218 Returns wether the service is in maintenance mode
219
220 update_host_device
221 Update the host device information, then it requests a list of the
222 current available devices
223
224 $rvd_front->update_host_device( field => 'value' );
225
226 list_machine_types
227 Returns a reference to a list of the architectures and its machine
228 types
229
230 list_cpu_models
231 Returns a reference to a list of the CPU models
232
233 version
234 Returns the version of the main module
235
236
237
238perl v5.36.0 2023-03-19 Ravada::Front(3)