Creating an MCR with the API

This topic steps through the API procedure to create an MCR, including how to look up locations for the MCR, and how to validate and complete the order.

To look up MCR location details in the Postman collection

  1. Click Lists for Ordering in the left navigation and click GET locations.
    This request has the same Content-Type and X-Auth-Token headers as the login request and it is not expecting Parameters or Body information.
  2. Click Send to make a GET request.

    GET {API Server URL}/v2/locations
    

    Get locations

    Ensure the request was successful by looking for Status: 200 OK and display the response in the Body section in the Pretty format.

    The request returns hundreds of Megaport locations.

  3. Click the magnifying glass and search the response for a site that includes mcr2 in the products object and is in the US market.

    The products object identifies the product types that are available for the location. An mcr2 array with available MCR 2.0 speeds is visible only if the location supports MCR 2.0.

    This example uses the CoreSite, Los Angeles location.

{
            "country": "USA",
            "liveDate": 1449446400000,
            "siteCode": "lax-cs1",
            "networkRegion": "MP1",
            "address": {
                "country": "USA",
                "city": "Los Angeles",
                "street": "624 South Grand Avenue",
                "postcode": "90017",
                "suburb": null,
                "state": "CA"
            },
            "campus": "campus_deprecated",
            "latitude": 34.04791,
            "products": {
                "mcr": true,
                "mcrVersion": 2,
                "megaport": [
                    1,
                    10,
                    100
                ],
                "mcr1": [
                    100,
                    500,
                    1000,
                    2000,
                    3000,
                    4000,
                    5000
                ],
                "mcr2": [
                    1000,
                    2500,
                    5000,
                    10000
                ]
            },
            "market": "US",
            "metro": "Los Angeles",
            "name": "CoreSite LA1",
            "vRouterAvailable": true,
            "id": 60,
            "dc": {
                "name": "CoreSite",
                "id": 18
            },
            "status": "Active",
            "longitude": -118.25554,
            "ordering_message": null
        },

To create an MCR, you need the id value. In this example, the location ID is 60.

To test and validate the MCR order

  1. In Postman, expand API Orders in the left navigation and select Validate VRouter.

  2. Update the Body with the locationId (60), productName (whatever name you want for your Port), and portSpeed (1000, 2500, 5000, or 10000 Mbps) and click Send.

    POST {API Server URL}/v2/networkdesign/validate
    
[
  {
    "locationId": 60,
    "productName": "API Test MCR",
    "productType": "MCR2",
    "portSpeed": 5000,
    "config": {
      "mcrAsn": 64496
    }
  }
]

A successful response passes validation and has a 200 OK status. The response also includes pricing details of the service.

{
    "message": "Validation passed",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": [
        {
            "price": {
                "hourlySetup": 0,
                "dailySetup": 0,
                "monthlySetup": 0,
                "hourlyRate": 0,
                "dailyRate": 0,
                "monthlyRate": 1200.00,
                "fixedRecurringCharge": 0,
                "postPaidBaseRate": "no base rate",
                "longHaulMbpsRate": 0,
                "mbpsRate": 5.000000000,
                "currency": "USD",
                "key": "no key",
                "productType": "MCR2",
                "empty": false
            },
            "serviceName": "API MCR",
            "productType": "MEGAPORT",
            "productUid": "34fcd3b6-b2c8-4b39-8d99-b59f0c488717",
            "string": "Los Angeles"
        }
    ]
}

To order the validated MCR

  1. With a validated MCR request and reviewed cost information, copy the body from POST Validate VRouter and paste into the body of POST Buy VRouter.

    Important

    If you make this call on api.megaport.com, your account will be charged for the service. Alternatively, you can provision against the staging API without charges, as in these examples.

  2. Send the request.

    This output shows a successful response.

{
    "message": "MCR2 [b7d93096-0782-478c-8382-ba10a1c0973a] created. ",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": [
        {
            "serviceName": "API MCR",
            "name": "API MCR",
            "secondaryName": null,
            "technicalServiceId": 60670,
            "technicalServiceUid": "b7d93096-0782-478c-8382-ba10a1c0973a",
            "requestedDate": 1593554373089,
            "configuredDate": null,
            "currentEstimatedDelivery": null,
            "companyName": "Kunakin",
            "companyId": 31156,
            "aggregationId": null,
            "lagPrimary": false,
            "billingContactName": null,
            "billingContactId": null,
            "adminContactName": null,
            "adminContactId": null,
            "technicalContactName": null,
            "technicalContactId": null,
            "salesName": null,
            "salesId": null,
            "billableId": 59875,
            "billableUsageAlgorithm": "POST_PAID_HOURLY_SPEED_MCR2",
            "productType": "MCR2",
            "provisioningStatus": "DEPLOYABLE",
            "inAdvanceBillingStatus": "NOT_ACTIVATED",
            "provisioningItems": [],
            "tags": [],
            "vxcDistanceBand": null,
            "intercapPath": null,
            "marketplaceVisibility": true,
            "vxcPermitted": true,
            "vxcAutoApproval": false,
            "createDate": 1593554373089,
            "terminationDate": null,
            "contractStartDate": 1593525600000,
            "contractTermMonths": 1,
            "rateType": "MONTHLY",
            "trialAgreement": false,
            "payerCompanyId": null,
            "nonPayerCompanyId": null,
            "minimumSpeed": null,
            "maximumSpeed": null,
            "rateLimit": 5000,
            "errorMessage": null,
            "market": "USA",
            "accountManager": null,
            "promptUid": null,
            "components": [],
            "attributes": [],
            "aLocation": null,
            "bLocation": null,
            "aLocationId": null,
            "bLocationId": null,
            "attributeTags": {},
            "createdBy":  "a51cc1c6-95a0-48c7-a5a0-e49d77a6c536",
            "buyoutPort": false,
            "virtual": true,
            "locked": false,
            "adminLocked": false
        }
    ]
}

The new MCR now appears in your working environment, either portal.megaport.com or portal-staging.megaport.com.

New API MCR

Tip

To see all options for the requests used in this example, see https://dev.megaport.com

The next step is to create VXCs to this MCR.


Last update: