File Coverage

blib/lib/Megaport/Services.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Megaport::Services;
2 3     3   9 use parent 'Megaport::Internal::_Result';
  3         3  
  3         10  
3              
4 3     3   133 use 5.10.0;
  3         5  
5 3     3   8 use strict;
  3         4  
  3         39  
6 3     3   7 use warnings;
  3         3  
  3         99  
7              
8             use Class::Tiny {
9 3         18 _request => {
10             pkey => 'productUid',
11             method => 'GET',
12             path => '/products'
13             }
14 3     3   15 };
  3         3  
15              
16             1;
17             =encoding utf-8
18             =head1 NAME
19              
20             Megaport::Services
21              
22             =head1 DESCRIPTION
23              
24             This provide a simple read-only list of Megaport services owned by the logged in account. Details about the objects returned by the API can be found L.
25              
26             =head1 METHODS
27              
28             =head2 list
29              
30             # Optional array or arrayref
31             my @list = $services->list;
32             my $list = $services->list;
33              
34             # Use search terms to find a partial list
35             my @fast = $services->list(portSpeed => 10000);
36             my @merican = $services->list(market => 'US');
37              
38             Returns a list or allows searching based on any field present in the object.
39              
40             =head2 get
41              
42             my $gs_port = $services->get(id => 'my-product-uid');
43             my $first = $services->get(name => 'My First Megaport');
44              
45             Best used to search by C but as with L, any field can be used. This method uses L to return the first matching entry. The data is stored in a hash internally so the keys are unordered. Using this method with a search term like C will yield unexpected results.
46              
47             =head1 AUTHOR
48              
49             Cameron Daniel Ecdaniel@cpan.orgE
50              
51             =cut