File Coverage

blib/lib/WWW/VastAI/Endpoint.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 6 6 100.0
total 25 25 100.0


line stmt bran cond sub pod time code
1             package WWW::VastAI::Endpoint;
2             our $VERSION = '0.001';
3             # ABSTRACT: Serverless endpoint wrapper with worker and log helpers
4              
5 11     11   524 use Moo;
  11         58  
  11         87  
6             extends 'WWW::VastAI::Object';
7              
8 3     3 1 7082 sub endpoint_name { shift->data->{endpoint_name} }
9 1     1 1 7 sub endpoint_state { shift->data->{endpoint_state} }
10 1     1 1 6 sub api_key { shift->data->{api_key} }
11              
12             sub workers {
13 1     1 1 3 my ($self) = @_;
14 1         48 return $self->_client->endpoints->workers($self->id);
15             }
16              
17             sub logs {
18 1     1 1 4 my ($self, %params) = @_;
19 1         43 return $self->_client->endpoints->logs($self->endpoint_name, %params);
20             }
21              
22             sub delete {
23 1     1 1 3 my ($self) = @_;
24 1         46 return $self->_client->endpoints->delete($self->id);
25             }
26              
27             1;
28              
29             __END__