此请求将帮助您获得有效的商品价格以升级您的虚拟服务器:
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