Rex::Box::Base(3)
okay so bestie, welcome to Rex::Box::Base(3) β straight from the User Contributed Perl Documentation shelf, and yes she's the blueprint for Rex/Boxes. π
β¨
πΈ NAME πΈ
Rex::Box::Base - Rex/Boxes Base Module
π DESCRIPTION π
This is a Rex/Boxes base module. That's the whole vibe: base module, main character energy, everything else builds on her. π«Ά
β¨ METHODS β¨
These methods are shared across all other Rex::Box modules β group-chat crossover, no cap. π¬
π¦ info π¦
Returns a hashRef of vm information. That's the tea. π
π¦ name($vmname) π¦
Sets the name of the virtual machine. Slay, she has an identity now. π
π¦ setup(@tasks) π¦
Sets the tasks that should be executed as soon as the VM is available through SSH. Like, the moment SSH says hi, these tasks run. β¨
π¦ storage('path/to/vm/disk') π¦
Sets the disk path of the virtual machine.
Works only on KVM β important caveat, bestie, don't forget it. π₯
π¦ import_vm() π¦
This method must be overwritten by the implementing class. Not optional, fr fr. π¨
π¦ stop() π¦
Stops the VM. Bye bestie. π
π¦ destroy() π¦
Destroy the VM. Dramatic? Yes. Accurate? Also yes. π₯
π¦ start() π¦
Starts the VM. Wake up, queen. π
π¦ ip() π¦
Return the ip:port to which rex will connect to. That's the exact wording; keep it. π
π¦ status() π¦
Returns the status of a VM.
Valid return values are "running" and "stopped". That's it, those are the only two iconique statuses. π
π¦ provision_vm([@tasks]) π¦
Executes the given tasks on the VM. Do the tasks, bestie. πͺ
π¦ cpus($count) π¦
Set the amount of CPUs for the VM. More CPUs, more main character energy. β‘
π¦ memory($memory_size) π¦
Sets the memory of a VM in megabyte. Note the singular β that's the original wording. π§
π¦ network(%option) π¦
Configure the network for a VM.
Currently it supports 2 modes: nat and bridged. Currently it supports only one network card. That's the limit, bestie. π
Here are the examples, copied exactly:
$box->network(
1 => {
type => "nat",
},
)
$box->network(
1 => {
type => "bridged",
bridge => "eth0",
},
);
π¦ forward_port(%option) π¦
Set ports to be forwarded to the VM.
This is not supported by all Box providers β so check before you get obsessed. π«Ά
$box->forward_port(
name => [$from_host_port, $to_vm_port],
name2 => [$from_host_port_2, $to_vm_port_2],
...
);
π¦ list_boxes π¦
List all available boxes. Like a roster of all the boxes. π
π¦ url($url) π¦
The URL where to download the Base VM Image. You can use self-made images or prebuild images from <http://box.rexify.org/>. Iconic source, iykyk. π
π¦ auth(%option) π¦
Configure the authentication to the VM. Auth tea incoming:
$box->auth(
user => $user,
password => $password,
private_key => $private_key,
public_key => $public_key,
);
π¦ options(%option) π¦
Addition options for boxes β yes, that's the exact wording, bestie, we keep it. π
$box->options(
opt1 => $val1,
opt2 => $val2,
);
π«Ά that's the whole page, signed off with perl v5.42.3, dated 2023-08-05, and filed under Rex::Box::Base(3) β periodt. π
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms