Megaport::Locations
This provide a simple read-only list of Megaport on-net datacentres. Details about the objects returned by the API can be found here.
# Optional array or arrayref my @list = $locations->list; my $list = $locations->list; # Use search terms to find a partial list my @oceania = $locations->list(networkRegion => 'ANZ'); my @uk = $locations->list(country => 'United Kingdom'); # Or use a regexp to get a bit fancy my @dlr = $locations->list(name => qr/^Digital Realty/);
Returns a list or allows searching based on any field present in the object.
my $gs = $locations->get(id => 3); my $sy3 = $locations->get(name => 'Equinix SY3');
Best used to search by id but as with "list" in list, any field can be used. This method uses "first" in List::Util 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 country will yield unexpected results.
id
country
Cameron Daniel <cdaniel@cpan.org>
To install Megaport, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Megaport
CPAN shell
perl -MCPAN -e shell install Megaport
For more information on module installation, please visit the detailed CPAN module installation guide.