| 1 | package OpenStack::MetaAPI; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use OpenStack::Client::Auth (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | ▶ | use OpenStack::MetaAPI::Routes (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 6 | ▶ | use Scalar::Util qw/weaken/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 6 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # ABSTRACT: Perl5 OpenStack API abstraction on top of OpenStack::Client | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 6 | our $VERSION = '0.002'; # VERSION: generated by DZP::OurPkgVersion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 6 | has 'debug' => (is => 'rw', default => 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 6 | has 'auth' => (is => 'ro', required => 1, handles => [qw/services/]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | has 'route' => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | default => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 6 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | # weaken our circular dependency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 6 | my $auth = $self->auth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 6 | weaken($auth); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 6 | weaken($self); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 6 | return OpenStack::MetaAPI::Routes->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | auth => $auth, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | api => $self); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 6 | handles => [OpenStack::MetaAPI::Routes->list_all()], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | # for create server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 6 | has 'create_max_timeout' => (is => 'rw', default => 5 * 60); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 6 | has 'create_loop_sleep' => (is => 'rw', default => 5); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | around BUILDARGS => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 7 | ▶ | my ($orig, $class, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 7 | ▶ | die "Missing arguments to create Auth object" unless scalar @args; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | # automagically build the OpenStack::Client::Auth from existing args | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 6 | return {auth => OpenStack::Client::Auth->new(@args)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 6 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | sub create_vm { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 3 | ▶ | my ($self, %opts) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_vm: called CC=21 SCAR=33.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | die "'flavor' name or id is required by create_vm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 3 | ▶ | unless defined $opts{flavor}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | die "'network' name or id is required by create_vm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 3 | ▶ | unless defined $opts{network}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | die "'image' name or id is required by create_vm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 3 | ▶ | unless defined $opts{image}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 3 | ▶ | die "'name' field is required by create_vm" unless defined $opts{name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | die "'network_for_floating_ip' field is required by create_vm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 3 | ▶ | unless defined $opts{network_for_floating_ip}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | $opts{security_group} //= | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 3 | ▶ | 'default'; # optional argument fallback to 'default' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$opts{"security_group"} //= "default"
MC/DC0%0/1
$opts{"security_group"} //= "default"
$opts{"security_group"}
Truth table50%1/2
A
A= $opts{"security_group"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | # get the flavor by id or name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 3 | my $flavor = $self->look_by_id_or_name(flavors => $opts{flavor}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # get the network by id or name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 3 | my $network = $self->look_by_id_or_name(networks => $opts{network}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | # get the network used to add the floating up later | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | my $network_for_floating_ip = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 3 | $self->look_by_id_or_name(networks => $opts{network_for_floating_ip}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 2 | my $image; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 2 | ▶ | if (_looks_valid_id($opts{image})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | $image = $self->image_from_uid($opts{image}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 2 | ▶ | $image //= $self->image_from_name($opts{image}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$image //= $self->image_from_name($opts{"image"})
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"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | my $security_group = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 2 | $self->look_by_id_or_name(security_groups => $opts{security_group}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 2 | my @extra; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 2 | ▶ | if (defined $opts{key_name}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 2 | push @extra, (key_name => $opts{key_name}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | my $server = $self->create_server( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | name => $opts{name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | imageRef => $image->{id}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | flavorRef => $flavor->{id}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | min_count => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | max_count => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | security_groups => [{name => $security_group->{id}}], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 2 | networks => [{uuid => $network->{id}}], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | @extra, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 2 | my $server_uid = $server->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | ▶ | die "Failed to create server" unless _looks_valid_id($server_uid); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | # we are going to wait for 5 minutes fpr the server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 2 | ▶ | my $wait_time_limit = $opts{wait_time_limit} // $self->create_max_timeout; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$opts{"wait_time_limit"} // $self->create_max_timeout
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 2 | my $now = time(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 2 | my $max_time = $now + $wait_time_limit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 2 | my $server_is_ready; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | my $server_status; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | # TODO: maybe add one alarm... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 2 | ▶ | while (time() < $max_time) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 5 | $server_status = $self->server_from_uid($server_uid); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 5 | ▶ | if ( ref $server_status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
ref $server_status and $server_status->{"status"} and $server_status->{"status"} and lc $server_status->{"status"} eq "active"
ref $server_status and $server_status->{"status"} and $server_status->{"status"}
ref $server_status and $server_status->{"status"}
MC/DC25%1/4
ref $server_status and $server_status->{"status"} and $server_status->{"status"} and lc $server_status->{"status"} eq "active"
ref $server_status
$server_status->{"status"}
$server_status->{"status"}
lc $server_status->{"status"} eq "active"
Truth table40%2/5
A and B and C and D
A= ref $server_statusB= $server_status->{"status"}C= $server_status->{"status"}D= lc $server_status->{"status"} eq "active"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | && $server_status->{status} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | && $server_status->{status} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | && lc($server_status->{status}) eq 'active') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 1 | $server_is_ready = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 1 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 4 | ▶ | sleep $self->create_loop_sleep if $self->create_loop_sleep; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 2 | ▶ | die "Failed to create server: never came back as active" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | unless $server_is_ready; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | # now add one IP to the server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | # create a floating IP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 1 | my $floating_ip = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 1 | $self->create_floating_ip($network_for_floating_ip->{id}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | die "Failed to create floating ip" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | unless ref $floating_ip && _looks_valid_id($floating_ip->{id}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $floating_ip and _looks_valid_id($floating_ip->{"id"})
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"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | # add the floating IP to the server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | my $added = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 1 | $self->add_floating_ip_to_server($floating_ip->{id}, $server_uid); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | $server_status->{floating_ip_address} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 1 | $floating_ip->{floating_ip_address}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 1 | $server_status->{floating_ip_id} = $floating_ip->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 1 | return $server_status; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | sub look_by_id_or_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 11 | ▶ | my ($self, $helper, $id_or_name) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
look_by_id_or_name: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 11 | my $entry; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 11 | ▶ | if (_looks_valid_id($id_or_name)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | $entry = $self->can($helper)->($self, id => $id_or_name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 11 | ▶ | $entry //= $self->can($helper)->($self, name => $id_or_name); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$entry //= $self->can($helper)->($self, "name", $id_or_name)
MC/DC50%1/2
$entry //= $self->can($helper)->($self, "name", $id_or_name)
$entry
$self->can($helper)->($self, "name", $id_or_name)
Truth table66%2/3
A //= B
A= $entryB= $self->can($helper)->($self, "name", $id_or_name)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 11 | ▶ | if (ref $entry ne 'HASH' || !_looks_valid_id($entry->{id})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $entry ne "HASH" or not _looks_valid_id($entry->{"id"})
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"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 1 | die "Cannot find '$helper' for id/name '$id_or_name'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 10 | return $entry; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | sub _looks_valid_id { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 26 | ▶ | my ($id) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_looks_valid_id: called CC=3 SCAR=11.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 26 | ▶ | return unless defined $id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 26 | ▶ | return if ref $id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 26 | my $VALID_ID = qr{^[a-f0-9\-]+$}i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 26 | return $id =~ $VALID_ID; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | =pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | =encoding utf-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | OpenStack::MetaAPI - Perl5 OpenStack API abstraction on top of OpenStack::Client | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | version 0.002 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | #!/usr/bin/env perl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | use OpenStack::MetaAPI (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | use Test::More; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | SKIP: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | skip "OS_AUTH_URL unset, please source one openrc.sh file before." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | unless $ENV{OS_AUTH_URL} && $ENV{AUTHOR_TESTING}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | # create one OpenStack::MetaAPI object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | # this is using OpenStack::Client::Auth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | my $api = OpenStack::MetaAPI->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | $ENV{OS_AUTH_URL}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | username => $ENV{'OS_USERNAME'}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | password => $ENV{'OS_PASSWORD'}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | version => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | scope => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | project => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | name => $ENV{'OS_PROJECT_NAME'}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | domain => {id => 'default'}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | # OpenStack API documentation: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | # https://developer.openstack.org/api-guide/quick-start/#current-api-versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | # You can call most routes direclty on the main API object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | # without the need to know which service is providing it | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | # list all flavors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | my @flavors = $api->flavors(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | my $small = $api->flavors(name => 'small'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | my @some_flavors = $api->flavors(name => qr{^(?:small|medium)}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | # list all servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | my @servers = $api->servers(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | # filter the server result using any keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | # Note: known API valid request arguments are used as part of the request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | @servers = $api->servers(name => 'foo'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | # can also use a regex | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | @servers = $api->servers(name => qr{^foo}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | # get a single server by one id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | my $SERVER_ID = q[aaaa-bbbb-cccc-dddd]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | my $server = $api->server_from_uid($SERVER_ID); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | # delete a server [also delete associated floating IPs] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | $api->delete_server($SERVER_ID); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | # listing floating IPs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | my @floatingips = $api->floatingips(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | # listing all images is currently not supported | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | # [slow as multiple requests are require 'next'] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | # prefer selecting one image using one of these two helpers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | my $IMAGE_UID = '1111-2222-3456'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | my $image = $api->image_from_uid($IMAGE_UID); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | my $IMAGE_NAME = 'MyCustomImage'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | $image = $api->image_from_name($IMAGE_NAME); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | my @security_groups = $api->security_groups(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | my $SECURITY_GROUP_ID = '12345'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | my $security_group = $api->security_groups(id => $SECURITY_GROUP_ID); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | $security_group = $api->security_groups(name => 'default'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | # you can also create one server using the create_vm helper | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | my $vm = $api->create_vm( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | name => 'SERVER_NAME', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | image => 'IMAGE_UID or IMAGE_NAME', # image used to create the VM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | flavor => 'small', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | key_name => 'your ssh key name', # optional key to set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | security_group => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 'default', # security group to use, by default use 'default' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | network => 'NETWORK_NAME or NETWORK_ID', # network group to use | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | network_for_floating_ip => 'NETWORK_NAME or NETWORK_ID', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | OpenStack::MetaAPI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | Using OpenStack::MetaAPI you can call routes from any service directly on the main object. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | Helpers are defined from the specs defined https://developer.openstack.org/api-guide/quick-start/#current-api-versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | Currently only a very small part of the specs have been imported to this project. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | This software is currently in C<PRE-ALPHA> stage... use it at your own risk! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | Feel free to report issues to the Bug Tracker or contribute. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | =head1 Available functions / methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | =head2 new( [ Arguments for OpenStack::Client::Auth ] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | Create one OpenStack::MetaAPI object. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | For now all arguments passed to C<new> are used to create one L<OpenStack::Client::Auth>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | =head2 $api->flavors( [ %filter ] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | List all flavors from the compute service. [view synopsis for some sample usage] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | =head2 $api->servers( [ %filter ] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | List all servers from the compute service. [view synopsis for some sample usage] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | =head2 $api->floatingips( [ %filter ] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | List all floatingips from the network service. [view synopsis for some sample usage] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | =head2 $api->security_groups( [ %filter ] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | List all security_groups from the network service. [view synopsis for some sample usage] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | =head2 $api->image_from_uid( $image_uid ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | Select one image from its UID. [view synopsis for some sample usage] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | =head2 $api->image_from_name( $image_name ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | Select one image from its name. [view synopsis for some sample usage] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | =head2 $api->create_vm( %args ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | Create one server from one image with one floating IP, wait for the server to be ready. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | my $vm = $api->create_vm( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | name => 'SERVER_NAME', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | image => 'IMAGE_UID or IMAGE_NAME', # image used to create the VM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | flavor => 'small', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | key_name => 'your ssh key name', # optional key to set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | security_group => 'default', # security group to use, by default use 'default' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | network => 'NETWORK_NAME or NETWORK_ID', # network group to use | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | network_for_floating_ip => 'NETWORK_NAME or NETWORK_ID', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | =head2 $api->delete_server( $server_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | Delete a server from its id. Note floating IP linked to the server are also deleted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | This module is a wrapper around L<OpenStack::Client> and L<OpenStack::Client::Auth> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | =over | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | =item L<OpenStack::Client> - OpenStack API client. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | =back | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | =head1 TODO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | =over | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | =item refactor/clean existing prototype | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | =item increase API Specs defintion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | =item plug methods to route from API Specs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | =item helper to purge unused floatingips | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | =item helper to purge unused servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | =item increase POD & add some extra examples | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | =item POD for using filtering: using RegExp, ... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | =item improve filtering on the request when described by the specs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | =back | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | =head1 LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | This software is copyright (c) 2019 by cPanel, L.L.C. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | =head1 DISCLAIMER OF WARRANTY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | REPAIR, OR CORRECTION. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | Nicolas R <atoomic@cpan.org> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | This software is copyright (c) 2019 by cPanel, Inc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||