| 1 | package Net::Checkpoint::Management::v1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | $Net::Checkpoint::Management::v1::VERSION = '0.002000'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Checkpoint Management API version 1.x client library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use 5.024; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use feature 'signatures'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Types::Standard qw( ArrayRef Str ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Carp::Clan qw(^Net::Checkpoint::Management::v1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use Clone qw( clone ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use Net::Checkpoint::Management::v1::Role::ObjectMethods; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | ▶ | no warnings "experimental::signatures"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | has 'user' => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | has 'passwd' => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | has 'api_versions' => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | is => 'lazy', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | isa => ArrayRef[Str], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | ▶ | sub _build_api_versions ($self) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_api_versions: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | my $res_versions = $self->post('/web_api/v1.1/show-api-versions', {}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | return $res_versions->data->{'supported-versions'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | has 'api_version' => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | with 'Net::Checkpoint::Management::v1::Role::REST::Client'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | ▶ | sub _error_handler ($self, $data) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_error_handler: not called CC=14 SCAR=53.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | my $error_message; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | if (ref $data eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | if (exists $data->{'blocking-errors'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition0%0/9
exists $data->{"blocking-errors"} and ref $data->{"blocking-errors"} eq "ARRAY" and exists $data->{"blocking-errors"}[0] and exists $data->{"blocking-errors"}[0]{"message"}
exists $data->{"blocking-errors"} and ref $data->{"blocking-errors"} eq "ARRAY" and exists $data->{"blocking-errors"}[0]
exists $data->{"blocking-errors"} and ref $data->{"blocking-errors"} eq "ARRAY"
MC/DC0%0/4
exists $data->{"blocking-errors"} and ref $data->{"blocking-errors"} eq "ARRAY" and exists $data->{"blocking-errors"}[0] and exists $data->{"blocking-errors"}[0]{"message"}
exists $data->{"blocking-errors"}
ref $data->{"blocking-errors"} eq "ARRAY"
exists $data->{"blocking-errors"}[0]
exists $data->{"blocking-errors"}[0]{"message"}
Truth table0%0/5
A and B and C and D
A= exists $data->{"blocking-errors"}B= ref $data->{"blocking-errors"} eq "ARRAY"C= exists $data->{"blocking-errors"}[0]D= exists $data->{"blocking-errors"}[0]{"message"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | && ref $data->{'blocking-errors'} eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | && exists $data->{'blocking-errors'}->[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | && exists $data->{'blocking-errors'}->[0]->{message}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | $error_message = $data->{'blocking-errors'}->[0]->{message}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | ▶ | elsif (exists $data->{errors} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
exists $data->{"errors"} and ref $data->{"errors"} eq "ARRAY" and exists $data->{"errors"}[0] and exists $data->{"errors"}[0]{"message"}
exists $data->{"errors"} and ref $data->{"errors"} eq "ARRAY" and exists $data->{"errors"}[0]
exists $data->{"errors"} and ref $data->{"errors"} eq "ARRAY"
MC/DC0%0/4
exists $data->{"errors"} and ref $data->{"errors"} eq "ARRAY" and exists $data->{"errors"}[0] and exists $data->{"errors"}[0]{"message"}
exists $data->{"errors"}
ref $data->{"errors"} eq "ARRAY"
exists $data->{"errors"}[0]
exists $data->{"errors"}[0]{"message"}
Truth table0%0/5
A and B and C and D
A= exists $data->{"errors"}B= ref $data->{"errors"} eq "ARRAY"C= exists $data->{"errors"}[0]D= exists $data->{"errors"}[0]{"message"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | && ref $data->{errors} eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | && exists $data->{errors}->[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | && exists $data->{errors}->[0]->{message}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | $error_message = $data->{errors}->[0]->{message}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | # when ignore-warnings isn't passed to the API call, a response with only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | # warnings is also considered an error because its changes aren't saved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | # when passing ignore-warnings the error handler isn't called because the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # http response code is 200 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | ▶ | elsif (exists $data->{warnings} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
exists $data->{"warnings"} and ref $data->{"warnings"} eq "ARRAY" and exists $data->{"warnings"}[0] and exists $data->{"warnings"}[0]{"message"}
exists $data->{"warnings"} and ref $data->{"warnings"} eq "ARRAY" and exists $data->{"warnings"}[0]
exists $data->{"warnings"} and ref $data->{"warnings"} eq "ARRAY"
MC/DC0%0/4
exists $data->{"warnings"} and ref $data->{"warnings"} eq "ARRAY" and exists $data->{"warnings"}[0] and exists $data->{"warnings"}[0]{"message"}
exists $data->{"warnings"}
ref $data->{"warnings"} eq "ARRAY"
exists $data->{"warnings"}[0]
exists $data->{"warnings"}[0]{"message"}
Truth table0%0/5
A and B and C and D
A= exists $data->{"warnings"}B= ref $data->{"warnings"} eq "ARRAY"C= exists $data->{"warnings"}[0]D= exists $data->{"warnings"}[0]{"message"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | && ref $data->{warnings} eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | && exists $data->{warnings}->[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | && exists $data->{warnings}->[0]->{message}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | $error_message = $data->{warnings}->[0]->{message}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | $error_message = $data->{message}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # underlying exception like Could not connect to 'cpmanager.example.org' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | $error_message = $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | croak($error_message); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | sub _create ($self, $url, $object_data, $query_params = {}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_create: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | my $params = $self->user_agent->www_form_urlencode( $query_params ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | my $res = $self->post("$url?$params", $object_data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | return $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | sub _list ($self, $url, $list_key, $query_params = {}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_list: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | # the API only allows 500 objects at a time | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | # work around that by making multiple API calls | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | my $offset = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | my $limit = exists $query_params->{limit} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | ? $query_params->{limit} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | : 500; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | my $more_data_available = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | my $response; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | while ($more_data_available) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | my $res = $self->post($url, { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | offset => $offset, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | limit => $limit, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | %$query_params, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | # use first response for base structure of response | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | if ($offset == 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | $response = clone($data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | delete $response->{from}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | delete $response->{to}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | push $response->{$list_key}->@*, $data->{$list_key}->@* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if exists $data->{$list_key} && ref $data->{$list_key} eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $data->{$list_key} and ref $data->{$list_key} eq "ARRAY"
MC/DC0%0/2
exists $data->{$list_key} and ref $data->{$list_key} eq "ARRAY"
exists $data->{$list_key}
ref $data->{$list_key} eq "ARRAY"
Truth table0%0/3
A and B
A= exists $data->{$list_key}B= ref $data->{$list_key} eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | # check if more data is available | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | if ($offset + $limit < $data->{total}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | $more_data_available = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | $offset += $limit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | $more_data_available = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | # return response similar to Checkpoint API | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | return $response; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | sub _get ($self, $url, $query_params = {}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | my $res = $self->post($url, $query_params); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | return $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | ▶ | sub _update ($self, $url, $object_data) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_update: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | my $res = $self->post($url, $object_data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | return $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | ▶ | sub _delete ($self, $url, $object) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_delete: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | my $res = $self->post($url, $object); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 2 | Net::Checkpoint::Management::v1::Role::ObjectMethods->apply([ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | object => 'packages', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | singular => 'package', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | create => 'add-package', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | list => 'show-packages', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | get => 'show-package', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | update => 'set-package', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | delete => 'delete-package', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | list_key => 'packages', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | object => 'accessrules', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | singular => 'accessrule', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | create => 'add-access-rule', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | list => 'show-access-rulebase', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | get => 'show-access-rule', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | update => 'set-access-rule', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | delete => 'delete-access-rule', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | list_key => 'rulebase', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | id_keys => ['uid', 'name', 'rule-number'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | object => 'networks', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | singular => 'network', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | create => 'add-network', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | list => 'show-networks', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | get => 'show-network', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | update => 'set-network', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | delete => 'delete-network', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | object => 'hosts', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | singular => 'host', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | create => 'add-host', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | list => 'show-hosts', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | get => 'show-host', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | update => 'set-host', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | delete => 'delete-host', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | object => 'address_ranges', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | singular => 'address_range', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | create => 'add-address-range', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | list => 'show-address-ranges', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | get => 'show-address-range', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | update => 'set-address-range', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | delete => 'delete-address-range', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | object => 'dns_domains', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | singular => 'dns_domain', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | create => 'add-dns-domain', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | list => 'show-dns-domains', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | get => 'show-dns-domain', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | update => 'set-dns-domain', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | delete => 'delete-dns-domain', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | object => 'groups', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | singular => 'group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | create => 'add-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | list => 'show-groups', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | get => 'show-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | update => 'set-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | delete => 'delete-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | object => 'access_roles', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | singular => 'access_role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | create => 'add-access-role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | list => 'show-access-roles', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | get => 'show-access-role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | update => 'set-access-role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | delete => 'delete-access-role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | object => 'services_tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | singular => 'service_tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | create => 'add-service-tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | list => 'show-services-tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | get => 'show-service-tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | update => 'set-service-tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | delete => 'delete-service-tcp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | object => 'services_udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | singular => 'service_udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | create => 'add-service-udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | list => 'show-services-udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | get => 'show-service-udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | update => 'set-service-udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | delete => 'delete-service-udp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | object => 'services_icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | singular => 'service_icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | create => 'add-service-icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | list => 'show-services-icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | get => 'show-service-icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | update => 'set-service-icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | delete => 'delete-service-icmp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | object => 'services_icmpv6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | singular => 'service_icmpv6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | create => 'add-service-icmp6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | list => 'show-services-icmp6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | get => 'show-service-icmp6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | update => 'set-service-icmp6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | delete => 'delete-service-icmp6', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | object => 'services_other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | singular => 'service_other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | create => 'add-service-other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | list => 'show-services-other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | get => 'show-service-other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | update => 'set-service-other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | delete => 'delete-service-other', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | object => 'service_groups', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | singular => 'service_group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | create => 'add-service-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | list => 'show-service-groups', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | get => 'show-service-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | update => 'set-service-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | delete => 'delete-service-group', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | id_keys => [qw( uid name )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | object => 'sessions', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | singular => 'session', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | list => 'show-sessions', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | get => 'show-session', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | update => 'set-session', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | list_key => 'objects', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | object => 'tasks', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | singular => 'task', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | list => 'show-tasks', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | get => 'show-task', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | list_key => 'tasks', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | ]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | ▶ | sub login($self) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
login: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | my $res = $self->post('/web_api/v1/login', { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | user => $self->user, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | password => $self->passwd, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | ▶ | if ($res->code == 200) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | my $api_version = $res->data->{'api-server-version'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | $self->api_version($api_version); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | $self->set_persistent_header('X-chkp-sid', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | $res->data->{sid}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | $self->_error_handler($res->data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | ▶ | sub logout($self) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
logout: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | my $res = $self->post('/web_api/v1/logout', {}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | ▶ | sub publish($self) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
publish: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | my $res = $self->post('/web_api/v' . $self->api_version . '/publish', {}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | return $data->{'task-id'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | ▶ | sub discard($self) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
discard: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | my $res = $self->post('/web_api/v' . $self->api_version . '/discard', {}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 0 | return $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | ▶ | sub verify_policy($self, $policyname) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
verify_policy: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | ▶ | croak "policy name missing" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | unless defined $policyname; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | my $res = $self->post('/web_api/v' . $self->api_version . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | '/verify-policy', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 'policy-package' => $policyname, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | return $data->{'task-id'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | ▶ | sub install_policy($self, $policyname, $targets, $params={}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
install_policy: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | ▶ | croak "policy name missing" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | unless defined $policyname; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | croak "target(s) missing" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | unless defined $targets; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | ▶ | croak "target(s) must be a single name or uid or a list of names or uids" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $targets eq "" or ref $targets eq "ARRAY"
MC/DC0%0/2
ref $targets eq "" or ref $targets eq "ARRAY"
ref $targets eq ""
ref $targets eq "ARRAY"
Truth table0%0/3
A or B
A= ref $targets eq ""B= ref $targets eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | unless ref $targets eq '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | || ref $targets eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | ▶ | croak "parameters needs to be a hashref" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $params and ref $params ne "HASH"
MC/DC0%0/2
defined $params and ref $params ne "HASH"
defined $params
ref $params ne "HASH"
Truth table0%0/3
A and B
A= defined $paramsB= ref $params ne "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | if defined $params && ref $params ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | my $res = $self->post('/web_api/v' . $self->api_version . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | '/install-policy', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | $params->%*, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 'policy-package' => $policyname, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | targets => $targets, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | my $code = $res->code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | my $data = $res->data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | $self->_error_handler($data) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | unless $code == 200; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | return $data->{'task-id'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | ▶ | sub wait_for_task($self, $taskid, $callback) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
wait_for_task: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | ▶ | croak "task-id missing" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | unless defined $taskid; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 0 | ▶ | croak "callback must be a coderef" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $callback and ref $callback ne "CODE"
MC/DC0%0/2
defined $callback and ref $callback ne "CODE"
defined $callback
ref $callback ne "CODE"
Truth table0%0/3
A and B
A= defined $callbackB= ref $callback ne "CODE"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | if defined $callback && ref $callback ne 'CODE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 0 | my $task; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | ▶ | while (($task = $self->get_task({'task-id' => $taskid})->{tasks}[0]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$task = $self->get_task({"task-id", $taskid})->{"tasks"}[0] and $task->{"status"} eq "in progress"
MC/DC0%0/2
$task = $self->get_task({"task-id", $taskid})->{"tasks"}[0] and $task->{"status"} eq "in progress"
$task = $self->get_task({"task-id", $taskid})->{"tasks"}[0]
$task->{"status"} eq "in progress"
Truth table0%0/3
A and B
A= $task = $self->get_task({"task-id", $taskid})->{"tasks"}[0]B= $task->{"status"} eq "in progress"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | && $task->{status} eq 'in progress') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 0 | ▶ | &$callback($task) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | if defined $callback; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | sleep 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | return $task; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | =pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | Net::Checkpoint::Management::v1 - Checkpoint Management API version 1.x client library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | version 0.002000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | use Net::Checkpoint::Management::v1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | my $cpmgmt = Net::Checkpoint::Management::v1->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | server => 'https://cpmgmt.example.com', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | user => 'username', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | passwd => '$password', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | clientattrs => { timeout => 30 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | $cpmgmt->login; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | This module is a client library for the Checkpoint Management API version 1.x. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | Currently it is developed and tested against version R80.40. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | =head2 api_versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | Returns a list of all available API versions which gets populated on the first | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | call. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | Only works on API version 1.1 and higher. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | =head2 api_version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | The API version used by all methods. Is automatically set to the highest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | version available by the L</login> method. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | =head2 login | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | Logs into the Checkpoint Manager API using version 1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | =head2 logout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | Logs out of the Checkpoint Manager API using version 1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | =head2 publish | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | Publishes all previously submitted changes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | Returns the task id on success. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | =head2 discard | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | Discards all previously submitted changes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | Returns a hashref containing the operation status message and the number of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | discarded changes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | =head2 verify_policy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | Verifies the policy of the given package. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | Takes a policy name. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | Returns the task id on success. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | =head2 install_policy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | Installs the policy of the given package onto the given target(s). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | Takes a policy name, target(s) and an optional hashref of additional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | parameters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | The target(s) can be a single name or uid or a list of names or uids. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | Returns the task id on success. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | =head2 wait_for_task | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | Takes a task id and checks its status every second until it isn't | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | 'in progress' any more and return the status. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | Takes an optional callback coderef which is called for every check with the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | task as argument. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | Alexander Hartmaier <abraxxa@cpan.org> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | This software is copyright (c) 2022 by Alexander Hartmaier. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||