网络速度 - 如何从getItemPrices中查找ID以增加softlayer中的maxspeed

时间:2016-02-12 09:00:37

标签: ibm-cloud-infrastructure

我按照以下步骤将网络最大速度提高到1 gbps,

  1. 使用API​​查找包ID:

    https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$vsi/getObject?objectMask=mask[billingItem[package]]
    
  2. 接下来,我需要获得1 gbps速度的商品价格ID并使用以下API:

    https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/$packageId/getItemPrices
    
  3. 由于我不知道从这个输出中选择了哪个ID,所以这就卡住了。我需要将速度提高到1gbps(专用网络)。我在输出中看到了多个ID。

    我想帮助识别正确的ID,以便我可以通过升级请求继续提高最高速度。

1 个答案:

答案 0 :(得分:0)

此请求将帮助您获取有效的商品价格以升级您的虚拟服务器:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[vsi_id]/getUpgradeItemPrices
Method: GET

在结果中应显示如下内容:

{
"currentPriceFlag": false
"hourlyRecurringFee": ".04"
"id": 274
"itemId": 188
"laborFee": "0"
"locationGroupId": null
"onSaleFlag": null
"oneTimeFee": "0"
"quantity": null
"recurringFee": "20"
"setupFee": "0"
"sort": 3
"accountRestrictions": [0]
"categories": [1]
0:  {
"categoryCode": "port_speed"
"id": 26
"name": "Uplink Port Speeds"
"quantityLimit": 0
}-
-
"item": {
"capacity": "1000"
"description": "1 Gbps Public & Private Network Uplinks"
"id": 188
"itemTaxCategoryId": 166
"keyName": "1_GBPS_PUBLIC_PRIVATE_NETWORK_UPLINKS"
"softwareDescriptionId": null
"units": "Mbps"
"upgradeItemId": null
"attributes": [0]
}-
}

我们需要的ID是274(使用测试帐户并且对我的VSI有效) 现在,要升级虚拟访客,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder

Method: POST

{
  "parameters": [
    {
      "complexType": "SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade",
      "prices": [
        {
          "id": 274
        }
      ],
      "virtualGuests": [
        {
          "id": 11498369
        }
      ],
      "properties": [
        {
          "name": "NOTE_GENERAL",
          "value": "upgrading speed"
        },
        {
          "name": "MAINTENANCE_WINDOW",
          "value": "2015-10-05T9:00:00-05:00"
        }
      ]
    }
  ]
}

其中:“11498369”是要升级的vsi_id

<强>参考: Modify Device Configuration

然后,如果要将私有/公共网络接口速度更改为新速度: 执行(专用网络速度示例):

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[vsi_id]/setPrivateNetworkInterfaceSpeed.json

Method: POST
{
    "parameters": [    
      10
    ]
}

<强>参考文献:

  

http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/setPrivateNetworkInterfaceSpeed

     

http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/setPublicNetworkInterfaceSpeed