{"id":23705710,"url":"https://github.com/ccakes/megaport-perl","last_synced_at":"2026-02-03T03:30:14.831Z","repository":{"id":56840156,"uuid":"84317372","full_name":"ccakes/megaport-perl","owner":"ccakes","description":"Simple Perl interface to the Megaport API","archived":false,"fork":false,"pushed_at":"2017-03-08T22:03:35.000Z","size":16,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T14:56:36.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccakes.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-08T12:23:10.000Z","updated_at":"2017-03-08T12:25:07.000Z","dependencies_parsed_at":"2022-08-28T22:00:12.755Z","dependency_job_id":null,"html_url":"https://github.com/ccakes/megaport-perl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccakes%2Fmegaport-perl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccakes%2Fmegaport-perl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccakes%2Fmegaport-perl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccakes%2Fmegaport-perl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccakes","download_url":"https://codeload.github.com/ccakes/megaport-perl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239786254,"owners_count":19696772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-30T14:56:51.272Z","updated_at":"2026-02-03T03:30:14.770Z","avatar_url":"https://github.com/ccakes.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ccakes/megaport-perl.svg?branch=master)](https://travis-ci.org/ccakes/megaport-perl) [![MetaCPAN Release](https://badge.fury.io/pl/Megaport.svg)](https://metacpan.org/release/Megaport)\nMegaport - Simple access to the [Megaport](https://www.megaport.com) API\n\n# SYNOPSIS\n\n    use Megaport;\n\n    # Using an existing session token\n    my $mp = Megaport-\u003enew(token =\u003e 'your-session-token');\n\n    # Using a username/password combo\n    my $mp = Megaport-\u003enew(username =\u003e 'me@example.com', password =\u003e 's3cr3t');\n\n    # Get a list of locations (on-net datacentres)\n    my @locations = $mp-\u003esession-\u003elocations-\u003elist;\n\n    # Get a partial list\n    my @locations = $mp-\u003esession-\u003elocations-\u003elist(country =\u003e 'Australia');\n    my @locations = $mp-\u003esession-\u003elocations-\u003elist(name =\u003e qr/^Digital Realty/);\n\n    # Get a single entry\n    my $global_switch = $mp-\u003esession-\u003elocations-\u003eget(id =\u003e 3);\n\n    # Services\n    my $services = $mp-\u003esession-\u003eservices;\n    $services-\u003elist(...);\n    $services-\u003eget(...);\n\n    # Other Megaports on the network\n    my $ports = $mp-\u003esession-\u003eports;\n    $ports-\u003elist(...);\n\n# DESCRIPTION\n\nThis module provides a Perl interface to the [Megaport](https://www.megaport.com) API. This is largely to fill my own requirements and for now is read only. Read/write functionality will be added over time to support service modification.\n\n# METHODS\n\n## new\n\n    my $mp = Megaport-\u003enew(\n      token =\u003e 'your-session-token',\n      uri =\u003e 'https://api.megaport.com/v2',\n      debug =\u003e 0,\n      no_verify =\u003e 0\n    );\n\nThe fields `token`, `username` and `password` are all auth relatated and should be fairly self explanatory. If you're unsure about token, take a look at the [Megaport docs](https://dev.megaport.com/#security).\n\n`debug` enables extra output to STDERR during API calls. [Megaport::Client](https://metacpan.org/pod/Megaport::Client) by default will validate the token or user credentials by making a POST call to the Megaport API, set `no_verify` to stop this and speed things up.\n\nAs at this writing, the production Megaport API is at https://api.megaport.com with a test environment mentioned in the documentation at https://api-staging.megaport.com. If you wish to change environments, set `uri`.\n\n## session\n\n    my $session = $mp-\u003esession;\n\nReturns a [Megaport::Session](https://metacpan.org/pod/Megaport::Session) object which contains an authenticated client ready to start making calls.\n\n# TODO\n\n- Module/helper for per-service type to make data access easier\n    - Dig into VXCs/IX from top level service\n    - Access pricing/cost estimate info per service\n- Simple service modification, speed/VLAN etc\n- Helper method to link partner ports and location to make searching by city/country/region easier\n- Company object with access to users, invoices and outstanding balance\n\n# AUTHOR\n\nCameron Daniel \u003ccdaniel@cpan.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccakes%2Fmegaport-perl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccakes%2Fmegaport-perl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccakes%2Fmegaport-perl/lists"}