APIを使用したMCRの作成
このトピックでは、APIの手順を使用して、MCRを作成します。これには、MCRのロケーションを検索する方法、注文を検証して完了する方法も含まれます。
PostmanコレクションでMCRのロケーションの詳細を検索するには
-
左側のナビゲーションで「Locations(ロケーション)」フォルダーを展開し、「GET locations (ロケーションを取得)」をクリックします。
この依頼には、ログイン依頼と同じContent-TypeヘッダーとX-Auth-Tokenヘッダーがあり、パラメーターやボディの情報は必要ありません。 2.「Send(送信)」をクリックして、GET依頼を行います。GET {baseUrl}/v2/locations
ステータスを探して、依頼が成功したことを確認します。「200 OK」をクリックして、ボディセクションにPretty形式で応答を表示します。
依頼はいくつものMegaportのロケーションを返します。
-
虫眼鏡をクリックして、製品オブジェクトにmcr2が含まれ、米国市場にあるサイトの応答を検索します。
製品オブジェクトは、そのロケーションで利用できる製品タイプを識別します。利用可能なMCR 2.0速度のmcr2アレイは、そのロケーションがMCRをサポートしている場合にのみ表示されます。
この例では、ロサンゼルスのCoreSiteを使用しています。
{ "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 },
MCRを作成するには、「id」値が必要です。この例では、ロケーションIDは60です。
MCR注文をテストおよび検証するには
-
Postmanで、左側のナビゲーションで「Megaport Cloud Router (MCR)(Megaportクラウドルーター(MCR))」を展開し、「Validate MCR Order(MCR注文を検証)」を選択します。
-
ボディを「locationId」(60)、「productName」(ポートに必要な名前)、および「portSpeed」(1000、2500、5000、または10000 Mbps)で更新します。「Send(送信)」をクリックします。
POST {baseUrl}/v2/networkdesign/validate
[ { "locationId": 60, "productName": "API Test MCR", "productType": "MCR2", "portSpeed": 5000, "config": { "mcrAsn": 64496 } } ]
成功した応答は検証に合格し、「200 OK」ステータスになります。応答には、サービスの価格の詳細も含まれます。
{ "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" } ] }
検証済みのMCRを注文するには
-
検証済みのMCR依頼と確認済みのコスト情報を使用して、「POST Validate MCR Order(MCR注文の検証を発行)」からボディをコピーし、「POST Buy MCR(MCRの購入を発行)」のボディに貼り付けます。
重要
api.megaport.comでこの電話をかけると、アカウントにサービスの料金が請求されます。または、これらの例のように、ステージング(テスト)環境で無料でAPIを使用することもできます。
-
依頼を送信します。
この出力は、成功した応答を示しています。
{ "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 } ] }
これで、新規MCRが、portal.megaport.comまたはportal-staging.megaport.comのいずれかの作業環境に表示されます。
ヒント
この例で使用されている依頼のすべてのオプションを確認するには、https://dev.megaport.comを参照してください。
次のステップは、このMCRへのVXCを作成することです。