Megaport::Locations
DESCRIPTION
This provide a simple read-only list of Megaport on-net datacentres. Details about the objects returned by the API can be found here.
METHODS
list
# 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.
get
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.
AUTHOR
Cameron Daniel <cdaniel@cpan.org>