Ravada::Request(3)

๐Ÿ“ฆ
version 2.4.1 ยท 2 versions
, in fedora 43

๐Ÿ’– NAME ๐Ÿ’–

Ravada::Request โ€” the requests library for Ravada, bestie. This is the whole Ravada::Request(3) situation, straight out of the User Contributed Perl Documentation corner of the perl world. โœจ

You use this to request a command to the ravada backend. That's the whole vibe: you make a request object, the backend does the thing. ๐Ÿซถ


๐ŸŒธ BUILD ๐ŸŒธ

Internal object builder, do not call. Like, i'm serious. It's giving "staff only" door. ๐Ÿ™ˆ

๐Ÿฆ‹ open ๐Ÿฆ‹

Opens the information of a previous request by id. ๐ŸŽ€

my $req = Ravada::Request->open($id);

โœจ info โœจ

Returns information of the request. That's it, that's the whole job. ๐Ÿ’…

๐Ÿ’œ create_domain ๐Ÿ’œ

my $req = Ravada::Request->create_domain(
                    name => 'bla'
                , id_iso => 1
);

๐ŸŒˆ remove_domain ๐ŸŒˆ

my $req = Ravada::Request->remove_domain(
                 name => 'bla'
                , uid => $user->id
);

๐Ÿ”ฅ start_domain ๐Ÿ”ฅ

Requests to start a domain. Let's go, main character energy. ๐Ÿ‘‘

my $req = Ravada::Request->start_domain(
   name => 'name'
  , uid => $user->id
);

Mandatory arguments โ€” one of those must be passed:

  • name or id_domain
  • uid: user id
  • remote_ip: [optional] IP of the remote client that requested to start the domain

๐ŸŽ€ start_clones ๐ŸŽ€

Requests to start the clones of a base. One base, many clones, iconic behaviour fr fr. โœจ

my $req = Ravada::Request->start_clones( name => 'name', uid => $user->id );

๐Ÿฆ‹ pause_domain ๐Ÿฆ‹

Requests to pause a domain. Time for a little nap bestie ๐Ÿ˜ด

my $req = Ravada::Request->pause_domain( name => 'name', uid => $user->id );

๐Ÿ’– resume_domain ๐Ÿ’–

Requests to pause a domain. yes, the doc literally says "pause" here โ€” i'm just the messenger, i don't make the rules ๐Ÿ™ˆ

my $req = Ravada::Request->resume_domain( name => 'name', uid => $user->id );

๐Ÿ’€ force_shutdown_domain ๐Ÿ’€

Requests to stop a domain now ! No waiting, no soft exit, no "give me a sec". Straight to the point. โšก

my $req = Ravada::Request->force_shutdown_domain( name => 'name' , uid => $user->id );

๐ŸŒธ shutdown_domain ๐ŸŒธ

Requests to stop a domain. The gentle version. ๐Ÿซถ

my $req = Ravada::Request->shutdown_domain( name => 'name' , uid => $user->id );
my $req = Ravada::Request->shutdown_domain( name => 'name' , uid => $user->id
                                          ,timeout => $timeout );

๐Ÿ’€ force_reboot_domain ๐Ÿ’€

Requests to stop a domain now ! (same one-liner as force_shutdown_domain, copy-paste era, we've all been there ๐Ÿ˜ญ)

my $req = Ravada::Request->force_reboot_domain( name => 'name' , uid => $user->id );

๐ŸŒˆ reboot_domain ๐ŸŒˆ

Requests to reboot a domain. Round two, but make it scheduled. ๐Ÿ”

my $req = Ravada::Request->reboot_domain( name => 'name' , uid => $user->id );
my $req = Ravada::Request->reboot_domain( name => 'name' , uid => $user->id
                                          ,timeout => $timeout );

โญ new_request โญ

Creates a new request. Fresh out of the box, no cap. ๐Ÿ“ฆ

$req = Ravada::Request->new_request(
    start_domain
    ,uid => $user->id
    ,id_domain => $domain->id
);

๐Ÿ”’ lock_domain ๐Ÿ”’

Checks if that request belongs to a virtual machine and sets it as locked. Nobody touch it, it's busy. ๐Ÿ’…

๐Ÿ”“ unlock_domain ๐Ÿ”“

Checks if that request belongs to a virtual machine and unlocks it. Free at last. ๐Ÿฆ‹

๐Ÿ’œ status ๐Ÿ’œ

Returns or sets the status of a request.

$req->status('done');

my $status = $req->status();

โฐ at โฐ

Sets the time when the request will be scheduled. Future plans, we love to see it. โœจ

๐ŸŽ result ๐ŸŽ

Returns the result of the request if any.

my $result = $req->result;

๐ŸŒŸ command ๐ŸŒŸ

Returns the requested command.

๐ŸŒŸ args ๐ŸŒŸ

Returns the requested command. (yes bestie, the doc says "command" here too, and yes, there's another args further down โ€” keep scrolling ๐Ÿ™ˆ)

my $command = $req->command;

๐Ÿ“ args ๐Ÿ“

Returns the arguments of a request or the value of one argument field. Two ways to ask, both valid. ๐ŸŽ€

my $args = $request->args();
print $args->{name};

print $request->args('name');

๐Ÿ’… arg ๐Ÿ’…

Sets or gets the value of an argument of a Request.

๐Ÿงš defined_arg ๐Ÿงš

Returns if an argument is defined. Existence check, we love a boundary. โœจ

๐Ÿ“ธ copy_screenshot ๐Ÿ“ธ

Request to copy a screenshot from a domain to another. Say cheese. ๐Ÿง€

๐Ÿ‘‘ set_base_vm ๐Ÿ‘‘

Enables a base in a Virtual Manager.

๐Ÿ’€ remove_base_vm ๐Ÿ’€

Disables a base in a Virtual Manager.

๐Ÿฆ‹ type ๐Ÿฆ‹

Returns the type of the request.

๐Ÿ”ข count_requests ๐Ÿ”ข

Returns the number of working requests of the same type. Counting bestie, we're counting. ๐Ÿงฎ

my $n = $request->working_requests();

๐Ÿšง requests_limit ๐Ÿšง

Returns the limit of requests of a type.

๐Ÿš€ domain_autostart ๐Ÿš€

Sets the autostart flag on a domain. Up and running before you even get there. โœจ

โš ๏ธ autostart_domain โš ๏ธ

Deprecated for domain_autostart. Old name, new name, use the new one. ๐Ÿ™ˆ

๐Ÿ›‘ enforce_limits ๐Ÿ›‘

Enforces virtual machine limits, ie: an user can only run one virtual machine at a time, so the older ones are shut down. The limit is the limit, periodt. ๐Ÿ’…

my $req = Ravada::Request->enforce_limits(
    timeout => $timeout
);

Arguments:

  • timeout: seconds that are given to a virtual machine to shutdown itself. After this time, it gets powered off. Defaults to 120 seconds.

It is advisable configure virtual machines so they shut down easily if asked to. Just a few hints:

  • install ACPI services
  • Set default action for power off to shutdown, do not ask the user

๐Ÿ”„ refresh_machine ๐Ÿ”„

Refresh a machine information. Glow-up, but for data. โœจ

๐Ÿ•ฐ๏ธ done_recently ๐Ÿ•ฐ๏ธ

Returns whether this command has been requested successfully recently. ๐ŸŽ€

if ($request->done_recently($seconds)) {
  ... skips work ...
} else {
  ... does work ...
}

This method is used for commands that take long to run as garbage collection.

๐Ÿ›‘ stop ๐Ÿ›‘

Stops a request killing the process. Killing the process! Dramatic but correct. ๐Ÿ’€

$request->stop();

โญ priority โญ

Returns the priority of the request.

โœ… requirements_done โœ…

Returns whether a request requirements have been fulfilled.

ie when a request must execute after another request completes.

๐Ÿ” redo ๐Ÿ”

Set the request to be executed again. Round two, bestie. ๐Ÿฆ‹

๐Ÿงน remove ๐Ÿงน

Remove all requests that comply with the conditions. Clean sweep, very satisfying. โœจ

๐Ÿ’ซ refresh ๐Ÿ’ซ

Refresh request status and data. Vibe check, but for a request. ๐Ÿซถ


๐Ÿ’€ POD ERRORS ๐Ÿ’€

Hey! The above document had some coding errors, which are explained below:

Around line 1679:

You forgot a '=back' before '=head2'
not me calling out the doc's own typos ๐Ÿ˜ญ it's fine, we still love it

and that's the whole page bestie!! ๐ŸŒˆ this one shipped as perl v5.42.0, dated 2025-09-20 โ€” write that in your notes, it's part of the lore. ๐Ÿ’–โœจ๐Ÿฆ‹๐ŸŽ€๐ŸŒธ๐Ÿ’…๐Ÿซถ๐Ÿ‘‘๐ŸŒˆโญ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from