line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Megaport; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
1190
|
use 5.10.0; |
|
3
|
|
|
|
|
7
|
|
4
|
3
|
|
|
3
|
|
9
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
41
|
|
5
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
106
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "1.00"; |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
11
|
use Carp qw(croak); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
145
|
|
10
|
3
|
|
|
3
|
|
890
|
use Megaport::Client; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
73
|
|
11
|
3
|
|
|
3
|
|
1116
|
use Megaport::Session; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
184
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Class::Tiny qw(token username password client errstr), { |
14
|
0
|
|
0
|
|
|
|
uri => sub { $ENV{MEGAPORT_URI} // 'https://api.megaport.com/v2' }, |
15
|
|
|
|
|
|
|
debug => 0, |
16
|
|
|
|
|
|
|
no_verify => 0, |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
session => sub { Megaport::Session->new(client => shift->client) } |
19
|
3
|
|
|
3
|
|
29
|
}; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
20
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub BUILD { |
22
|
0
|
|
|
0
|
0
|
|
my ($self, $args) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
$self->client( |
25
|
|
|
|
|
|
|
Megaport::Client->new( |
26
|
|
|
|
|
|
|
uri => $self->uri, |
27
|
|
|
|
|
|
|
no_verify => $self->no_verify, |
28
|
|
|
|
|
|
|
debug => $self->debug |
29
|
|
|
|
|
|
|
) |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
if (!$self->client->login($args)) { |
33
|
0
|
|
|
|
|
|
croak 'Error logging in to Megaport: ' . $self->client->errstr; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |