1

我按照以下步骤将网络最大速度提高到 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
    

这是我卡住的地方,因为我不知道需要从这个输出中选择哪个 ID。我需要将速度提高到 1gbps(专用网络)。我在输出中看到了不止一个 ID。

我需要一些帮助来确定正确的ID,以便我可以通过升级请求继续提高最大速度。

4

1 回答 1

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

参考: 修改设备配置

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

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

于 2016-02-12T15:05:14.810 回答