| 1 | package Net::Kubernetes::Resource::Role::State; | ||||||||||
| 2 | # ABSTRACT: Resource role for types that have a status | ||||||||||
| 3 | 4 | $Net::Kubernetes::Resource::Role::State::VERSION = '1.03'; | |||||||||
| 4 | 4 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | has status => ( | |||||||||
| 7 | is => 'rw', | ||||||||||
| 8 | isa => 'HashRef', | ||||||||||
| 9 | required => 1 | ||||||||||
| 10 | ); | ||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 4 | ▶ | sub refresh { | ||||||||
|
Subroutine
refresh: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 14 | 4 | my($self) = @_; | |||||||||
| 15 | 4 | my($res) = $self->ua->request($self->create_request(GET => $self->path)); | |||||||||
| 16 | 4 | ▶ | if ($res->is_success) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 4 | my($data) = $self->json->decode($res->content); | |||||||||
| 18 | 4 | $self->status($data->{status}); | |||||||||
| 19 | 4 | return 1; | |||||||||
| 20 | } | ||||||||||
| 21 | 0 | return 0; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 4 | return 42; | |||||||||
| 25 | |||||||||||
| 26 | __END__ | ||||||||||