MetaAPI.pm

filter: Statementstmt 100% 104 / 104 Branchbran 90.7% 49 / 54 Conditioncond 59.4% 22 / 37 MC/DCmcdc 34.7% 8 / 23 Subroutinesub 100% 12 / 12 Podpod 50.0% 1 / 2 totaltotal 84.4% 196 / 232 CC 42 SCAR 31.1
CC
42
Cov
90%
create_vm
34.9
__ANON__
5.0
look_by_id_or_name
5.0
CRAP 22.3
↑ Summary MetaAPI/Roles/Listable.pm »
1 package OpenStack::MetaAPI;
2  
3 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 17 ▶use MIME::Base64 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 17 ▶use OpenStack::Client::Auth ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 17 ▶use OpenStack::MetaAPI::Routes ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 17 ▶use Scalar::Util qw/blessed weaken/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 17 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 # ABSTRACT: Perl5 OpenStack API abstraction on top of OpenStack::Client
14  
15 17 our $VERSION = '0.004'; # VERSION: generated by DZP::OurPkgVersion
16  
17 17 has 'debug' => (is => 'rw', default => 0);
18 17 has 'auth' => (is => 'ro', required => 1, handles => [qw/services/]);
19  
20 has 'route' => (
21 is => 'ro',
22 default => sub {
23 26 ▶ my ($self) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
24  
25 # weaken our circular dependency
26 26 my $auth = $self->auth;
27 26 weaken($auth);
28  
29 26 weaken($self);
30  
31 26 return OpenStack::MetaAPI::Routes->new(
32 auth => $auth,
33 api => $self);
34 },
35 17 handles => [OpenStack::MetaAPI::Routes->list_all()],
36 );
37  
38 # for create server
39 17 has 'create_max_timeout' => (is => 'rw', default => 5 * 60);
40 17 has 'create_loop_sleep' => (is => 'rw', default => 5);
41  
42 around BUILDARGS => sub {
43 30 ▶ my ($orig, $class, @args) = @_;
Subroutine __ANON__: called CC=5 SCAR=16.1
44  
45 30 ▶ die "Missing arguments to create Auth object" unless scalar @args;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @args 2 28 30
46  
47 # A caller that has already built its auth object hands it straight over.
48 #
49 # Keystone can be talked to by methods OpenStack::Client::Auth does not
50 # implement -- an application credential, for one -- and the only way to use
51 # one is to construct the auth object yourself. Building a fresh one from
52 # the args regardless left no way to do that, so such a caller could not use
53 # this module at all.
54 #
55 # Normal construction is new($endpoint, %args), whose first argument is a
56 # URL rather than a reference, so it does not match this.
57 #
58 # The 'auth' has to be a blessed object, not merely a reference: a
59 # clouds.yaml cloud entry is a plain hashref with an 'auth' key of its own
60 # (auth_url, username, password, ...), and letting that through would store
61 # an unblessed hash as the auth object -- construction would succeed and the
62 # first delegated call would die far from here on an unblessed reference.
63 return $args[0]
64 if scalar @args == 1
65 && ref $args[0] eq 'HASH'
66 28 ▶ && blessed($args[0]->{'auth'});
Branch: 1 branch
BranchTrueFalseTotal
if scalar @args == 1 and ref $args[0] eq "HASH" and builtin::blessed($args[0]{"auth"}) 1 27 28
Condition83%5/6
scalar @args == 1 and ref $args[0] eq "HASH" and builtin::blessed($args[0]{"auth"})
!ll&&!rl&&r
2521
scalar @args == 1 and ref $args[0] eq "HASH"
!ll&&!rl&&r
2503
MC/DC66%2/3
scalar @args == 1 and ref $args[0] eq "HASH" and builtin::blessed($args[0]{"auth"})
scalar @args == 1 ref $args[0] eq "HASH" builtin::blessed($args[0]{"auth"})
Truth table75%3/4
A and B and C
A= scalar @args == 1B= ref $args[0] eq "HASH"C= builtin::blessed($args[0]{"auth"})
ABCresult
0XX0
10X0
1100
1111
67  
68 # automagically build the OpenStack::Client::Auth from existing args
69 27 return {auth => OpenStack::Client::Auth->new(@args)};
70 17 };
71  
72 sub create_vm {
73 15 ▶ my ($self, %opts) = @_;
Subroutine create_vm: called CC=32 SCAR=35.5
Pod documented
74  
75 die "'flavor' name or id is required by create_vm"
76 15 ▶ unless defined $opts{flavor};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts{"flavor"} 1 14 15
77 die "'network' name or id is required by create_vm"
78 14 ▶ unless defined $opts{network};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts{"network"} 1 13 14
79 die "'image' name or id is required by create_vm"
80 13 ▶ unless defined $opts{image};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts{"image"} 1 12 13
81 12 ▶ die "'name' field is required by create_vm" unless defined $opts{name};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts{"name"} 1 11 12
82  
83 $opts{security_group} //=
84 11 ▶ 'default'; # optional argument fallback to 'default'
Condition50%1/2
$opts{"security_group"} //= "default"
l!l
011
MC/DC0%0/1
$opts{"security_group"} //= "default"
$opts{"security_group"}
Truth table50%1/2
A
A= $opts{"security_group"}
Aresult
11
00
85  
86 # get the flavor by id or name
87 11 my $flavor = $self->look_by_id_or_name(flavors => $opts{flavor});
88  
89 # get the network by id or name
90 11 my $network = $self->look_by_id_or_name(networks => $opts{network});
91  
92 # Optional: not every cloud has a tenant network to escape from. Where the
93 # only network is external and shared, a server on it is given a routable
94 # address directly -- reported as 'fixed' -- and there is no floating IP to
95 # attach. Requiring one made such a cloud impossible to build on at all.
96 11 my $network_for_floating_ip;
97 $network_for_floating_ip =
98 $self->look_by_id_or_name(networks => $opts{network_for_floating_ip})
99 11 ▶ if defined $opts{network_for_floating_ip};
Branch: 1 branch
BranchTrueFalseTotal
if defined $opts{"network_for_floating_ip"} 9 2 11
100  
101 10 my $image;
102 10 ▶ if (_looks_valid_id($opts{image})) {
Branch: 1 branch
BranchTrueFalseTotal
if (_looks_valid_id($opts{"image"})) 10 0 10
103 10 $image = $self->image_from_uid($opts{image});
104 }
105 10 ▶ $image //= $self->image_from_name($opts{image});
Condition33%1/3
$image //= $self->image_from_name($opts{"image"})
l!l&&r!l&&!r
1000
MC/DC0%0/2
$image //= $self->image_from_name($opts{"image"})
$image $self->image_from_name($opts{"image"})
Truth table33%1/3
A //= B
A= $imageB= $self->image_from_name($opts{"image"})
ABresult
1X1
011
000
106  
107 die "Cannot find image for id/name '$opts{image}'"
108 10 ▶ unless ref $image eq 'HASH' && _looks_valid_id($image->{id});
Branch: 1 branch
BranchTrueFalseTotal
unless ref $image eq "HASH" and _looks_valid_id($image->{"id"}) 1 9 10
Condition66%2/3
ref $image eq "HASH" and _looks_valid_id($image->{"id"})
!ll&&!rl&&r
019
MC/DC50%1/2
ref $image eq "HASH" and _looks_valid_id($image->{"id"})
ref $image eq "HASH" _looks_valid_id($image->{"id"})
Truth table66%2/3
A and B
A= ref $image eq "HASH"B= _looks_valid_id($image->{"id"})
ABresult
0X0
100
111
109  
110 my $security_group =
111 9 $self->look_by_id_or_name(security_groups => $opts{security_group});
112  
113 9 my @extra;
114 9 ▶ if (defined $opts{key_name}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opts{"key_name"}) 3 6 9
115 3 push @extra, (key_name => $opts{key_name});
116 }
117  
118 # Nova wants user_data base64 encoded, and every caller has cloud-config
119 # rather than base64, so encode it here instead of making each of them
120 # remember to. Without this there is no way to hand a new server its
121 # cloud-init payload at all, which is most of the point of creating one.
122 9 ▶ if (defined $opts{user_data} && length $opts{user_data}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opts{"user_data"} and length $opts{"user_data"}) 1 8 9
Condition66%2/3
defined $opts{"user_data"} and length $opts{"user_data"}
!ll&&!rl&&r
801
MC/DC50%1/2
defined $opts{"user_data"} and length $opts{"user_data"}
defined $opts{"user_data"} length $opts{"user_data"}
Truth table66%2/3
A and B
A= defined $opts{"user_data"}B= length $opts{"user_data"}
ABresult
0X0
100
111
123 push @extra,
124 1 (user_data => MIME::Base64::encode_base64($opts{user_data}, ''));
125 }
126  
127 # Pass-throughs. Each is a plain server-create field that had no way of
128 # being set: which availability zone to build in, the metadata a later
129 # lookup finds the server by, and the volumes it boots or carries.
130 9 foreach my $field (qw{availability_zone metadata block_device_mapping_v2}) {
131 27 ▶ push @extra, ($field => $opts{$field}) if defined $opts{$field};
Branch: 1 branch
BranchTrueFalseTotal
if defined $opts{$field} 2 25 27
132 }
133  
134 my $server = $self->create_server(
135 name => $opts{name},
136 imageRef => $image->{id},
137 flavorRef => $flavor->{id},
138 min_count => 1,
139 max_count => 1,
140 # By name, which is what the field is. This passed the id, which
141 # some clouds resolve anyway and others do not.
142 security_groups => [{name => $security_group->{name} // $security_group->{id}}],
143 9 ▶ networks => [{uuid => $network->{id}}],
Condition33%1/3
$security_group->{"name"} // $security_group->{"id"}
l!l&&r!l&&!r
900
MC/DC0%0/2
$security_group->{"name"} // $security_group->{"id"}
$security_group->{"name"} $security_group->{"id"}
Truth table33%1/3
A // B
A= $security_group->{"name"}B= $security_group->{"id"}
ABresult
1X1
011
000
144 @extra,
145 );
146  
147 9 my $server_uid = $server->{id};
148 9 ▶ die "Failed to create server" unless _looks_valid_id($server_uid);
Branch: 1 branch
BranchTrueFalseTotal
unless _looks_valid_id($server_uid) 0 9 9
149  
150 # we are going to wait for 5 minutes for the server
151 9 ▶ my $wait_time_limit = $opts{wait_time_limit} // $self->create_max_timeout;
Condition33%1/3
$opts{"wait_time_limit"} // $self->create_max_timeout
l!l&&r!l&&!r
090
MC/DC0%0/2
$opts{"wait_time_limit"} // $self->create_max_timeout
$opts{"wait_time_limit"} $self->create_max_timeout
Truth table33%1/3
A // B
A= $opts{"wait_time_limit"}B= $self->create_max_timeout
ABresult
1X1
011
000
152  
153 9 my $now = time();
154 9 my $max_time = $now + $wait_time_limit;
155 9 my $server_is_ready = 0;
156  
157 9 my $server_status;
158  
159 # TODO: maybe add one alarm...
160 9 ▶ while (time() < $max_time) {
Branch: 1 branch
BranchTrueFalseTotal
if (time < $max_time) 12 1 13
161  
162 12 $server_status = $self->server_from_uid($server_uid);
163  
164 12 ▶ if (ref $server_status && $server_status->{status}) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $server_status and $server_status->{"status"}) 12 0 12
Condition33%1/3
ref $server_status and $server_status->{"status"}
!ll&&!rl&&r
0012
MC/DC0%0/2
ref $server_status and $server_status->{"status"}
ref $server_status $server_status->{"status"}
Truth table33%1/3
A and B
A= ref $server_statusB= $server_status->{"status"}
ABresult
0X0
100
111
165 12 my $status = lc($server_status->{status});
166  
167 12 ▶ if ($status eq 'active') {
Branch: 1 branch
BranchTrueFalseTotal
if ($status eq "active") 4 8 12
168 4 $server_is_ready = 1;
169 4 last;
170 }
171  
172 # Fail fast on ERROR — no point waiting out the timeout.
173 8 ▶ if ($status eq 'error') {
Branch: 1 branch
BranchTrueFalseTotal
if ($status eq "error") 4 4 8
174 4 ▶ my $fault = $server_status->{fault} || {};
Condition100%2/2
$server_status->{'fault'} || {}
l!l
22
MC/DC100%1/1
$server_status->{'fault'} || {}
$server_status->{'fault'}
Truth table100%2/2
A
A= $server_status->{'fault'}
Aresult
11
00
175 4 my $msg
176 = "Failed to create server $server_uid: status=ERROR";
177 4 ▶ $msg .= " code=$fault->{code}" if $fault->{code};
Branch: 1 branch
BranchTrueFalseTotal
if $fault->{"code"} 2 2 4
178 4 ▶ $msg .= " message=$fault->{message}" if $fault->{message};
Branch: 1 branch
BranchTrueFalseTotal
if $fault->{"message"} 2 2 4
179 4 die "$msg\n";
180 }
181 }
182 4 ▶ sleep $self->create_loop_sleep if $self->create_loop_sleep;
Branch: 1 branch
BranchTrueFalseTotal
if $self->create_loop_sleep 2 2 4
183 }
184  
185 5 ▶ die "Failed to create server: never came back as active"
Branch: 1 branch
BranchTrueFalseTotal
unless $server_is_ready 1 4 5
186 unless $server_is_ready;
187  
188 # now add one IP to the server
189 4 ▶ if ($network_for_floating_ip) {
Branch: 1 branch
BranchTrueFalseTotal
if ($network_for_floating_ip) 2 2 4
190 # create a floating IP
191 my $floating_ip =
192 2 $self->create_floating_ip($network_for_floating_ip->{id});
193  
194 die "Failed to create floating ip"
195 2 ▶ unless ref $floating_ip && _looks_valid_id($floating_ip->{id});
Branch: 1 branch
BranchTrueFalseTotal
unless ref $floating_ip and _looks_valid_id($floating_ip->{"id"}) 0 2 2
Condition33%1/3
ref $floating_ip and _looks_valid_id($floating_ip->{"id"})
!ll&&!rl&&r
002
MC/DC0%0/2
ref $floating_ip and _looks_valid_id($floating_ip->{"id"})
ref $floating_ip _looks_valid_id($floating_ip->{"id"})
Truth table33%1/3
A and B
A= ref $floating_ipB= _looks_valid_id($floating_ip->{"id"})
ABresult
0X0
100
111
196  
197 # add the floating IP to the server
198 my $added =
199 $self->add_floating_ip_to_server($floating_ip->{id}, $server_uid,
200 2 network_id => $network->{id});
201  
202 $server_status->{floating_ip_address} =
203 2 $floating_ip->{floating_ip_address};
204 2 $server_status->{floating_ip_id} = $floating_ip->{id};
205 }
206  
207 4 return $server_status;
208 }
209  
210 sub look_by_id_or_name {
211 44 ▶ my ($self, $helper, $id_or_name) = @_;
Subroutine look_by_id_or_name: called CC=5 SCAR=16.1
Pod undocumented
212  
213 44 my $entry;
214 44 ▶ if (_looks_valid_id($id_or_name)) {
Branch: 1 branch
BranchTrueFalseTotal
if (_looks_valid_id($id_or_name)) 1 43 44
215 1 $entry = $self->can($helper)->($self, id => $id_or_name);
216 }
217 44 ▶ $entry //= $self->can($helper)->($self, name => $id_or_name);
Condition100%3/3
$entry //= $self->can($helper)->($self, "name", $id_or_name)
l!l&&r!l&&!r
1403
MC/DC100%2/2
$entry //= $self->can($helper)->($self, "name", $id_or_name)
$entry $self->can($helper)->($self, "name", $id_or_name)
Truth table100%3/3
A //= B
A= $entryB= $self->can($helper)->($self, "name", $id_or_name)
ABresult
1X1
011
000
218  
219 44 ▶ if (ref $entry ne 'HASH' || !_looks_valid_id($entry->{id})) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $entry ne "HASH" or not _looks_valid_id($entry->{"id"})) 3 41 44
Condition66%2/3
ref $entry ne "HASH" or not _looks_valid_id($entry->{"id"})
l!l&&r!l&&!r
3041
MC/DC50%1/2
ref $entry ne "HASH" or not _looks_valid_id($entry->{"id"})
ref $entry ne "HASH" not _looks_valid_id($entry->{"id"})
Truth table66%2/3
A or not(B)
A= ref $entry ne "HASH"B= not _looks_valid_id($entry->{"id"})
ABresult
1X1
011
000
220 3 die "Cannot find '$helper' for id/name '$id_or_name'";
221 }
222  
223 41 return $entry;
224 }
225  
226 sub _looks_valid_id {
227 116 ▶ my ($id) = @_;
Subroutine _looks_valid_id: called CC=3 SCAR=11.0
228  
229 116 ▶ return unless defined $id;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $id 1 115 116
230 115 ▶ return if ref $id;
Branch: 1 branch
BranchTrueFalseTotal
if ref $id 0 115 115
231  
232 115 my $VALID_ID = qr{^[a-f0-9\-]+$}i;
233  
234 115 return $id =~ $VALID_ID;
235 }
236  
237 17 1;
238  
239 __END__
240  
241 =pod
242  
243 =encoding utf-8
244  
245 =head1 NAME
246  
247 OpenStack::MetaAPI - Perl5 OpenStack API abstraction on top of OpenStack::Client
248  
249 =head1 VERSION
250  
251 version 0.004
252  
253 =head1 SYNOPSIS
254  
255 #!/usr/bin/env perl
256
257 use strict;
258 use warnings;
259
260 use OpenStack::MetaAPI ();
261
262 use Test::More;
263
264 SKIP: {
265 skip "OS_AUTH_URL unset, please source one openrc.sh file before."
266 unless $ENV{OS_AUTH_URL} && $ENV{AUTHOR_TESTING};
267
268 # create one OpenStack::MetaAPI object
269 # this is using OpenStack::Client::Auth
270 my $api = OpenStack::MetaAPI->new(
271 $ENV{OS_AUTH_URL},
272 username => $ENV{'OS_USERNAME'},
273 password => $ENV{'OS_PASSWORD'},
274 version => 3,
275 scope => {
276 project => {
277 name => $ENV{'OS_PROJECT_NAME'},
278 domain => {id => 'default'},
279 }
280 },
281 );
282
283 # OpenStack API documentation:
284 # https://developer.openstack.org/api-guide/quick-start/#current-api-versions
285
286 #
287 # You can call most routes direclty on the main API object
288 # without the need to know which service is providing it
289 #
290
291 # list all flavors
292 my @flavors = $api->flavors();
293 my $small = $api->flavors(name => 'small');
294 my @some_flavors = $api->flavors(name => qr{^(?:small|medium)});
295
296 # list all servers
297 my @servers = $api->servers();
298
299 # filter the server result using any keys
300 # Note: known API valid request arguments are used as part of the request
301 @servers = $api->servers(name => 'foo');
302
303 # can also use a regex
304 @servers = $api->servers(name => qr{^foo});
305
306 # get a single server by one id
307 my $SERVER_ID = q[aaaa-bbbb-cccc-dddd];
308 my $server = $api->server_from_uid($SERVER_ID);
309
310 # delete a server [also delete associated floating IPs]
311 $api->delete_server($SERVER_ID);
312
313 # listing floating IPs
314 my @floatingips = $api->floatingips();
315
316 # listing all images is currently not supported
317 # [slow as multiple requests are require 'next']
318 # prefer selecting one image using one of these two helpers
319 my $IMAGE_UID = '1111-2222-3456';
320 my $image = $api->image_from_uid($IMAGE_UID);
321 my $IMAGE_NAME = 'MyCustomImage';
322 $image = $api->image_from_name($IMAGE_NAME);
323
324 my @security_groups = $api->security_groups();
325
326 my $SECURITY_GROUP_ID = '12345';
327
328 my $security_group = $api->security_groups(id => $SECURITY_GROUP_ID);
329 $security_group = $api->security_groups(name => 'default');
330
331 # you can also create one server using the create_vm helper
332
333 my $vm = $api->create_vm(
334 name => 'SERVER_NAME',
335 image => 'IMAGE_UID or IMAGE_NAME', # image used to create the VM
336 flavor => 'small',
337 key_name => 'your ssh key name', # optional key to set
338 security_group =>
339 'default', # security group to use, by default use 'default'
340 network => 'NETWORK_NAME or NETWORK_ID', # network group to use
341 network_for_floating_ip => 'NETWORK_NAME or NETWORK_ID',
342 );
343
344 }
345
346 1;
347  
348 =head1 DESCRIPTION
349  
350 OpenStack::MetaAPI
351  
352 Using OpenStack::MetaAPI you can call routes from any service directly on the main object.
353 Helpers are defined from the L<specs|https://docs.openstack.org/api-quick-start/#current-api-versions> defined.
354  
355 Currently only a very small part of the specs have been imported to this project.
356  
357 This software is currently in C<PRE-ALPHA> stage... use it at your own risk!
358 Feel free to report issues to the Bug Tracker or contribute.
359  
360 =head1 Available functions / methods
361  
362 =head2 new( [ Arguments for OpenStack::Client::Auth ] )
363  
364 Create one OpenStack::MetaAPI object.
365 For now all arguments passed to C<new> are used to create one L<OpenStack::Client::Auth>.
366  
367 =head2 $api->flavors( [ %filter ] )
368  
369 List all flavors from the compute service. [view synopsis for some sample usage]
370  
371 =head2 $api->servers( [ %filter ] )
372  
373 List all servers from the compute service. [view synopsis for some sample usage]
374  
375 =head2 $api->floatingips( [ %filter ] )
376  
377 List all floatingips from the network service. [view synopsis for some sample usage]
378  
379 =head2 $api->security_groups( [ %filter ] )
380  
381 List all security_groups from the network service. [view synopsis for some sample usage]
382  
383 =head2 $api->image_from_uid( $image_uid )
384  
385 Select one image from its UID. [view synopsis for some sample usage]
386  
387 =head2 $api->image_from_name( $image_name )
388  
389 Select one image from its name. [view synopsis for some sample usage]
390  
391 =head2 $api->create_vm( %args )
392  
393 Create one server from one image with one floating IP, wait for the server to be ready.
394  
395 my $vm = $api->create_vm(
396 name => 'SERVER_NAME',
397 image => 'IMAGE_UID or IMAGE_NAME', # image used to create the VM
398 flavor => 'small',
399 key_name => 'your ssh key name', # optional key to set
400 security_group => 'default', # security group to use, by default use 'default'
401 network => 'NETWORK_NAME or NETWORK_ID', # network group to use
402 network_for_floating_ip => 'NETWORK_NAME or NETWORK_ID',
403 );
404  
405 =head2 $api->delete_server( $server_id );
406  
407 Delete a server from its id. Note floating IP linked to the server are also deleted.
408  
409 =head1 SEE ALSO
410  
411 This module is a wrapper around L<OpenStack::Client> and L<OpenStack::Client::Auth>
412  
413 =over
414  
415 =item L<OpenStack::Client> - OpenStack API client.
416  
417 =back
418  
419 =head1 TODO
420  
421 =over
422  
423 =item refactor/clean existing prototype
424  
425 =item increase API Specs defintion
426  
427 =item plug methods to route from API Specs
428  
429 =item helper to purge unused floatingips
430  
431 =item helper to purge unused servers
432  
433 =item increase POD & add some extra examples
434  
435 =item POD for using filtering: using RegExp, ...
436  
437 =item improve filtering on the request when described by the specs
438  
439 =back
440  
441 =head1 LICENSE
442  
443 This software is copyright (c) 2019 by cPanel, L.L.C.
444  
445 This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming
446 language system itself.
447  
448 =head1 DISCLAIMER OF WARRANTY
449  
450 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY
451 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
452 SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
453 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
454 OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
455 REPAIR, OR CORRECTION.
456  
457 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY
458 WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES,
459 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
460 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
461 THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS
462 BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
463  
464 =head1 AUTHOR
465  
466 Nicolas R <atoomic@cpan.org>
467  
468 =head1 COPYRIGHT AND LICENSE
469  
470 This software is copyright (c) 2019 by cPanel, Inc.
471  
472 This is free software; you can redistribute it and/or modify it under
473 the same terms as the Perl 5 programming language system itself.
474  
475 =cut
↑ Summary MetaAPI/Roles/Listable.pm »