action.skip

Creating an MCR with the API

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

Before you begin, obtain a valid access token. For more information, see Creating an API Key.

To look up MCR location details in the Postman collection

  1. Expand the Locations folder in the left navigation and click GET locations.
    This request is not expecting Parameters or Body information.

  2. Click Send to make a GET request.

    GET {baseUrl}/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.

{
        {
            "id": 60,
            "name": "CoreSite LA1",
            "campus": "campus_deprecated",
            "metro": "Los Angeles",
            "country": "USA",
            "siteCode": "lax-cs1",
            "networkRegion": "MP1",
            "address": {
                "street": "624 South Grand Avenue",
                "city": "Los Angeles",
                "state": "CA",
                "country": "USA",
                "postcode": "90017"
            },
            "dc": {
                "id": 18,
                "name": "CoreSite"
            },
            "market": "US",
            "vRouterAvailable": true,
            "liveDate": 1449410400000,
            "status": "Active",
            "longitude": -118.25554,
            "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
                ]
            },
            "ordering_message": null,
            "diversityZones": {
                "mcr2": [
                    {
                        "name": "blue",
                        "maxAvailableBandwidth": 10000
                    },
                    {
                        "name": "red",
                        "maxAvailableBandwidth": 10000
                    }
                ],
                "megaport": [
                    {
                        "name": "red",
                        "speed": 1
                    },
                    {
                        "name": "red",
                        "speed": 10
                    },
                    {
                        "name": "red",
                        "speed": 100
                    },
                    {
                        "name": "blue",
                        "speed": 100
                    },
                    {
                        "name": "blue",
                        "speed": 10
                    },
                    {
                        "name": "blue",
                        "speed": 1
                    }
                ],
                "mve": [
                    {
                        "name": "blue",
                        "maxAvailableCpuCores": 12
                    },
                    {
                        "name": "red",
                        "maxAvailableCpuCores": 12
                    }
                ]
            }
        },

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 Megaport Cloud Router (MCR) in the left navigation and select Validate MCR Order (v3).

  2. Update the Body with the locationId (60), productName (whatever name you want for your MCR), term (the minimum number of months in the committed term: 1, 12, 24, or 36), and portSpeed (1000, 2500, 5000, or 10000 Mbps) and click Send.
    An ASN value is only required if you don’t want to use the Megaport default ASN of 133937.
    Add a diversity zone. Check the location results to see which diversity zones are available for your MCR location under diversityZones > mcr2.
    If the diversity zone is not explicitly selected, one will be automatically allocated when the MCR is created.

    POST {baseUrl}/v3/networkdesign/validate
    
[
    {
        "locationId":60,
        "term": 12,
        "promoCode": "promox3mnthfree2",
        "productName":"Test MCR",
        "productType":"MCR2",
        "portSpeed":2500,
        "config": {
          "mcrAsn": 133937,
          "diversityZone":"blue"
        }
    }
]

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": 1440.00,
                "fixedRecurringCharge": 0,
                "postPaidBaseRate": "no base rate",
                "longHaulMbpsRate": 0,
                "mbpsRate": 6.000000000000000,
                "currency": "USD",
                "key": "no key",
                "productType": "MCR2",
                "empty": false
            },
            "serviceName": "API Test MCR",
            "productType": "MCR2",
            "productUid": "78aebd6b-7601-4331-82bc-dcd07f9f21a6",
            "string": "Los Angeles"
        }
    ]
}

To order the validated MCR

  1. With a validated MCR request and reviewed cost information, copy the Body from POST Validate MCR Order (v3) and paste into the Body of POST Buy MCR (v3).

    Important

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

  2. Send the request.

    This output shows a successful response.

{
    "message": "MCR2 [426fa830-4b66-41ad-95a1-197d55e074b1] created.",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": [
        {
            "serviceName": "Test MCR",
            "name": "Test MCR",
            "secondaryName": null,
            "technicalServiceId": 187964,
            "technicalServiceUid": "426fa830-4b66-41ad-95a1-197d55e074b1",
            "requestedDate": 1707800936928,
            "configuredDate": null,
            "currentEstimatedDelivery": null,
            "companyName": "Megaport Lab",
            "companyId": 1153,
            "billingContactName": null,
            "billingContactId": null,
            "adminContactName": null,
            "adminContactId": null,
            "technicalContactName": null,
            "technicalContactId": null,
            "salesName": null,
            "salesId": null,
            "billableId": 179527,
            "billableUsageAlgorithm": null,
            "productType": "MCR2",
            "provisioningStatus": "DEPLOYABLE",
            "failedReason": null,
            "inAdvanceBillingStatus": null,
            "provisioningItems": [],
            "tags": [],
            "vxcDistanceBand": null,
            "intercapPath": null,
            "marketplaceVisibility": false,
            "vxcPermitted": true,
            "vxcAutoApproval": false,
            "createDate": 1707800936928,
            "terminationDate": null,
            "contractStartDate": null,
            "contractTermMonths": 12,
            "rateType": "MONTHLY",
            "trialAgreement": false,
            "payerCompanyId": null,
            "nonPayerCompanyId": null,
            "minimumSpeed": null,
            "maximumSpeed": null,
            "rateLimit": 2500,
            "errorMessage": null,
            "lagId": null,
            "aggregationId": null,
            "lagPrimary": null,
            "market": "USA",
            "accountManager": null,
            "promptUid": null,
            "components": [],
            "attributes": [],
            "aLocation": "lax-cs1",
            "bLocation": null,
            "aMetro": "Los Angeles",
            "aCountry": "USA",
            "aLocationId": 60,
            "bLocationId": null,
            "bMetro": null,
            "bCountry": null,
            "attributeTags": {},
            "createdBy": "f39b8983-256e-4643-adec-9f0b5da09ab7",
            "buyoutPort": false,
            "virtual": true,
            "locked": false,
            "adminLocked": false,
            "bgpShutdownDefault": false,
            "originDomain": null
        }
    ]
}

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.