NAME

WWW::VastAI::Instance - Instance wrapper with convenience lifecycle helpers

VERSION

version 0.001

DESCRIPTION

WWW::VastAI::Instance wraps an instance payload and exposes convenience helpers for lifecycle operations, log access, and per-instance SSH-key management through WWW::VastAI::API::Instances.

METHODS

label

Returns the instance label.

actual_status

Returns the current status reported by Vast.ai.

intended_status

Returns the requested target status when present.

ssh_host

Returns the SSH host for the instance.

ssh_port

Returns the SSH port for the instance.

public_ipaddr

Returns the public IP address when assigned.

gpu_name

Returns the GPU model name.

num_gpus

Returns the GPU count.

is_running

True when actual_status is running.

is_stopped

True when actual_status is stopped.

refresh

$instance->refresh;

Reloads the instance payload from the API and updates the object in place.

update

$instance->update(%params);

Sends an instance update request and replaces the local payload with the returned data.

start

Requests that the instance be started and returns the current object.

stop

Requests that the instance be stopped and returns the current object.

set_label

$instance->set_label('worker-a');

Updates the instance label and mirrors the new label into the local payload.

logs

my $logs = $instance->logs(%params);

Fetches instance logs through WWW::VastAI::API::Instances.

ssh_keys

Returns the attached SSH keys for the instance.

attach_ssh_key

Attaches a public SSH key to the instance.

detach_ssh_key

Detaches a previously attached SSH key from the instance.

delete

Deletes the instance and returns the raw API response.

SEE ALSO

WWW::VastAI, WWW::VastAI::API::Instances

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-vastai/issues.

IRC

Join #kubernetes on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.